spec

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

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

Variables

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

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, generateNodeKeys bool) (*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) RealiseKeys added in v0.19.0

func (gs *GenesisSpec) RealiseKeys(keyClient keys.KeyClient) 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 */
	NodeAddress      *github_com_hyperledger_burrow_crypto.Address `` /* 138-byte string literal not displayed */
	PublicKey        *crypto.PublicKey                             `protobuf:"bytes,4,opt,name=PublicKey,proto3" json:",omitempty" toml:",omitempty"`
	Amounts          []balance.Balance                             `protobuf:"bytes,5,rep,name=Amounts,proto3" json:",omitempty" toml:",omitempty"`
	Permissions      []string                                      `protobuf:"bytes,6,rep,name=Permissions,proto3" json:",omitempty" toml:",omitempty"`
	Roles            []string                                      `protobuf:"bytes,7,rep,name=Roles,proto3" json:",omitempty" toml:",omitempty"`
	Code             *github_com_hyperledger_burrow_acm.Bytecode   `protobuf:"bytes,8,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) (*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) ProtoMessage added in v0.20.0

func (*TemplateAccount) ProtoMessage()

func (TemplateAccount) RealisePublicKeyAndAddress added in v0.20.1

func (ta TemplateAccount) RealisePublicKeyAndAddress(keyClient keys.KeyClient) (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, generateNodeKeys bool) (*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