helium / miner

Miner for the helium blockchain
Apache License 2.0
609 stars 266 forks source link

Wallet and Validator documentation #735

Closed NetScr1be closed 3 years ago

NetScr1be commented 3 years ago

Searching for documentation on the details of (sub)commands for the wallet and miner/validator like the ones below returns nothing that I have found

I'm working through them one-by-one and documenting them but would like to know if:

a) I'm wasting my time/duplicating something already done.

b) should i push the docs here when I am done?

Built both the wallet and miner from source.

This is the Github if anyone is interested.

https://github.com/NetScr1be/helium.validator

It's private for now. Ping me for access.

NetScr1be commented 3 years ago

Examples of what is being documented:

~/he.validator/miner/_build/validator/rel/miner/bin/miner -h
Usage: miner {start|start_boot <file>|foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|uninstall|versions|escript|rpc|rpcterms|eval|status|genesis|hbbft|peer|snapshot|ledger|info|trace|txn|dkg|authorize|repair|print_keys}
~/he.validator/miner/_build/validator/rel/miner/bin/miner ping
pong

./helium-wallet balance

Address Balance Data Credits Security Tokens
1a7Zmyy9oi9JuG2WimRrSHf6yxBzxf9tT7oSiSau25FYEheLBCr 30.28643166 0 0.00000000
NetScr1be commented 3 years ago

Maybe this should be its own issue.

The output from the command uses '+' symbols for column and corner markers.

If they were changed to pipe symbols ('|') it would paste directly into markdown files.

I'm manually editing them via stackedit.io for readability.

Vagabond commented 3 years ago

Maybe this should be its own issue.

The output from the command uses '+' symbols for column and corner markers.

If they were changed to pipe symbols ('|') it would paste directly into markdown files.

I'm manually editing them via stackedit.io for readability.

These come from clique, specifically here: https://github.com/basho/clique/blob/develop/src/clique_table.erl#L268

Clique supports different output formats, including json and CSV, presumably markdown could also be added or the table characters could be made configurable.

Vagabond commented 3 years ago

Each cli command has online documentation attached, for example:

https://github.com/helium/miner/blob/master/src/cli/miner_cli_info.erl#L58 for the command and https://github.com/helium/miner/blob/master/src/cli/miner_cli_info.erl#L87 for each sub command

You can always see the documentation by passing -h or not supplying a sub command

Vagabond commented 3 years ago

Some cli commands are implemented in src/cli in helium/blockchain-core as well.

NetScr1be commented 3 years ago

Each cli command has online documentation attached, for example:

https://github.com/helium/miner/blob/master/src/cli/miner_cli_info.erl#L58 for the command and https://github.com/helium/miner/blob/master/src/cli/miner_cli_info.erl#L87 for each sub command

You can always see the documentation by passing -h or not supplying a sub command

Thanks I am using this to do the following:

NetScr1be commented 3 years ago

I'm guessing this is because the miner was built from source rather than a authorized manufacturer?

./miner info onboarding

Error: No onboarding info found for this miner's onboarding key.

Vagabond commented 3 years ago

I'm guessing this is because the miner was built from source rather than a authorized manufacturer?

./miner info onboarding

Error: No onboarding info found for this miner's onboarding key.

Yes.

If you want to generate offline documentation from the online documentation you may be able to interrogate clique programatically and generate output that way. Then you could improve the online documentation AND the offline documentation simultaneously.

NetScr1be commented 3 years ago

Somebody would have to show me how to do that.

For the moment, I'm reading the code and pulling out what is needed manually.

NetScr1be commented 3 years ago

interrogate clique programatically

NetScr1be commented 3 years ago

Then you could improve the online documentation AND the offline documentation simultaneously.

Would love to do this. It's the best way for me to learn.

vihu commented 3 years ago

interrogate clique programatically

* Don't know what clique is. Reference please?

clique is a CLI framework we use to support CLI commands for miner (and pretty much any other Erlang project). You can find examples in miner and blockchain-core under src/cli/some_cli.erl. Essentially the way it works is that you register a CLI handler and respond according to the clique specification.

evanmcc commented 3 years ago

closing due to inactivity.