19ec28b9c928bb2365116aa621fd7c15523b7a21
[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
55 You can use an existing key, or generate a new one just for CrowdNode. \
56 (I recommend printing a Paper Wallet (WIF QR) and sticking it in your safe)
57
58 You can preload your staking key with the amount you wish to stake, or deposit
59 when prompted via
60
61 - QR Code
62 - Dash URL
63 - or Payment Address
64
65 You will be given these options whenever the existing balance is low.
66
67 0. Generate or Import a **permanent** staking key:
68    ```bash
69    # Generate a new key in your CrowdNode CLI wallet:
70    crowdnode generate
71    ```
72    Or
73    ```bash
74    # Save a key from dash-cli or Dash Core's Debug Console to a file for import:
75    #    walletpassphrase "YOUR PASSHRASE" 300
76    #    dumprivkey XxYOURxADDRESSx
77    #
78    # Import to the CrowdNode CLI wallet:
79    crowdnode import ./your-key-file.wif.txt
80    ```
81 1. Load the amount of Dash you wish to stake, plus a little extra for fees:
82    ```bash
83    crowdnode load 0.503
84    ```
85    (you can load a balance via **QR Code**, Dash URL, and Payment Address)
86 2. Send the Sign Up request and the [CrowdNode Terms of Service](https://crowdnode.io/terms/):
87    ```bash
88    # Sign Up sends Đ0.00151072 to create your account
89    crowdnode signup
90    
91    # Accept sends Đ0.00085536 to accept terms and enable deposits
92    crowdnode accept
93    ```
94 3. Deposit a test stake (in DASH)
95    ```bash
96    # Create a test deposit:
97    crowdnode deposit 0.01
98    
99    # Stake the remaining balance:
100    crowdnode deposit
101    
102    # Load and stake another Đ10:
103    crowdnode deposit 10.0
104    ```
105    Note: CrowdNode requires a minimum stake of Đ0.5 to earn interest.
106
107 You can withdrawal from 1.0% to 100.0% of your stake at any time, and transfer to an address in another wallet:
108
109 ```bash
110 # Withdrawal 5.0%
111 crowdnode withdrawal 5.0
112
113 # Transfer your balance
114 crowdnode transfer XxYOURxOTHERxADDRESSx 5.0
115 ```
116
117 ## All Commmands
118
119 ```bash
120 Usage:
121     crowdnode help
122     crowdnode status [keyfile-or-addr]
123     crowdnode signup [keyfile-or-addr]
124     crowdnode accept [keyfile-or-addr]
125     crowdnode deposit [keyfile-or-addr] [dash-amount] [--no-reserve]
126     crowdnode withdrawal [keyfile-or-addr] <percent> # 1.0-100.0 (steps by 0.1)
127
128 Helpful Extras:
129     crowdnode balance [keyfile-or-addr]
130     crowdnode load [keyfile-or-addr] [dash-amount]
131     crowdnode transfer <from-keyfile-or-addr> <to-keyfile-or-addr> [dash-amount]
132
133 Key Management & Encryption:
134     crowdnode generate [./privkey.wif] [--plain-text]
135     crowdnode list
136     crowdnode use <addr>            # set as default key
137     crowdnode passphrase            # set or rotate passphrase
138     crowdnode import <keyfile>      # copy and encrypt key
139     crowdnode encrypt               # encrypt all keys
140     crowdnode decrypt               # decrypt all keys
141     crowdnode delete <addr>         # delete key (must have 0 balance)
142
143 CrowdNode HTTP RPC:
144     crowdnode http FundsOpen <addr>
145     crowdnode http VotingOpen <addr>
146     crowdnode http GetFunds <addr>
147     crowdnode http GetFundsFrom <addr> <seconds-since-epoch>
148     crowdnode http GetBalance <addr>
149     crowdnode http GetMessages <addr>
150     crowdnode http IsAddressInUse <addr>
151     crowdnode http SetEmail ./privkey.wif <email> <signature>
152     crowdnode http Vote ./privkey.wif <gobject-hash>
153         <Yes|No|Abstain|Delegate|DoNothing> <signature>
154     crowdnode http SetReferral ./privkey.wif <referral-id> <signature>
155 ```
156
157 ## Glossary
158
159 | Term          | Description                                                          |
160 | ------------- | -------------------------------------------------------------------- |
161 | addr          | your Dash address (Base58Check-encoded Pay-to-PubKey Address)        |
162 | ./privkey.wif | the file path to your staking key in WIF (Base58Check) format        |
163 | signature     | generated with [dashmsg](https://webinstall.dev/dashmsg) or dash-cli |
164
165 # JS API Documentation
166
167 See <https://github.com/dashhive/crowdnode.js>.
168
169 # Official CrowdNode Docs
170
171 <https://knowledge.crowdnode.io/en/articles/5963880-blockchain-api-guide>