Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hhatto/rust-ens
Rust ENS(Ethereum Name Service) interface
https://github.com/hhatto/rust-ens
ens ethereum rust
Last synced: 2 months ago
JSON representation
Rust ENS(Ethereum Name Service) interface
- Host: GitHub
- URL: https://github.com/hhatto/rust-ens
- Owner: hhatto
- Created: 2018-08-05T04:55:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-17T15:28:59.000Z (about 6 years ago)
- Last Synced: 2024-09-14T04:12:05.626Z (3 months ago)
- Topics: ens, ethereum, rust
- Language: Rust
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rust-ens [![](https://travis-ci.org/hhatto/rust-ens.svg?branch=master)](https://travis-ci.org/hhatto/rust-ens) [![Latest Version](https://img.shields.io/crates/v/ens.svg)](https://crates.io/crates/ens)
Rust ENS(Ethereum Name Service) interface, based on [rust-web3](https://github.com/tomusdrw/rust-web3).
## Usage
Cargo.toml
```toml
[dependencies]
ens = "0.1"
``````rust
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
```