Crates.io | ens |
lib.rs | ens |
version | 0.1.0 |
source | src |
created_at | 2018-08-07 13:56:09.837964 |
updated_at | 2018-08-07 13:56:09.837964 |
description | Access the Ethereum Name Service |
homepage | https://github.com/hhatto/rust-ens |
repository | https://github.com/hhatto/rust-ens |
max_upload_size | |
id | 78209 |
size | 33,990 |
Rust ENS interface, based on rust-web3.
Cargo.toml
[dependencies]
ens = "0.1"
extern crate ens;
extern crate web3;
use ens::ENS;
fn main() {
let (_evloop, transport) = web3::transports::Http::new(
"http://localhost:8545",
).unwrap();
let ens_name = "hexacosa.eth";
let ens = ENS::new(web3::Web3::new(transport));
match ens.address(ens_name) {
Ok(addr) => println!("{:?}", addr),
Err(_) => println!("unknown"),
};
}
use ENS Contract from https://github.com/ensdomains/ens/tree/master/contracts .
$ solc --bin --abi --optimize contract/PublicResolver.sol -o contract
$ ls contract
ENS.abi ENS.bin ENS.sol PublicResolver.abi PublicResolver.bin PublicResolver.sol