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 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 ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ENS ¶
type ENS struct { *contract.ENSSession // contains filtered or unexported fields }
swarm domain name registry and resolver
func DeployENS ¶
func DeployENS(transactOpts *bind.TransactOpts, contractBackend bind.ContractBackend) (*ENS, error)
DeployENS deploys an instance of the ENS nameservice, with a 'first in first served' root registrar.
func NewENS ¶
func NewENS(transactOpts *bind.TransactOpts, contractAddr common.Address, contractBackend bind.ContractBackend) (*ENS, error)
NewENS creates a struct exposing convenient high-level operations for interacting with the Ethereum Name Service.
func (*ENS) Register ¶
func (self *ENS) Register(name string) (*types.Transaction, error)
Register registers a new domain name for the caller, making them the owner of the new name. Only works if the registrar for the parent domain implements the FIFS registrar protocol.
func (*ENS) Resolve ¶
Resolve is a non-transactional call that returns the content hash associated with a name.
func (*ENS) SetContentHash ¶
SetContentHash sets the content hash associated with a name. Only works if the caller owns the name, and the associated resolver implements a `setContent` function.