Documentation ¶
Index ¶
- Constants
- Variables
- type GenesisSpec
- func DeveloperAccount(name string) GenesisSpec
- func FullAccount(name string) GenesisSpec
- func GenesisSpecFromJSON(jsonBlob []byte) (*GenesisSpec, error)
- func MergeGenesisSpecs(genesisSpecs ...GenesisSpec) GenesisSpec
- func ParticipantAccount(name string) GenesisSpec
- func RootAccount(name string) GenesisSpec
- func ValidatorAccount(name string) GenesisSpec
- func (gs *GenesisSpec) GenesisDoc(keyClient keys.KeyClient, generateNodeKeys bool) (*genesis.GenesisDoc, error)
- func (gs *GenesisSpec) Hash() []byte
- func (gs *GenesisSpec) JSONBytes() ([]byte, error)
- func (gs *GenesisSpec) RealiseKeys(keyClient keys.KeyClient) error
- func (gs *GenesisSpec) ShortHash() []byte
- type TemplateAccount
- func (ta TemplateAccount) AccountPermissions() (permission.AccountPermissions, error)
- func (ta TemplateAccount) Balances() balance.Balances
- func (*TemplateAccount) Descriptor() ([]byte, []int)
- func (ta TemplateAccount) GenesisAccount(keyClient keys.KeyClient, index int) (*genesis.Account, error)
- func (m *TemplateAccount) GetAmounts() []balance.Balance
- func (m *TemplateAccount) GetName() string
- func (m *TemplateAccount) GetPermissions() []string
- func (m *TemplateAccount) GetPublicKey() *crypto.PublicKey
- func (m *TemplateAccount) GetRoles() []string
- func (m *TemplateAccount) Marshal() (dAtA []byte, err error)
- func (m *TemplateAccount) MarshalTo(dAtA []byte) (int, error)
- func (*TemplateAccount) ProtoMessage()
- func (ta TemplateAccount) RealisePublicKeyAndAddress(keyClient keys.KeyClient) (pubKey crypto.PublicKey, address crypto.Address, err error)
- func (m *TemplateAccount) Reset()
- func (m *TemplateAccount) Size() (n int)
- func (m *TemplateAccount) String() string
- func (m *TemplateAccount) Unmarshal(dAtA []byte) error
- func (ta TemplateAccount) Validator(keyClient keys.KeyClient, index int, generateNodeKeys bool) (*genesis.Validator, error)
- func (m *TemplateAccount) XXX_DiscardUnknown()
- func (m *TemplateAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TemplateAccount) XXX_Merge(src proto.Message)
- func (*TemplateAccount) XXX_MessageName() string
- func (m *TemplateAccount) XXX_Size() int
- func (m *TemplateAccount) XXX_Unmarshal(b []byte) error
Constants ¶
const DefaultAmount uint64 = 1000000
const DefaultPower uint64 = 10000
const DefaultProposalThreshold uint64 = 3
Variables ¶
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 ¶
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" json:",omitempty" toml:",omitempty"` Amounts []balance.Balance `protobuf:"bytes,5,rep,name=Amounts" json:",omitempty" toml:",omitempty"` Permissions []string `protobuf:"bytes,6,rep,name=Permissions" json:",omitempty" toml:",omitempty"` Roles []string `protobuf:"bytes,7,rep,name=Roles" 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 ¶
func (ta TemplateAccount) Balances() balance.Balances
func (*TemplateAccount) Descriptor ¶
func (*TemplateAccount) Descriptor() ([]byte, []int)
func (TemplateAccount) GenesisAccount ¶
func (*TemplateAccount) GetAmounts ¶
func (m *TemplateAccount) GetAmounts() []balance.Balance
func (*TemplateAccount) GetName ¶
func (m *TemplateAccount) GetName() string
func (*TemplateAccount) GetPermissions ¶
func (m *TemplateAccount) GetPermissions() []string
func (*TemplateAccount) GetPublicKey ¶
func (m *TemplateAccount) GetPublicKey() *crypto.PublicKey
func (*TemplateAccount) GetRoles ¶
func (m *TemplateAccount) GetRoles() []string
func (*TemplateAccount) Marshal ¶
func (m *TemplateAccount) Marshal() (dAtA []byte, err error)
func (*TemplateAccount) ProtoMessage ¶
func (*TemplateAccount) ProtoMessage()
func (TemplateAccount) RealisePublicKeyAndAddress ¶
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 ¶
func (m *TemplateAccount) Reset()
func (*TemplateAccount) Size ¶
func (m *TemplateAccount) Size() (n int)
func (*TemplateAccount) String ¶
func (m *TemplateAccount) String() string
func (*TemplateAccount) Unmarshal ¶
func (m *TemplateAccount) Unmarshal(dAtA []byte) error
func (*TemplateAccount) XXX_DiscardUnknown ¶
func (m *TemplateAccount) XXX_DiscardUnknown()
func (*TemplateAccount) XXX_Marshal ¶
func (m *TemplateAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TemplateAccount) XXX_Merge ¶
func (dst *TemplateAccount) XXX_Merge(src proto.Message)
func (*TemplateAccount) XXX_MessageName ¶
func (*TemplateAccount) XXX_MessageName() string
func (*TemplateAccount) XXX_Size ¶
func (m *TemplateAccount) XXX_Size() int
func (*TemplateAccount) XXX_Unmarshal ¶
func (m *TemplateAccount) XXX_Unmarshal(b []byte) error