dashhive / crowdnode-cli

Earn ~6% Interest on Dash via CrowdNode - CLI for Mac, Linux, and Windows
https://github.com/dashhive/crowdnode-cli
MIT License
4 stars 1 forks source link

Crowdnode CLI Testing Report #26

Open BFWookie opened 1 year ago

BFWookie commented 1 year ago

Crowdnode CLI Testing Report

Hello, I've been testing out the crowdnode cli and would like to provide my feedback to the team. Since I had a CLI only Core Wallet installed on my server already I performed the steps to import the keys instead.

I installed CrowdNode CLI on Ubuntu 22.04 Server running Dash Core Wallet v18.1.0 using the following steps and then switching to v16 with the n tool:

sudo apt install nodejs npm
sudo npm install -g n
sudo n v16

When trying to install the app as per instructions I received this error:

npm install --location=global crowdnode-cli@v1
node:internal/modules/cjs/loader:1021
  const err = new Error(message);
              ^

Error: Cannot find module 'semver'
Require stack:
- /usr/share/nodejs/npm/lib/utils/unsupported.js
- /usr/share/nodejs/npm/lib/cli.js
- /usr/share/nodejs/npm/bin/npm-cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1021:15)
    at Function.Module._load (node:internal/modules/cjs/loader:866:27)
    at Module.require (node:internal/modules/cjs/loader:1093:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.<anonymous> (/usr/share/nodejs/npm/lib/utils/unsupported.js:2:16)
    at Module._compile (node:internal/modules/cjs/loader:1191:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
    at Module.load (node:internal/modules/cjs/loader:1069:32)
    at Function.Module._load (node:internal/modules/cjs/loader:904:12)
    at Module.require (node:internal/modules/cjs/loader:1093:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/share/nodejs/npm/lib/utils/unsupported.js',
    '/usr/share/nodejs/npm/lib/cli.js',
    '/usr/share/nodejs/npm/bin/npm-cli.js'
  ]
}

But worked when I used sudo:

sudo npm install -g crowdnode-cli@v1

Used dash-cli to get a new address and it's private key:

dash-cli getnewaddress
dash-cli walletpassphrase
dash-cli dumpprivkey

NOTE: There is a typo on the doc at step 0 where dumprivkey should be dumpprivkey. I also suggest the instructions include saving the privkey to a wif file. I did not know exactly what the wif file format was and then found that just dumpprivkey > crowdnode.wif did the trick.

First time I ran crowdnode stake I did not send enough funds and received this error:

crowdnode stake ./crowdnode.wif
dash://##MYCROWDNODEADDRESS##?amount=0.50300000

Send Đ0.50300000 to your staking key via the QR above, or its address:
##MYCROWDNODEADDRESS##
(this key will be used to fund and control your CrowdNode account)
(waiting...)

Received 50298158

dash://##MYCROWDNODEADDRESS##

Fail:
RangeError: Invalid count value
    at String.repeat (<anonymous>)
    at collectSignupFees (/usr/local/lib/node_modules/crowdnode-cli/node_modules/crowdnode/bin/crowdnode.js:2060:20)
    at sendSignup (/usr/local/lib/node_modules/crowdnode-cli/node_modules/crowdnode/bin/crowdnode.js:1833:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async stakeDash (/usr/local/lib/node_modules/crowdnode-cli/node_modules/crowdnode/bin/crowdnode.js:494:7)
    at async main (/usr/local/lib/node_modules/crowdnode-cli/node_modules/crowdnode/bin/crowdnode.js:199:5)

The second attempt worked without issue:

crowdnode stake ./crowdnode.wif
Enter passphrase: ***********************************

🔐 Imported ~/.config/crowdnode/keys/##MYCROWDNODEADDRESS##.wif

Checking CrowdNode account...
    ℹ️ SignUpForApi deposit is 151072 (+ tx fee)
    ℹ️ AcceptTerms deposit is 85536 (+ tx fee)

dash://##MYCROWDNODEADDRESS##?amount=0.50300000

Send Đ0.50300000 to your staking key via the QR above, or its address:
##MYCROWDNODEADDRESS##
(this key will be used to fund and control your CrowdNode account)

(waiting...)

Received 50300000
Requesting account...
    ✅ SignUpForApi
Accepting terms...
    ✅ AcceptTerms
reserving 50000 (Đ0.00050000) for withdraws (--no-reserve to disable)
Initiating deposit of 50052927 (Đ0.50052927)...
    ✅ DepositReceived
Checking balance...
Key:       Đ  0.00060014  
CrowdNode: Đ  0.50238197  
Dividends: Đ  0.00000000  

Then I tried to get status but failed:

crowdnode status crowdnode.wif 

could not read 'crowdnode.wif' in ./ or match in ~/.config/crowdnode/keys/.

crowdnode status ~/.config/crowdnode/keys/##MYCROWDNODEADDRESS##.wif

could not read '/home/ubuntu/.config/crowdnode/keys/##MYCROWDNODEADDRESS##.wif' in ./ or match in ~/.config/crowdnode/keys/.

Keys are present:

ls ~/.config/crowdnode/keys/
##MYCROWDNODEADDRESS##.wif

crowdnode status ##MYCROWDNODEADDRESS##
Checking CrowdNode API... (hotwallet ##CROWDNODEHOTWALLETADDRESS##)

API Actions Complete for ##MYCROWDNODEADDRESS##:
    ✅ SignUpForApi
    ✅ AcceptTerms
    ✅ DepositReceived

CrowdNode Stake: 50238197 (Đ0.50238197)

Seem like the app does not work when using the wif file as a parameter. The wif file only works with crowdnode stake. But after adding it as a default key it works better:

crowdnode list

Error: no default staking key selected.

Select a different address:
    crowdnode list
    crowdnode use <addr>

crowdnode use ##MYCROWDNODEADDRESS##
Enter passphrase: ***********************************

set /home/ubuntu/.config/crowdnode/default ##MYCROWDNODEADDRESS##
crowdnode list
Selected default staking key ##MYCROWDNODEADDRESS##

Staking keys: (in ~/.config/crowdnode/keys/)

##MYCROWDNODEADDRESS##

Or create a new staking key:
    crowdnode generate

I noticed the documentation mentioning --no-reserve but wasn't sure what it meant. Only after using the deposit command I figured it out. I suggest adding some text in the docs as to what this means:

crowdnode deposit [keyfile-or-addr] [dash-amount] [--no-reserve]

reserving 50000 (Đ0.00050000) for withdraws (--no-reserve to disable)

Next I tried to see what is the minimum I can stake, after I have staked my initial 0.5Đ, as this part was not mentioned in the docs. I still had some funds in my wallet so I tried 0.00000001 but started getting weird responses until I went up to 0.001 then it told me the correct amount I was missing in my wallet. I suggest adding a verification check or an alert and something in the docs to state what the minimim is. I'm not sure where the limitation is, at crowdnode or the app but this should avoid some user confusion.

crowdnode deposit  ##MYCROWDNODEADDRESS## 0.00000001
Checking CrowdNode API... (hotwallet ##CROWDNODEHOTWALLETADDRESS##)
reserving 50000 (Đ0.00050000) for withdraws (--no-reserve to disable)

dash://##MYCROWDNODEADDRESS##?amount=-0.00010013

Please deposit -10013 (Đ-0.00010013) to ##MYCROWDNODEADDRESS##

(waiting...)

crowdnode deposit  ##MYCROWDNODEADDRESS## 0.0001
Checking CrowdNode API... (hotwallet ##CROWDNODEHOTWALLETADDRESS##)
reserving 50000 (Đ0.00050000) for withdraws (--no-reserve to disable)

dash://##MYCROWDNODEADDRESS##?amount=-0.00000014

Please deposit -14 (Đ-0.00000014) to ##MYCROWDNODEADDRESS##

(waiting...)

crowdnode deposit  ##MYCROWDNODEADDRESS## 0.00010014
Checking CrowdNode API... (hotwallet ##CROWDNODEHOTWALLETADDRESS##)
reserving 50000 (Đ0.00050000) for withdraws (--no-reserve to disable)

dash://##MYCROWDNODEADDRESS##

Please send what you wish to deposit to ##MYCROWDNODEADDRESS##

(waiting...)

Balance is still too small: 70028 (Đ0.00070028)

crowdnode deposit  ##MYCROWDNODEADDRESS## 0.00020028
Checking CrowdNode API... (hotwallet ##CROWDNODEHOTWALLETADDRESS##)
reserving 50000 (Đ0.00050000) for withdraws (--no-reserve to disable)

dash://##MYCROWDNODEADDRESS##

Please send what you wish to deposit to ##MYCROWDNODEADDRESS##

crowdnode deposit  ##MYCROWDNODEADDRESS## 0.00070028
Checking CrowdNode API... (hotwallet ##CROWDNODEHOTWALLETADDRESS##)
reserving 50000 (Đ0.00050000) for withdraws (--no-reserve to disable)

dash://##MYCROWDNODEADDRESS##?amount=0.00050000

Please deposit 50000 (Đ0.00050000) to ##MYCROWDNODEADDRESS##

(waiting...)

crowdnode deposit  ##MYCROWDNODEADDRESS## 0.001
Checking CrowdNode API... (hotwallet ##CROWDNODEHOTWALLETADDRESS##)
reserving 50000 (Đ0.00050000) for withdraws (--no-reserve to disable)

dash://##MYCROWDNODEADDRESS##?amount=0.00079972

Please deposit 79972 (Đ0.00079972) to ##MYCROWDNODEADDRESS##

(waiting...)

Received 79972
Initiating deposit of 100000 (Đ0.00100000)...
Enter passphrase: ***********************************

Tested crowdnode load perfectly.

crowdnode load ##MYCROWDNODEADDRESS## 0.001

dash://##MYCROWDNODEADDRESS##?amount=0.00100000

Send Đ to your staking key via the QR above, or its address:
##MYCROWDNODEADDRESS##
(this key will be used to fund and control your CrowdNode account)

(waiting...)

Received 100000

crowdnode balance 
Selected default staking key ##MYCROWDNODEADDRESS##

Staking keys: (in ~/.config/crowdnode/keys/)

|                                    |   🔑 Holdings |   🪧  Stakings |   💸 Earnings |
| ---------------------------------: | ------------: | ------------: | ------------: |
| ##MYCROWDNODEADDRESS## | Đ  0.0016 | Đ  0.503 | Đ  0.00000809 |
|                                    |               |               |               |
|                             Totals | Đ  0.0016 | Đ  0.503 | Đ  0.00000809 |

crowdnode deposit 0.001
Selected default staking key ##MYCROWDNODEADDRESS##
Checking CrowdNode API... (hotwallet ##CROWDNODEHOTWALLETADDRESS##)
reserving 50000 (Đ0.00050000) for withdraws (--no-reserve to disable)
Initiating deposit of 100000 (Đ0.00100000)...
Enter passphrase: ***********************************
incorrect passphrase
Enter passphrase: ***********************************

    ✅ DepositReceived

crowdnode balance 
Selected default staking key ##MYCROWDNODEADDRESS##

Staking keys: (in ~/.config/crowdnode/keys/)

|                                    |   🔑 Holdings |   🪧  Stakings |   💸 Earnings |
| ---------------------------------: | ------------: | ------------: | ------------: |
| ##MYCROWDNODEADDRESS## | Đ  0.00089 | Đ  0.5039 | Đ  0.00000809 |
|                                    |               |               |               |
|                             Totals | Đ  0.00089 | Đ  0.5039 | Đ  0.00000809 |

NOTE: I suggest to add an indicator between the point of entering your password and the ✅ DepositReceived notfication. For me it took several seconds and I wasn't sure if something went wrong but waited some more and it worked. Maybe just dots to indicate action is still taking place or a spinner?

Lol, Dash is awesomely weird. Both my deposit tx's to my intermediary wallet, and the crowdnode deposits all were instantly confirmed by InstantSend several minutes before they even appeared on the blockexplorer. Dash + Crowdnode FTW

Cudos for asking for the password over and over, I kept fumbling this one:

crowdnode passphrase
Enter (current) passphrase: ***********************************
incorrect passphrase
Enter (current) passphrase: ***********
incorrect passphrase
Enter (current) passphrase: ***********
incorrect passphrase
Enter (current) passphrase: ***********************************
incorrect passphrase
Enter (current) passphrase: ***********************************

Enter (new) passphrase: ***********
Enter passphrase again: ***********

Backing up previous (encrypted) keys:
  ~/.config/crowdnode/keys.2023-03-17_14.24.58.bak

Encrypting...

🔑 ##MYCROWDNODEADDRESS##

Done 🔐

Tested decrypting and encrypting keys perfectly:

crowdnode decrypt 
Enter passphrase: ***********

Decrypting...

🔓 ##MYCROWDNODEADDRESS##

Done ✅

crowdnode encrypt
Enter (new) passphrase: ***********
Enter passphrase again: ***********
Encrypting...

🔑 ##MYCROWDNODEADDRESS##

Done 🔐
crowdnode delete ##MYCROWDNODEADDRESS##
Checking CrowdNode API... (hotwallet ##CROWDNODEHOTWALLETADDRESS##)

Error: ##MYCROWDNODEADDRESS##
    still has a balance of 89 (Đ0.00089)
    (transfer to another address before deleting)

Summary: The app functioned mostly as expected. With the keys imported and set as default it was very easy to use. The only other real issues were the minimum amount that you can send after the initial setup of the account with 0.5Đ and minor documentation tweaks.

Nice work!

riongull commented 1 year ago

Great review @BFWookie!

@coolaj86 and/or @jojobyte, can you please take a look at this and see what should be addressed?