Documentation ¶
Overview ¶
Copyright 2019 ChainSafe Systems (ON) Corp. This file is part of gossamer.
The gossamer library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The gossamer library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the gossamer library. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func NewInstance(code []byte, cfg *Config) (runtime.Instance, error)
- func NewRuntimeFromGenesis(g *genesis.Genesis, cfg *Config) (runtime.Instance, error)
- type Config
- type Instance
- func (in *Instance) ApplyExtrinsic(data types.Extrinsic) ([]byte, error)
- func (in *Instance) BabeConfiguration() (*types.BabeConfiguration, error)
- func (in *Instance) CheckInherents()
- func (in *Instance) Exec(function string, data []byte) ([]byte, error)
- func (in *Instance) ExecuteBlock(block *types.Block) ([]byte, error)
- func (in *Instance) FinalizeBlock() (*types.Header, error)
- func (in *Instance) GenerateSessionKeys()
- func (in *Instance) GrandpaAuthorities() ([]*types.Authority, error)
- func (in *Instance) InherentExtrinsics(data []byte) ([]byte, error)
- func (in *Instance) InitializeBlock(header *types.Header) error
- func (in *Instance) Metadata() ([]byte, error)
- func (in *Instance) NetworkService() runtime.BasicNetwork
- func (in *Instance) NodeStorage() runtime.NodeStorage
- func (in *Instance) OffchainWorker()
- func (in *Instance) RandomSeed()
- func (in *Instance) SetContextStorage(s runtime.Storage)
- func (in *Instance) Stop()
- func (in *Instance) UpdateRuntimeCode(_ []byte) error
- func (in *Instance) ValidateTransaction(e types.Extrinsic) (*transaction.Validity, error)
- func (in *Instance) Version() (runtime.Version, error)
- type Memory
- type Resolver
Constants ¶
const Name = "life"
Name represents the name of the interpreter
Variables ¶
This section is empty.
Functions ¶
func NewInstance ¶
NewInstance ...
Types ¶
type Config ¶
type Config struct { runtime.InstanceConfig Resolver exec.ImportResolver }
Config represents a life configuration
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance represents a v0.8 runtime life instance
func (*Instance) ApplyExtrinsic ¶
ApplyExtrinsic calls runtime API function BlockBuilder_apply_extrinsic
func (*Instance) BabeConfiguration ¶
func (in *Instance) BabeConfiguration() (*types.BabeConfiguration, error)
BabeConfiguration gets the configuration data for BABE from the runtime
func (*Instance) CheckInherents ¶
func (in *Instance) CheckInherents()
func (*Instance) ExecuteBlock ¶
ExecuteBlock calls runtime function Core_execute_block
func (*Instance) FinalizeBlock ¶
FinalizeBlock calls runtime API function BlockBuilder_finalize_block
func (*Instance) GenerateSessionKeys ¶
func (in *Instance) GenerateSessionKeys()
func (*Instance) GrandpaAuthorities ¶
GrandpaAuthorities returns the genesis authorities from the runtime
func (*Instance) InherentExtrinsics ¶
InherentExtrinsics calls runtime API function BlockBuilder_inherent_extrinsics
func (*Instance) InitializeBlock ¶
InitializeBlock calls runtime API function Core_initialize_block
func (*Instance) NetworkService ¶
func (in *Instance) NetworkService() runtime.BasicNetwork
NetworkService to get referernce to runtime network service
func (*Instance) NodeStorage ¶
func (in *Instance) NodeStorage() runtime.NodeStorage
NodeStorage to get reference to runtime node service
func (*Instance) OffchainWorker ¶
func (in *Instance) OffchainWorker()
func (*Instance) RandomSeed ¶
func (in *Instance) RandomSeed()
func (*Instance) SetContextStorage ¶
SetContextStorage sets the runtime's storage. It should be set before calls to the below functions.
func (*Instance) UpdateRuntimeCode ¶
UpdateRuntimeCode ...
func (*Instance) ValidateTransaction ¶
ValidateTransaction runs the extrinsic through runtime function TaggedTransactionQueue_validate_transaction and returns *Validity
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory is a thin wrapper around life's memory to support Gossamer runtime.Memory interface
type Resolver ¶
type Resolver struct{} // TODO: move context inside resolver
Resolver resolves the imports for life
func (*Resolver) ResolveFunc ¶
func (r *Resolver) ResolveFunc(module, field string) exec.FunctionImport
ResolveFunc ...
func (*Resolver) ResolveGlobal ¶
ResolveGlobal ...