Rust ENS(Ethereum Name Service) interface
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
contract
examples
src
.gitignore
.travis.yml
Cargo.toml
README.md

README.md

rust-ens Latest Version

Rust ENS(Ethereum Name Service) interface, based on rust-web3.

Usage

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"),
    };
}

for Developer

Contract

use ENS Contract from https://github.com/ensdomains/ens/tree/master/contracts .

  • ENS.sol
  • PublicResolver.sol
$ solc --bin --abi --optimize contract/ENS.sol -o contract
$ solc --bin --abi --optimize contract/PublicResolver.sol -o contract
$ ls contract
ENS.abi             ENS.bin             ENS.sol             PublicResolver.abi  PublicResolver.bin  PublicResolver.sol