vns

package
v0.6.3-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: GPL-3.0 Imports: 6 Imported by: 6

README

Swarm VNS interface

Usage

Full documentation for the VNT Name Service. This package offers a simple binding that streamlines the registration of arbitrary UTF8 domain names to swarm content hashes.

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func VnsNode

func VnsNode(name string) string

Types

type VNS

type VNS struct {
	*contract.VNSSession
	// contains filtered or unexported fields
}

swarm domain name registry and resolver

func DeployVNS

func DeployVNS(transactOpts *bind.TransactOpts, contractBackend bind.ContractBackend) (common.Address, *VNS, error)

DeployVNS deploys an instance of the VNS nameservice, with a 'first-in, first-served' root registrar.

func NewVNS

func NewVNS(transactOpts *bind.TransactOpts, contractAddr common.Address, contractBackend bind.ContractBackend) (*VNS, error)

NewVNS creates a struct exposing convenient high-level operations for interacting with the VNT Name Service.

func (*VNS) Addr

func (self *VNS) Addr(name string) (common.Address, error)

Addr is a non-transactional call that returns the address associated with a name.

func (*VNS) Register

func (self *VNS) 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 (*VNS) Resolve

func (self *VNS) Resolve(name string) (string, error)

Resolve is a non-transactional call that returns the content hash associated with a name.

func (*VNS) SetAddr

func (self *VNS) SetAddr(name string, addr common.Address) (*types.Transaction, error)

SetAddress sets the address associated with a name. Only works if the caller owns the name, and the associated resolver implements a `setAddress` function.

func (*VNS) SetContentHash

func (self *VNS) SetContentHash(name string, hash string) (*types.Transaction, error)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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