ens

package module
v0.0.0-...-dc0a45d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2017 License: MIT Imports: 23 Imported by: 0

README

ens-lite

Resolve ENS names into DNS records or Ethereum addresses without downloading full Ethereum blockchain. The resolver syncs the blockchain headers and verifies names against the state tree.

Examples (make sure go-ethereum is installed first):

cd $GOPATH/src/github.com/cpacia/ens-lite/cmd/ens-lite
go install
ens-lite start

ens-lite resolve somename.eth
ens-lite lookup somename.eth
ens-lite address somename.eth

Or:

curl http://localhost:31313/resolver/dns/somename.eth
curl http://localhost:31313/resolver/dns/somename.eth?lookup=true
curl http://localhost:31313/resolver/address/somename.eth

Or as a library:

client, _ = ens.NewENSLiteClient("/path/to/datadir")
go client.start()
client.ResolveDNS("somename.eth")
client.ResolveAddress("somename.eth")

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorBlockchainSyncing error = errors.New("Cannot resolve names while the chain is syncing")
View Source
var ErrorNoRecords error = errors.New("No DNS records found")
View Source
var ErrorNodeInitializing error = errors.New("Node is still initializing")

Functions

This section is empty.

Types

type ENSLiteClient

type ENSLiteClient struct {
	// contains filtered or unexported fields
}

func NewENSLiteClient

func NewENSLiteClient(dataDir string) (*ENSLiteClient, error)

func (*ENSLiteClient) ResolveAddress

func (self *ENSLiteClient) ResolveAddress(name string) (addr common.Hash, err error)

func (*ENSLiteClient) ResolveDNS

func (self *ENSLiteClient) ResolveDNS(name string) ([]dns.RR, error)

Resolve a name. The merkle proofs will be validated automatically.

func (*ENSLiteClient) Start

func (self *ENSLiteClient) Start()

Start the SPV node

func (*ENSLiteClient) Stop

func (self *ENSLiteClient) Stop()

Stop the SPV node

func (*ENSLiteClient) SyncProgress

func (self *ENSLiteClient) SyncProgress() (*ethereum.SyncProgress, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL