diff --git a/docs/cli.md b/docs/cli.md index 458d923..766fdf0 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -21,7 +21,7 @@ Environment variables allow you to redefine the default settings: ## HOWTO -### How to run <> endpoint +### How to run [JSON-RPC](http://github.com/ethereumproject/emerald-rs/blob/master/docs/api.adoc) endpoint ``` emerald server --host=127.0.0.1 --port=1920 @@ -96,6 +96,17 @@ or single keyfile for selected
: emerald export --chain=testnet
``` +### How to get balance for address +If using client that running on a local host (127.0.0.1:8545): +``` +emerald balance 0x0e7c045110b8dbf29765047380898919c5cb56f4 +``` +or connecting to some specific host & port: +``` +emerald balance 0x0e7c045110b8dbf29765047380898919c5cb56f4 --upstream=8.8.8.8:8545 +``` + + ### How to sign transaction offline: diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index a583842..133643b 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -169,15 +169,9 @@ impl CmdExecutor { fn list(&self) -> ExecResult { let accounts_info = self.storage.list_accounts(self.args.flag_show_hidden)?; - println!("Total: {}", accounts_info.len()); - + println!("{0: <45} {1: <45} ", "ADDRESS", "NAME"); for info in accounts_info { - println!( - "Account: {}, name: {}, description: {}", - &info.address, - &info.name, - &info.description - ); + println!("{0: <45} {1: <45} ", &info.address, &info.name); } Ok(()) diff --git a/src/main.rs b/src/main.rs index 3aa3900..0c7ba77 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,12 @@ use std::env; use std::process::*; const USAGE: &'static str = include_str!("../usage.txt"); +const VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION"); +/// Get the current Emerald version. +pub fn version() -> &'static str { + VERSION.unwrap_or("unknown") +} fn main() { env::set_var("RUST_BACKTRACE", "1"); @@ -65,7 +70,7 @@ fn main() { log_builder.init().expect("Expect to initialize logger"); if args.flag_version { - println!("v{}", emerald::version()); + println!("v{}", version()); exit(0); } diff --git a/usage.txt b/usage.txt index 8d90238..2be9eea 100644 --- a/usage.txt +++ b/usage.txt @@ -1,7 +1,7 @@ Emerald offline wallet command line interface. Usage: - emerald server [--port=] [--host=] [--base-path=] + emerald server [--port=] [--host=] [--base-path=] [-v | --verbose] [-q | --quite] emerald new --chain= ([[--security-level=] [--name=] [--description=]] | --raw ) emerald list --chain= [--show-hidden] emerald hide --chain=