Documentation
¶
Overview ¶
Package viewchange implements a native smart contract to update the roster of a chain.
Documentation Last Review: 08.10.2020
Index ¶
Constants ¶
const ( // ContractUID is the unique (4-bytes) identifier of the contract, it is // used to prefix keys in the K/V store and by DARCs for access control. ContractUID = "COSI" // ContractName is the name of the contract. ContractName = "go.dedis.ch/dela.ViewChange" // AuthorityArg is the key of the argument for the new authority. AuthorityArg = "viewchange:authority" )
Variables ¶
This section is empty.
Functions ¶
func GetRosterKey ¶
func GetRosterKey() []byte
GetRosterKey returns the key used to store the roster in the K/V storage. It is formatted like ContractUID + roster key.
func NewCreds ¶
func NewCreds() access.Credential
NewCreds creates new credentials for a view change contract execution.
func RegisterContract ¶
RegisterContract registers the view change contract to the given execution service.
Types ¶
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
Contract is a contract to update the roster at a given key in the storage. It only allows one member change per transaction.
- implements native.Contract
func NewContract ¶
NewContract creates a new viewchange contract.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is an extension of a normal transaction manager to help creating view change ones.
func NewManager ¶
NewManager returns a view change manager from the transaction manager.