77c6b5fe8dad9ab20fffcb46a62ab687be215138
[crowdnode.js/.git] / cli / README.md
1 # CrowdNode CLI
2
3 [CrowdNode](https://crowdnode.io/) allows you to become a partial MNO - staking
4 Dash to earn interest, participate in voting, etc.
5
6 This cross-platform CrowdNode CLI enables you to privately manage your stake via
7 their KYC-free Blockchain API.
8
9 # Install
10
11 ## Node.js
12
13 You must have [node.js](https://webinstall.dev/node) installed:
14
15 ### Mac & Linux
16
17 ```bash
18 curl https://webinstall.dev/node | bash
19 export PATH="${HOME}/.local/opt/node:$PATH"
20 ```
21
22 ### Windows
23
24 ```pwsh
25 curl.exe -A MS https://webinstall.dev/node | powershell
26 PATH %USERPROFILE%\.local\opt\node;%PATH%
27 ```
28
29 ## CrowdNode CLI
30
31 ```bash
32 # Install to system, globally
33 npm install --location=global crowdnode-cli@v1
34 ```
35
36 Or
37
38 ```bash
39 # Run without installing
40 npx crowdnode-cli@v1
41 ```
42
43 # CLI Usage
44
45 CrowdNode staking is managed with a **permanent staking key**.
46
47 The Dash you stake **can NOT be retrieved** without this key!
48
49 ## QuickStart
50
51 - Generate a new staking key, or Import from an existing wallet
52 - Load the key with Dash
53 - Sign up & Accept the CrowdNode's Terms
54 - Deposit
55 - Withdrawal and Transfer at any time
56
57 Note: I recommend printing a Paper Wallet (WIF QR) and putting it your safe.
58
59 0. Generate or Import a **permanent** staking key:
60    ```bash
61    # Generate a new key in your CrowdNode CLI wallet:
62    crowdnode generate
63    ```
64    Or
65    ```bash
66    # Save a key from dash-cli or Dash Core's Debug Console to a file for import:
67    #    walletpassphrase "YOUR PASSHRASE" 300
68    #    dumprivkey XxYOURxADDRESSx
69    #
70    # Import to the CrowdNode CLI wallet:
71    crowdnode import ./your-key-file.wif.txt
72    ```
73 1. Load the amount of Dash you wish to stake, plus a little extra for fees:
74    ```bash
75    crowdnode load 0.503
76    ```
77    (you can load a balance via **QR Code**, Dash URL, and Payment Address)
78 2. Send the Sign Up request and the [CrowdNode Terms of Service](https://crowdnode.io/terms/):
79    ```bash
80    # Sign Up sends Đ0.00151072 to create your account
81    crowdnode signup
82    
83    # Accept sends Đ0.00085536 to accept terms and enable deposits
84    crowdnode accept
85    ```
86 3. Deposit a test stake (in DASH)
87    ```bash
88    # Create a test deposit:
89    crowdnode deposit 0.01
90    
91    # Stake the remaining balance:
92    crowdnode deposit
93    
94    # Load and stake another Đ10:
95    crowdnode deposit 10.0
96    ```
97    Note: CrowdNode requires a minimum stake of Đ0.5 to earn interest.
98
99 You can withdrawal from 1.0% to 100.0% of your stake at any time, and transfer to an address in another wallet:
100
101 ```bash
102 # Withdrawal 5.0%
103 crowdnode withdrawal 5.0
104
105 # Transfer your balance
106 crowdnode transfer XxYOURxOTHERxADDRESSx 5.0
107 ```
108
109 ## All Commmands
110
111 ```bash
112 Usage:
113     crowdnode help
114     crowdnode status [keyfile-or-addr]
115     crowdnode signup [keyfile-or-addr]
116     crowdnode accept [keyfile-or-addr]
117     crowdnode deposit [keyfile-or-addr] [dash-amount] [--no-reserve]
118     crowdnode withdrawal [keyfile-or-addr] <percent> # 1.0-100.0 (steps by 0.1)
119
120 Helpful Extras:
121     crowdnode balance [keyfile-or-addr]
122     crowdnode load [keyfile-or-addr] [dash-amount]
123     crowdnode transfer <from-keyfile-or-addr> <to-keyfile-or-addr> [dash-amount]
124
125 Key Management & Encryption:
126     crowdnode generate [./privkey.wif] [--plain-text]
127     crowdnode list
128     crowdnode use <addr>            # set as default key
129     crowdnode passphrase            # set or rotate passphrase
130     crowdnode import <keyfile>      # copy and encrypt key
131     crowdnode encrypt               # encrypt all keys
132     crowdnode decrypt               # decrypt all keys
133     crowdnode delete <addr>         # delete key (must have 0 balance)
134
135 CrowdNode HTTP RPC:
136     crowdnode http FundsOpen <addr>
137     crowdnode http VotingOpen <addr>
138     crowdnode http GetFunds <addr>
139     crowdnode http GetFundsFrom <addr> <seconds-since-epoch>
140     crowdnode http GetBalance <addr>
141     crowdnode http GetMessages <addr>
142     crowdnode http IsAddressInUse <addr>
143     crowdnode http SetEmail ./privkey.wif <email> <signature>
144     crowdnode http Vote ./privkey.wif <gobject-hash>
145         <Yes|No|Abstain|Delegate|DoNothing> <signature>
146     crowdnode http SetReferral ./privkey.wif <referral-id> <signature>
147 ```
148
149 ## Glossary
150
151 | Term          | Description                                                          |
152 | ------------- | -------------------------------------------------------------------- |
153 | addr          | your Dash address (Base58Check-encoded Pay-to-PubKey Address)        |
154 | ./privkey.wif | the file path to your staking key in WIF (Base58Check) format        |
155 | signature     | generated with [dashmsg](https://webinstall.dev/dashmsg) or dash-cli |
156
157 # JS API Documentation
158
159 See <https://github.com/dashhive/crowdnode.js>.
160
161 # Official CrowdNode Docs
162
163 <https://knowledge.crowdnode.io/en/articles/5963880-blockchain-api-guide>