registry

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: Apache-2.0, BSD-2-Clause Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// CfgBindAddress defines the config flag of the web API binding address.
	CfgRewardAddress = "reward.address"
)

Variables

This section is empty.

Functions

func CommitDKShare

func CommitDKShare(ks *tcrypto.DKShare, pubKeys []kyber.Point) error

func GetDKShare

func GetDKShare(addr *address.Address) (*tcrypto.DKShare, bool, error)

func GetProgramCode

func GetProgramCode(progHash *hashing.HashValue) ([]byte, bool, error)

TODO save program code in the smart contract state

func GetRewardAddress

func GetRewardAddress(scaddr *address.Address) address.Address

func InitFlags

func InitFlags()

func InitLogger

func InitLogger()

func LoadDKShare

func LoadDKShare(addr *address.Address, maskPrivate bool) (*tcrypto.DKShare, error)

func SaveBootupData

func SaveBootupData(bd *BootupData) error

func SaveDKShareToRegistry

func SaveDKShareToRegistry(ks *tcrypto.DKShare) error

func SaveProgramCode

func SaveProgramCode(programCode []byte) (ret hashing.HashValue, err error)

func SaveProgramMetadata

func SaveProgramMetadata(md *ProgramMetadata) error

Types

type BootupData

type BootupData struct {
	Address        address.Address
	OwnerAddress   address.Address // only needed for committee nodes, can be nil for access nodes
	Color          balance.Color   // origin tx hash
	CommitteeNodes []string        // "host_addr:port"
	AccessNodes    []string        // "host_addr:port"
	Active         bool
}

BootupData is a minimum data needed to load a committee for the smart contract it is up to the node (not smart contract) to check authorisations to create/update this record

func ActivateBootupData

func ActivateBootupData(addr *address.Address) (*BootupData, error)

func DeactivateBootupData

func DeactivateBootupData(addr *address.Address) (*BootupData, error)

func GetBootupData

func GetBootupData(addr *address.Address) (*BootupData, error)

func GetBootupRecords

func GetBootupRecords() ([]*BootupData, error)

func UpdateBootupData

func UpdateBootupData(addr *address.Address, f func(*BootupData) bool) (*BootupData, error)

func (*BootupData) Read

func (bd *BootupData) Read(r io.Reader) error

func (*BootupData) String

func (bd *BootupData) String() string

func (*BootupData) Write

func (bd *BootupData) Write(w io.Writer) error

type ProgramMetadata

type ProgramMetadata struct {
	// program hash. Persist in key
	ProgramHash hashing.HashValue
	// it is interpreted by the loader to locate and cache program's code
	Location string
	// VM type. It is used to distinguish between several types of VMs
	VMType string
	// description any text
	Description string
}

func GetProgramMetadata

func GetProgramMetadata(progHash *hashing.HashValue) (*ProgramMetadata, bool, error)

func (*ProgramMetadata) Read

func (md *ProgramMetadata) Read(r io.Reader) error

func (*ProgramMetadata) Write

func (md *ProgramMetadata) Write(w io.Writer) error

Jump to

Keyboard shortcuts

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