resolver

package
v0.9.26 Latest Latest
Warning

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

Go to latest
Published: May 28, 2015 License: LGPL-2.1-or-later Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContractCodeURLhint = "" /* 412-byte string literal not displayed */

	ContractCodeHashReg = "" /* 330-byte string literal not displayed */

)

Variables

View Source
var UrlHintContractAddress, HashRegContractAddress string

// contract addresses will be hardcoded after they're created

Functions

This section is empty.

Types

type Backend

type Backend interface {
	StorageAt(string, string) string
	Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceStr, codeStr string) (string, error)
}

type Resolver

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

func New

func New(eth Backend) *Resolver

func (*Resolver) ContentHashToUrl

func (self *Resolver) ContentHashToUrl(chash common.Hash) (uri string, err error)

retrieves the url-hint for the content hash - if we use content addressed storage, this step is no longer necessary

func (*Resolver) CreateContracts

func (self *Resolver) CreateContracts(addr common.Address) (err error)

for testing and play temporarily ideally the HashReg and UrlHint contracts should be in the genesis block if we got build-in support for natspec/contract info there should be only one of these officially endorsed addresses as constants TODO: could get around this with namereg, check

func (*Resolver) KeyToContentHash

func (self *Resolver) KeyToContentHash(khash common.Hash) (chash common.Hash, err error)

resolution is costless non-transactional implemented as direct retrieval from db

func (*Resolver) KeyToUrl

func (self *Resolver) KeyToUrl(key common.Hash) (uri string, hash common.Hash, err error)

func (*Resolver) Register

func (self *Resolver) Register(address common.Address, codehash, dochash common.Hash, url string) (txh string, err error)

func (*Resolver) RegisterContentHash

func (self *Resolver) RegisterContentHash(address common.Address, codehash, dochash common.Hash) (txh string, err error)

registers some content hash to a key/code hash e.g., the contract Info combined Json Doc's ContentHash to CodeHash of a contract or hash of a domain kept

func (*Resolver) RegisterUrl

func (self *Resolver) RegisterUrl(address common.Address, hash common.Hash, url string) (txh string, err error)

registers a url to a content hash so that the content can be fetched address is used as sender for the transaction and will be the owner of a new registry entry on first time use FIXME: silently doing nothing if sender is not the owner note that with content addressed storage, this step is no longer necessary it could be purely

func (*Resolver) SetOwner

func (self *Resolver) SetOwner(address common.Address) (txh string, err error)

called as first step in the registration process on HashReg

Jump to

Keyboard shortcuts

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