Back to

Package gemmill

Latest Go to latest

The latest major version is .

Published: May 6, 2020 | Licenses: Apache-2.0 , Apache-2.0 | Module:



const Gversion = "0.1.5"
const (
	TIME_OUT_HEALTH = int64(time.Second * 60)


var (
	GENESIS_NOT_FOUND = errors.New("missing genesis_file")

func Initialize

func Initialize(tune *Tunes, chainId string)

Initialize generates genesis.json and priv_validator.json automatically. It is usually used with commands like "init" before user put the node into running.

func ProtocolAndAddress

func ProtocolAndAddress(listenAddr string) (string, string)

ProtocolAndAddress accepts tcp by default

type Angine

type Angine struct {
	Tune *Tunes
	// contains filtered or unexported fields

Angine is a high level abstraction of all the state, consensus, mempool blah blah...

func NewAngine

func NewAngine(app types.Application, tune *Tunes) (angine *Angine, err error)

NewAngine makes and returns a new angine, which can be used directly after being imported

func (*Angine) APIs

func (a *Angine) APIs() []map[string]*rpcserver.RPCFunc

func (*Angine) BeginBlock

func (ang *Angine) BeginBlock(block *types.Block, eventFireable events.Fireable, blockPartsHeader *types.PartSetHeader) error

func (*Angine) BroadcastTx

func (e *Angine) BroadcastTx(tx []byte) error

func (*Angine) BroadcastTxCommit

func (e *Angine) BroadcastTxCommit(tx []byte) (err error)

func (*Angine) ConnectApp

func (e *Angine) ConnectApp(app types.Application)

func (*Angine) Destroy

func (ang *Angine) Destroy()

Destroy is called after something go south while before angine.Start has been called

func (*Angine) DialSeeds

func (e *Angine) DialSeeds(seeds []string)

func (*Angine) EndBlock

func (ang *Angine) EndBlock(block *types.Block, eventFireable events.Fireable, blockPartsHeader *types.PartSetHeader, changedValAttrs []*types.ValidatorAttr, nextVS *types.ValidatorSet) error

plugins modify changedValidators inplace

func (*Angine) ExecAdminTx

func (ang *Angine) ExecAdminTx(app plugin.AdminApp, tx []byte) error

func (*Angine) ExecBlock

func (ang *Angine) ExecBlock(block *types.Block, eventFireable events.Fireable, executeResult *types.ExecuteResult) error

func (*Angine) FlushMempool

func (e *Angine) FlushMempool()

func (*Angine) Genesis

func (e *Angine) Genesis() *types.GenesisDoc

func (*Angine) GetBlacklist

func (e *Angine) GetBlacklist() []string

func (*Angine) GetBlock

func (e *Angine) GetBlock(height int64) (block *types.Block, meta *types.BlockMeta, err error)

func (*Angine) GetBlockMeta

func (e *Angine) GetBlockMeta(height int64) (meta *types.BlockMeta, err error)

func (*Angine) GetConsensusStateInfo

func (e *Angine) GetConsensusStateInfo() (string, []string)

func (*Angine) GetNodeInfo

func (e *Angine) GetNodeInfo() *p2p.NodeInfo

func (*Angine) GetNumPeers

func (e *Angine) GetNumPeers() int

func (*Angine) GetNumUnconfirmedTxs

func (e *Angine) GetNumUnconfirmedTxs() int

func (*Angine) GetP2PNetInfo

func (e *Angine) GetP2PNetInfo() (bool, []string, []*types.Peer)

func (*Angine) GetUnconfirmedTxs

func (e *Angine) GetUnconfirmedTxs() []types.Tx

func (*Angine) GetValidators

func (e *Angine) GetValidators() (int64, *types.ValidatorSet)

func (*Angine) HealthStatus

func (ag *Angine) HealthStatus() int

func (*Angine) Height

func (e *Angine) Height() int64

func (*Angine) InitPlugins

func (ang *Angine) InitPlugins()

func (*Angine) IsNodeValidator

func (e *Angine) IsNodeValidator(pub crypto.PubKey) bool

func (*Angine) NoneGenesis

func (e *Angine) NoneGenesis() bool

func (*Angine) OnRecvExchangeData

func (a *Angine) OnRecvExchangeData(data *p2p.ExchangeData) error

func (*Angine) OriginHeight

func (e *Angine) OriginHeight() int64

func (*Angine) P2PHost

func (e *Angine) P2PHost() string

func (*Angine) P2PPort

func (e *Angine) P2PPort() uint16

func (*Angine) PrivValidator

func (e *Angine) PrivValidator() *types.PrivValidator

func (*Angine) Query

func (ang *Angine) Query(queryType byte, load []byte) (interface{}, error)

func (*Angine) QueryPayLoad

func (ang *Angine) QueryPayLoad(load []byte) (interface{}, error)

func (*Angine) QueryTransaction

func (ang *Angine) QueryTransaction(load []byte) (interface{}, error)

func (*Angine) RecoverFromCrash

func (e *Angine) RecoverFromCrash(appHash []byte, appBlockHeight int64) error

Recover world status Replay all blocks after blockHeight and ensure the result matches the current state.

func (*Angine) RegisterNodeInfo

func (e *Angine) RegisterNodeInfo(ni *p2p.NodeInfo)

func (*Angine) SetQueryPayLoadTxParser

func (a *Angine) SetQueryPayLoadTxParser(fn func([]byte) ([]byte, error))

func (*Angine) Start

func (e *Angine) Start() error

func (*Angine) Stop

func (ang *Angine) Stop() bool

Stop just wrap around swtich.Stop, which will stop reactors, listeners,etc

func (*Angine) UpdateStateMachine

func (ang *Angine) UpdateStateMachine(s *state.State)


type ITxCheck

type ITxCheck interface {
	CheckTx(types.Tx) (bool, error)

type MockMempool

type MockMempool struct {

Updates to the mempool need to be synchronized with committing a block so apps can reset their transient state on Commit

func (MockMempool) Lock

func (m MockMempool) Lock()

func (MockMempool) Unlock

func (m MockMempool) Unlock()

func (MockMempool) Update

func (m MockMempool) Update(height int64, txs []types.Tx)

type Tunes

type Tunes struct {
	Runtime string
	Conf    *viper.Viper

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier