burrow: github.com/hyperledger/burrow/genesis/spec Index | Files

package spec

import "github.com/hyperledger/burrow/genesis/spec"

Index

Package Files

genesis_spec.go presets.go spec.pb.go template_account.go

Constants

const DefaultAmount uint64 = 1000000
const DefaultPower uint64 = 10000

Variables

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

type GenesisSpec Uses

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 Uses

func DeveloperAccount(name string) GenesisSpec

func FullAccount Uses

func FullAccount(name string) GenesisSpec

func GenesisSpecFromJSON Uses

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

func MergeGenesisSpecs Uses

func MergeGenesisSpecs(genesisSpecs ...GenesisSpec) GenesisSpec

func ParticipantAccount Uses

func ParticipantAccount(name string) GenesisSpec

func RootAccount Uses

func RootAccount(name string) GenesisSpec

func ValidatorAccount Uses

func ValidatorAccount(name string) GenesisSpec

func (*GenesisSpec) GenesisDoc Uses

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 Uses

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

func (*GenesisSpec) JSONBytes Uses

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

func (*GenesisSpec) ShortHash Uses

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

type TemplateAccount Uses

type TemplateAccount struct {
    Name             string                                        `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
    Address          *github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,2,opt,name=Address,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:",omitempty" toml:",omitempty"`
    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 Uses

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

func (TemplateAccount) Balances Uses

func (ta TemplateAccount) Balances() balance.Balances

func (*TemplateAccount) Descriptor Uses

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

func (TemplateAccount) GenesisAccount Uses

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

func (*TemplateAccount) GetAmounts Uses

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

func (*TemplateAccount) GetName Uses

func (m *TemplateAccount) GetName() string

func (*TemplateAccount) GetPermissions Uses

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

func (*TemplateAccount) GetPublicKey Uses

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

func (*TemplateAccount) GetRoles Uses

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

func (*TemplateAccount) Marshal Uses

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

func (*TemplateAccount) MarshalTo Uses

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

func (*TemplateAccount) MarshalToSizedBuffer Uses

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

func (*TemplateAccount) ProtoMessage Uses

func (*TemplateAccount) ProtoMessage()

func (TemplateAccount) RealisePublicKeyAndAddress Uses

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 Uses

func (m *TemplateAccount) Reset()

func (*TemplateAccount) Size Uses

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

func (*TemplateAccount) String Uses

func (m *TemplateAccount) String() string

func (*TemplateAccount) Unmarshal Uses

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

func (TemplateAccount) Validator Uses

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

func (*TemplateAccount) XXX_DiscardUnknown Uses

func (m *TemplateAccount) XXX_DiscardUnknown()

func (*TemplateAccount) XXX_Marshal Uses

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

func (*TemplateAccount) XXX_Merge Uses

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

func (*TemplateAccount) XXX_MessageName Uses

func (*TemplateAccount) XXX_MessageName() string

func (*TemplateAccount) XXX_Size Uses

func (m *TemplateAccount) XXX_Size() int

func (*TemplateAccount) XXX_Unmarshal Uses

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

Package spec imports 18 packages (graph) and is imported by 20 packages. Updated 2020-05-03. Refresh now. Tools for package owners.