spec

package
v0.29.8-rc5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 18 Imported by: 12

Documentation

Index

Constants

View Source
const DefaultAmount uint64 = 1000000
View Source
const DefaultPower uint64 = 10000

Variables

View Source
var (
	ErrInvalidLengthSpec        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSpec          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSpec = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type GenesisSpec

type GenesisSpec struct {
	GenesisTime       *time.Time        `json:",omitempty" toml:",omitempty"`
	ChainName         string            `json:",omitempty" toml:",omitempty"`
	Params            params            `json:",omitempty" toml:",omitempty"`
	Salt              []byte            `json:",omitempty" toml:",omitempty"`
	GlobalPermissions []string          `json:",omitempty" toml:",omitempty"`
	Accounts          []TemplateAccount `json:",omitempty" toml:",omitempty"`
}

A GenesisSpec is schematic representation of a genesis state, that is it is a template for a GenesisDoc excluding that which needs to be instantiated at the point of genesis so it describes the type and number of accounts, the genesis salt, but not the account keys or addresses, or the GenesisTime. It is responsible for generating keys by interacting with the KeysClient it is passed and other information not known at specification time

func DeveloperAccount

func DeveloperAccount(name string) GenesisSpec

func FullAccount

func FullAccount(name string) GenesisSpec

func GenesisSpecFromJSON

func GenesisSpecFromJSON(jsonBlob []byte) (*GenesisSpec, error)

func MergeGenesisSpecs

func MergeGenesisSpecs(genesisSpecs ...GenesisSpec) GenesisSpec

func ParticipantAccount

func ParticipantAccount(name string) GenesisSpec

func RootAccount

func RootAccount(name string) GenesisSpec

func ValidatorAccount

func ValidatorAccount(name string) GenesisSpec

func (*GenesisSpec) GenesisDoc

func (gs *GenesisSpec) GenesisDoc(keyClient keys.KeyClient, curve crypto.CurveType) (*genesis.GenesisDoc, error)

Produce a fully realised GenesisDoc from a template GenesisDoc that may omit values

func (*GenesisSpec) Hash

func (gs *GenesisSpec) Hash() []byte

func (*GenesisSpec) JSONBytes

func (gs *GenesisSpec) JSONBytes() ([]byte, error)

func (*GenesisSpec) ShortHash

func (gs *GenesisSpec) ShortHash() []byte

type TemplateAccount

type TemplateAccount struct {
	Name             string                                        `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	Address          *github_com_hyperledger_burrow_crypto.Address `` /* 134-byte string literal not displayed */
	PublicKey        *crypto.PublicKey                             `protobuf:"bytes,3,opt,name=PublicKey,proto3" json:",omitempty" toml:",omitempty"`
	Amounts          []balance.Balance                             `protobuf:"bytes,4,rep,name=Amounts,proto3" json:",omitempty" toml:",omitempty"`
	Permissions      []string                                      `protobuf:"bytes,5,rep,name=Permissions,proto3" json:",omitempty" toml:",omitempty"`
	Roles            []string                                      `protobuf:"bytes,6,rep,name=Roles,proto3" json:",omitempty" toml:",omitempty"`
	Code             *github_com_hyperledger_burrow_acm.Bytecode   `protobuf:"bytes,7,opt,name=Code,proto3,customtype=github.com/hyperledger/burrow/acm.Bytecode" json:"Code,omitempty"`
	XXX_unrecognized []byte                                        `json:"-"`
}

func (TemplateAccount) AccountPermissions

func (ta TemplateAccount) AccountPermissions() (permission.AccountPermissions, error)

func (TemplateAccount) Balances added in v0.20.0

func (ta TemplateAccount) Balances() balance.Balances

func (*TemplateAccount) Descriptor added in v0.20.0

func (*TemplateAccount) Descriptor() ([]byte, []int)

func (TemplateAccount) GenesisAccount added in v0.20.0

func (ta TemplateAccount) GenesisAccount(keyClient keys.KeyClient, index int, curve crypto.CurveType) (*genesis.Account, error)

func (*TemplateAccount) GetAmounts added in v0.20.0

func (m *TemplateAccount) GetAmounts() []balance.Balance

func (*TemplateAccount) GetName added in v0.20.0

func (m *TemplateAccount) GetName() string

func (*TemplateAccount) GetPermissions added in v0.20.0

func (m *TemplateAccount) GetPermissions() []string

func (*TemplateAccount) GetPublicKey added in v0.20.0

func (m *TemplateAccount) GetPublicKey() *crypto.PublicKey

func (*TemplateAccount) GetRoles added in v0.20.0

func (m *TemplateAccount) GetRoles() []string

func (*TemplateAccount) Marshal added in v0.20.0

func (m *TemplateAccount) Marshal() (dAtA []byte, err error)

func (*TemplateAccount) MarshalTo added in v0.20.0

func (m *TemplateAccount) MarshalTo(dAtA []byte) (int, error)

func (*TemplateAccount) MarshalToSizedBuffer added in v0.30.0

func (m *TemplateAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TemplateAccount) ProtoMessage added in v0.20.0

func (*TemplateAccount) ProtoMessage()

func (TemplateAccount) RealisePublicKeyAndAddress added in v0.20.1

func (ta TemplateAccount) RealisePublicKeyAndAddress(keyClient keys.KeyClient, curve crypto.CurveType) (pubKey crypto.PublicKey, address crypto.Address, err error)

Adds a public key and address to the template. If PublicKey will try to fetch it by Address. If both PublicKey and Address are not set will use the keyClient to generate a new keypair

func (*TemplateAccount) Reset added in v0.20.0

func (m *TemplateAccount) Reset()

func (*TemplateAccount) Size added in v0.20.0

func (m *TemplateAccount) Size() (n int)

func (*TemplateAccount) String added in v0.20.0

func (m *TemplateAccount) String() string

func (*TemplateAccount) Unmarshal added in v0.20.0

func (m *TemplateAccount) Unmarshal(dAtA []byte) error

func (TemplateAccount) Validator

func (ta TemplateAccount) Validator(keyClient keys.KeyClient, index int, curve crypto.CurveType) (*genesis.Validator, error)

func (*TemplateAccount) XXX_DiscardUnknown added in v0.23.0

func (m *TemplateAccount) XXX_DiscardUnknown()

func (*TemplateAccount) XXX_Marshal added in v0.23.0

func (m *TemplateAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TemplateAccount) XXX_Merge added in v0.23.0

func (m *TemplateAccount) XXX_Merge(src proto.Message)

func (*TemplateAccount) XXX_MessageName added in v0.20.0

func (*TemplateAccount) XXX_MessageName() string

func (*TemplateAccount) XXX_Size added in v0.23.0

func (m *TemplateAccount) XXX_Size() int

func (*TemplateAccount) XXX_Unmarshal added in v0.23.0

func (m *TemplateAccount) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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