signum-network / signum-node

Signum Node
https://signum.network
GNU General Public License v3.0
194 stars 77 forks source link

CLI tool is missing #526

Open PSLLSP opened 3 years ago

PSLLSP commented 3 years ago

This projects needs CLI tool. GUI wallet is cool but serious work needs CLI tool to run scripts to create reports, backup, restore, send transactions, check balance, check network/node status, check transactions, etc. Headless node requires CLI tool.

Most other cryptocoins have CLI tool, including BTC and all clones, even CHIA have CLI...

jjos2372 commented 3 years ago

hello, yes that is desirable. Some information that would help to build it or to work on as headless environment as is now:

PSLLSP commented 3 years ago

This should be new issue but I put it here. javadoc links in API documentation doesn't work, an example https://europe.signum.network/doc/brs/http/SubmitNonce.html returns error 404. I have found it when I created other issue and I wanted to add a link to API documentation that describes parameters for API call... The javadoc link can be found at https://europe.signum.network/api-doc?requestType=submitNonce

ohager commented 1 year ago

@PSLLSP have you checked the new API Docs? We moved to Open API Spec and having improved the docs significantly. The idea of a CLI tool is totally legit...but it's not on our prio list. There are several ways to have a CLI tool, i.e. using signumj (Java SDK) or SignumJS (Javascript SDK) - the latter could be provided using npm, i.e. very easy to install, while a Java version could be delivered as standalone executable.

PSLLSP commented 1 year ago

I tried several experiments with API, a year ago. I understand I have to write my own set of tools, I am not going to do that. I asked for CLI to troubleshoot my headless client.

I have a fresh example. There was a power outage yesterday in my lab. My Signum node (v3.5.0) cannot synchronize after that accident. It reports to the console these messages again and again and I just do not know how to check if problem is at those two nodes or I am the troublemaker because I am connected to a wrong chain... I have to start some GUI wallet or I have to start to use API calls, easier is just start GUI wallet, it is easier then learn how to use API. Other way is to assume that my DB was corrupted, delete it and start synchronization process from block 0...

[INFO] 2022-10-06 19:56:54 brs.peer.PeerImpl - Blacklisting 188.34.159.176 (v3.5.0) because of: feeding us a too old fork
[INFO] 2022-10-06 19:57:33 brs.peer.PeerImpl - Blacklisting 77.68.79.251 (v3.5.0) because of: feeding us a too old fork
[INFO] 2022-10-06 20:06:54 brs.peer.PeerImpl - Blacklisting 188.34.159.176 (v3.5.0) because of: feeding us a too old fork
[INFO] 2022-10-06 20:07:34 brs.peer.PeerImpl - Blacklisting 77.68.79.251 (v3.5.0) because of: feeding us a too old fork
ohager commented 1 year ago

https://github.com/signum-network/signum-node-health-check this is a small tool to check your nodes health. In case of error you can execute bash scripts. Combined with a cron-job you can run your own monitor.

PSLLSP commented 1 year ago

Last time I really deleted local copy of blockchain and started sync from block 0. The issue was fixed.

I did controlled shutdown today (CTRL+C send to the Signum node), and I started it again in 15 minutes. I see that I am out of sync again:

[INFO] 2022-10-21 18:41:17 brs.peer.PeerImpl - Blacklisting 77.68.79.251 (v3.5.0) because of: feeding us a too old fork
[INFO] 2022-10-21 18:41:35 brs.peer.PeerImpl - Blacklisting 188.34.159.176 (v3.5.0) because of: feeding us a too old fork
[INFO] 2022-10-21 18:51:18 brs.peer.PeerImpl - Blacklisting 77.68.79.251 (v3.5.0) because of: feeding us a too old fork
[INFO] 2022-10-21 18:51:35 brs.peer.PeerImpl - Blacklisting 188.34.159.176 (v3.5.0) because of: feeding us a too old fork

When I try healthcheck tool, I see this:

$ signumhealth -n http://localhost:8125
2022-10-21T16:57:31.382Z
http://localhost:8125 - height: 1071428
https://europe.signum.network - height: 1071615
Node [http://localhost:8125] is 187 block(s) behind of Node [https://europe.signum.network] - syncing...
Signature Check:
http://localhost:8125 - signature (height: 1071428): 87feff6fe0c0086cfbe92a527aa9d0b9e12f2e3cf2b74005fc51a07a646a5908bbbf47f688bf77617b6fdb8e5cbe39ef97933dcc0f769f0dad03b1f4507eb908
https://europe.signum.network - signature (height: 1071428): 7a4781a8bf7fa83161eba1406b85d1ed2faa97048aa43183f63bfb92c798930fd65665fe4b2b28711b64e1bab72e0bd48a788de5074f239bff40e5131322d118
❌ 2022-10-21T16:57:31.431Z Health Check failed Node [http://localhost:8125] is forked from [https://europe.signum.network] - Try popping off to get in sync again
$ signumhealth -n http://localhost:8125
2022-10-21T19:12:00.765Z
http://localhost:8125 - height: 1071428
https://europe.signum.network - height: 1071646
Node [http://localhost:8125] is 218 block(s) behind of Node [https://europe.signum.network] - syncing...
Signature Check:
http://localhost:8125 - signature (height: 1071428): 87feff6fe0c0086cfbe92a527aa9d0b9e12f2e3cf2b74005fc51a07a646a5908bbbf47f688bf77617b6fdb8e5cbe39ef97933dcc0f769f0dad03b1f4507eb908
https://europe.signum.network - signature (height: 1071428): 7a4781a8bf7fa83161eba1406b85d1ed2faa97048aa43183f63bfb92c798930fd65665fe4b2b28711b64e1bab72e0bd48a788de5074f239bff40e5131322d118
❌ 2022-10-21T19:12:00.816Z Health Check failed Node [http://localhost:8125] is forked from [https://europe.signum.network] - Try popping off to get in sync again

It seems that sync process doesn't work. Any idea why I am at wrong fork of the blockchain? Restart of Signum node doesn't solve this issue... I am going to delete the current blockchain and sync from block 0.

ohager commented 1 year ago

That's unfortunate.... so you have two options: Doing a PopOff of at maximum 1440 blocks and if this does not work you need to resync from zero.