ens

package
v0.0.0-...-b78b3a4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

README

Swarm ENS interface

Usage

Full documentation for the Ethereum Name Service can be found as EIP 137. This package offers a simple binding that streamlines the registration of arbitrary UTF8 domain names to swarm content hashes.

Development

The SOL file in contract subdirectory implements the ENS root registry, a simple first-in, first-served registrar for the root namespace, and a simple resolver contract; they're used in tests, and can be used to deploy these contracts for your own purposes.

The solidity source code can be found at github.com/arachnid/ens/.

The go bindings for ENS contracts are generated using abigen via the go generator:

go generate ./contracts/ens

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MainNetAddress = common.HexToAddress("0x314159265dD8dbb310642f98f50C066173C1259b")
	TestNetAddress = common.HexToAddress("0x112234455c3a32fd11230c42e7bccd4a84e02010")
)

Functions

func EnsNode

func EnsNode(name string) common.Hash

Types

type ENS

type ENS struct {
	*contract.ENSSession
	// contains filtered or unexported fields
}

func DeployENS

func DeployENS(transactOpts *bind.TransactOpts, contractBackend bind.ContractBackend) (common.Address, *ENS, error)

Deployeens部署ENS名称服务的一个实例,具有“先进先服务”的根注册器。

func NewENS

func NewENS(transactOpts *bind.TransactOpts, contractAddr common.Address, contractBackend bind.ContractBackend) (*ENS, error)

newens创建了一个结构,它公开了方便的高级操作,以便与 以太坊名称服务。

func (*ENS) Register

func (self *ENS) Register(name string) (*types.Transaction, error)

注册为调用者注册一个新域名,使其成为新名称的所有者。 仅当父域的注册器实现FIFS注册器协议时才有效。

func (*ENS) Resolve

func (self *ENS) Resolve(name string) (common.Hash, error)

解析是一个非事务性调用,返回与名称关联的内容哈希。

func (*ENS) SetContentHash

func (self *ENS) SetContentHash(name string, hash common.Hash) (*types.Transaction, error)

setContentHash设置与名称关联的内容哈希。只有当呼叫方 拥有名称,关联的冲突解决程序实现了一个“setcontent”函数。

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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