diff --git a/README.md b/README.md index 0f97ffbfc17acfd1e540c4dd431b368a2ae0b1dd..486a4654fe8988bb270f6ab729b443df8dc053cf 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ List certifications and session keys that will expire within one month: cargo run -- --url wss://gdev.p2p.legal:443/ws expire --blocks 432000 +For more examples see [in the example file](./doc/example.md). + #### Log level You can adjust the log level: diff --git a/doc/example.md b/doc/example.md new file mode 100644 index 0000000000000000000000000000000000000000..5d9b7167c4214500b0466b58370518c2b00b0d37 --- /dev/null +++ b/doc/example.md @@ -0,0 +1,44 @@ +# Examples of gcli commands for copy-paste + +Useful when developing: replace `gcli` by `cargo run --` to build in debug mode and launch gcli. + +## Mnemonics + +Used in duniter-indexer genesis config: +`pipe paddle ketchup filter life ice feel embody glide quantum ride usage` + +with derivations: + +- `//2` → `test1` +- `//4` → `test2` +- `//6` → `test3` + +Used in substrate for Alice, Bob and Co: +`bottom drive obey lake curtain smoke basket hold race lonely fit walk` + +with derivations: + +- `//Alice` +- `//Bob` +- `//Charlie` +- ... + +## Commands + +```sh +# get balance of test1 account +gcli --address 5FeggKqw2AbnGZF9Y9WPM2QTgzENS3Hit94Ewgmzdg5a3LNa get-balance +# get information about test1 identity (needs indexer) +gcli identity --username test1 +# show address of given secret +gcli --secret "pipe paddle ketchup filter life ice feel embody glide quantum ride usage"//2 show-address +``` + +## Indexer commands + +These commands uniquely relate with indexer + +```sh +# show latest indexer indexed block +gcli indexer latest-block +``` \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index e4697349a6a7bc9527cac075fa2090769dda02ce..fbdf1e8db486a65c0b2bea82207bf8e94a903675 100644 --- a/src/main.rs +++ b/src/main.rs @@ -266,7 +266,7 @@ async fn main() -> Result<(), GcliError> { match args.subcommand { Subcommand::GetBalance => { data = data - .build_keypair() + .build_address() .build_client() .await .fetch_system_properties()