docs: remove optional keyfile
[crowdnode.js/.git] / cli / README.md
1 # CrowdNode CLI
2
3 CrowdNode allows you to become a partial MNO - staking Dash to earn interest,
4 participate in voting, etc.
5
6 This cross-platform CrowdNode CLI enables you to privately manage your stake via
7 their KYC-free Blockchain CLI.
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 You can use an existing key, or generate a new one just for CrowdNode. \
52 (I recommend printing a Paper Wallet (WIF QR) and sticking it in your safe)
53
54 You can preload your staking key with the amount you wish to stake, or deposit
55 when prompted via
56
57 - QR Code
58 - Dash URL
59 - or Payment Address
60
61 You will be given these options whenever the existing balance is low.
62
63 0. Generate a **permanent** staking key (just one):
64    ```bash
65    crowdnode generate
66    ```
67    (and put a backup in a safe place)
68 1. Send a (tiny) Sign Up payment (Đ0.00151072)
69    ```bash
70    crowdnode signup
71    ```
72 2. Accept the Terms of Use via payment (Đ0.00085536)
73    ```bash
74    crowdnode accept
75    ```
76 3. Deposit your stake (in DASH)
77    ```bash
78    crowdnode deposit 0.01
79    ```
80
81 ## All Commmands
82
83 ```bash
84 Usage:
85     crowdnode help
86     crowdnode status [keyfile-or-addr]
87     crowdnode signup [keyfile-or-addr]
88     crowdnode accept [keyfile-or-addr]
89     crowdnode deposit [keyfile-or-addr] [dash-amount] [--no-reserve]
90     crowdnode withdrawal [keyfile-or-addr] <percent> # 1.0-100.0 (steps by 0.1)
91
92 Helpful Extras:
93     crowdnode balance [keyfile-or-addr]
94     crowdnode load [keyfile-or-addr] [dash-amount]
95     crowdnode transfer <from-keyfile-or-addr> <to-keyfile-or-addr> [dash-amount]
96
97 Key Management & Encryption:
98     crowdnode generate [./privkey.wif] [--plain-text]
99     crowdnode list
100     crowdnode use <addr>            # set as default key
101     crowdnode passphrase            # set or rotate passphrase
102     crowdnode import <keyfile>      # copy and encrypt key
103     crowdnode encrypt               # encrypt all keys
104     crowdnode decrypt               # decrypt all keys
105     crowdnode delete <addr>         # delete key (must have 0 balance)
106
107 CrowdNode HTTP RPC:
108     crowdnode http FundsOpen <addr>
109     crowdnode http VotingOpen <addr>
110     crowdnode http GetFunds <addr>
111     crowdnode http GetFundsFrom <addr> <seconds-since-epoch>
112     crowdnode http GetBalance <addr>
113     crowdnode http GetMessages <addr>
114     crowdnode http IsAddressInUse <addr>
115     crowdnode http SetEmail ./privkey.wif <email> <signature>
116     crowdnode http Vote ./privkey.wif <gobject-hash>
117         <Yes|No|Abstain|Delegate|DoNothing> <signature>
118     crowdnode http SetReferral ./privkey.wif <referral-id> <signature>
119 ```
120
121 ## Glossary
122
123 | Term          | Description                                                          |
124 | ------------- | -------------------------------------------------------------------- |
125 | addr          | your Dash address (Base58Check-encoded Pay-to-PubKey Address)        |
126 | ./privkey.wif | the file path to your staking key in WIF (Base58Check) format        |
127 | signature     | generated with [dashmsg](https://webinstall.dev/dashmsg) or dash-cli |
128
129 # JS API Documentation
130
131 See <https://github.com/dashhive/crowdnode.js>.
132
133 # Official CrowdNode Docs
134
135 <https://knowledge.crowdnode.io/en/articles/5963880-blockchain-api-guide>