docs: make it clear that npm vs npx is either or
[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 ```bash
16 # Mac, Linux
17 curl https://webinstall.dev/node | bash
18 export PATH="${HOME}/.local/opt/node:$PATH"
19 ```
20
21 ```pwsh
22 # Windows
23 curl.exe -A MS https://webinstall.dev/node | powershell
24 PATH %USERPROFILE%\.local\opt\node;%PATH%
25 ```
26
27 ## CrowdNode CLI
28
29 ```bash
30 # Install to system, globally
31 npm install --location=global crowdnode-cli@v1
32 ```
33
34 Or
35
36 ```bash
37 # Run without installing 
38 npx crowdnode-cli@v1
39 ```
40
41 # CLI Usage
42
43 CrowdNode staking is managed with a **permanent staking key**.
44
45 The Dash you stake **can NOT be retrieved** without this key!
46
47 ## QuickStart
48
49 You can use an existing key, or generate a new one just for CrowdNode. \
50 (I recommend printing a Paper Wallet (WIF QR) and sticking it in your safe)
51
52 You can preload your staking key with the amount you wish to stake, or deposit
53 when prompted via
54
55 - QR Code
56 - Dash URL
57 - or Payment Address
58
59 You will be given these options whenever the existing balance is low.
60
61 0. Generate a **permanent** staking key (just one):
62    ```bash
63    crowdnode generate ./privkey.wif
64    ```
65    (and put a backup in a safe place)
66 1. Send a (tiny) Sign Up payment (Đ0.00151072)
67    ```bash
68    crowdnode signup ./privkey.wif
69    ```
70 2. Accept the Terms of Use via payment (Đ0.00085536)
71    ```bash
72    crowdnode accept ./privkey.wif
73    ```
74 3. Deposit your stake
75    ```bash
76    crowdnode deposit ./privkey.wif
77    ```
78
79 ## All Commmands
80
81 ```bash
82 Usage:
83     crowdnode help
84     crowdnode status ./privkey.wif
85     crowdnode signup ./privkey.wif
86     crowdnode accept ./privkey.wif
87     crowdnode deposit ./privkey.wif [amount] [--no-reserve]
88     crowdnode withdrawal ./privkey.wif <permil> # 1-1000 (1.0-100.0%)
89
90 Helpful Extras:
91     crowdnode generate [./privkey.wif]
92     crowdnode balance ./privkey.wif
93     crowdnode transfer ./source.wif <key-file-or-pub-addr>
94
95 CrowdNode HTTP RPC:
96     crowdnode http FundsOpen <addr>
97     crowdnode http VotingOpen <addr>
98     crowdnode http GetFunds <addr>
99     crowdnode http GetFundsFrom <addr> <seconds-since-epoch>
100     crowdnode http GetBalance <addr>
101     crowdnode http GetMessages <addr>
102     crowdnode http IsAddressInUse <addr>
103     crowdnode http SetEmail ./privkey.wif <email> <signature>
104     crowdnode http Vote ./privkey.wif <gobject-hash>
105         <Yes|No|Abstain|Delegate|DoNothing> <signature>
106     crowdnode http SetReferral ./privkey.wif <referral-id> <signature>
107 ```
108
109 ## Glossary
110
111 | Term          | Description                                                   |
112 | ------------- | ------------------------------------------------------------- |
113 | addr          | your Dash address (Base58Check-encoded Pay-to-PubKey Address) |
114 | amount        | the integer value of "Duffs" (Đ/100000000)                    |
115 | permil        | 1/1000, 1‰, or 0.1% - between 1 and 1000 (0.1% to 100.0%)     |
116 | ./privkey.wif | the file path to your staking key in WIF (Base58Check) format |
117
118 # JS API Documentation
119
120 See <https://github.com/dashhive/crowdnode.js>.
121
122 # Official CrowdNode Docs
123
124 <https://knowledge.crowdnode.io/en/articles/5963880-blockchain-api-guide>