I am trying to use this crate to generate an ethereum address: https://docs.rs/ethkey/0.2.5/ethkey/
use ethkey::prelude::*;
fn main() {
let key = EthAccount::load_or_generate("~/", "passwd")
.expect("should load or generate new eth key");
println!("{:?}", key.address())
}
This is the example from the documentation and it doesnt seem to work. I get the error below:
cargo run Compiling ethkey v0.1.0 (/Users/samueldare/Documents/Code/Thor/ethkey) Finished dev [unoptimized + debuginfo] target(s) in 1.34s Running
target/debug/ethkey
thread 'main' panicked at 'should load or generate new eth key: Error(IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })', src/libcore/result.rs:999:5 note: run withRUST_BACKTRACE=1
environment variable to display a backtrace.
Ive use ~/
as a last attempt to generate the key file in rust, but it still doesnt seem to work.
I will appreciate any pointers with this