angine

package
v0.0.0-...-a4757fd Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Apache-2.0, Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 InitializeLog

func InitializeLog(env, logpath string) *zap.Logger

func ProtocolAndAddress

func ProtocolAndAddress(listenAddr string) (string, string)

ProtocolAndAddress accepts tcp by default

Types

type Angine

type Angine struct {
	Conf *viper.Viper
	// contains filtered or unexported fields
}

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

func NewAngine

func NewAngine(lgr *zap.Logger, conf *viper.Viper) (angine *Angine)

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

func (*Angine) BeginBlock

func (ang *Angine) BeginBlock(block *agtypes.BlockCache, eventFireable events.Fireable, blockPartsHeader *pbtypes.PartSetHeader)

func (*Angine) BroadcastTx

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

func (*Angine) BroadcastTxCommit

func (ang *Angine) BroadcastTxCommit(tx []byte) error

func (*Angine) ConnectApp

func (ang *Angine) ConnectApp(app agtypes.Application) error

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 (ang *Angine) DialSeeds(seeds []string) error

func (*Angine) EndBlock

func (ang *Angine) EndBlock(block *agtypes.BlockCache, eventFireable events.Fireable, blockPartsHeader *pbtypes.PartSetHeader)

plugins modify changedValidators inplace

func (*Angine) ExecBlock

func (ang *Angine) ExecBlock(block *agtypes.BlockCache, eventFireable events.Fireable, executeResult *agtypes.ExecuteResult)

func (*Angine) FlushMempool

func (ang *Angine) FlushMempool()

func (*Angine) Genesis

func (ang *Angine) Genesis() *agtypes.GenesisDoc

func (*Angine) GetBlacklist

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

func (*Angine) GetBlock

func (ang *Angine) GetBlock(height def.INT) (block *agtypes.BlockCache, meta *pbtypes.BlockMeta, err error)

func (*Angine) GetBlockMeta

func (ang *Angine) GetBlockMeta(height def.INT) (meta *pbtypes.BlockMeta, err error)

func (*Angine) GetConsensusStateInfo

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

func (*Angine) GetLatestBlock

func (ang *Angine) GetLatestBlock() (block *agtypes.BlockCache, meta *pbtypes.BlockMeta, err error)

func (*Angine) GetNodeInfo

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

func (*Angine) GetNonEmptyBlockIterator

func (ang *Angine) GetNonEmptyBlockIterator() *blockchain.NonEmptyBlockIterator

func (*Angine) GetNumPeers

func (ang *Angine) GetNumPeers() int

func (*Angine) GetNumUnconfirmedTxs

func (ang *Angine) GetNumUnconfirmedTxs() int

func (*Angine) GetP2PNetInfo

func (ang *Angine) GetP2PNetInfo() (bool, []string, []*agtypes.Peer)

func (*Angine) GetUnconfirmedTxs

func (ang *Angine) GetUnconfirmedTxs() []agtypes.Tx

func (*Angine) GetValidators

func (ang *Angine) GetValidators() (def.INT, *agtypes.ValidatorSet)

func (*Angine) Height

func (ang *Angine) Height() def.INT

func (*Angine) InitPlugins

func (ang *Angine) InitPlugins()

func (*Angine) IsNodeValidator

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

func (*Angine) NonEmptyHeight

func (ang *Angine) NonEmptyHeight() def.INT

func (*Angine) P2PHost

func (ang *Angine) P2PHost() string

func (*Angine) P2PPort

func (ang *Angine) P2PPort() uint16

func (*Angine) PrivValidator

func (ang *Angine) PrivValidator() *agtypes.PrivValidator

func (*Angine) Query

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

func (*Angine) RecoverFromCrash

func (ang *Angine) RecoverFromCrash(appHash []byte, appBlockHeight def.INT) error

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

func (*Angine) RegisterNodeInfo

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

func (*Angine) Start

func (ang *Angine) Start() (err error)

func (*Angine) Stop

func (ang *Angine) Stop() bool

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

type ITxCheck

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

type MempoolFilter

type MempoolFilter struct {
	// contains filtered or unexported fields
}

func NewMempoolFilter

func NewMempoolFilter(f func([]byte) (bool, error)) MempoolFilter

func (MempoolFilter) CheckTx

func (m MempoolFilter) CheckTx(tx agtypes.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 []agtypes.Tx)

type Tunes

type Tunes struct {
	Runtime string
	Conf    *viper.Viper
}

Tunes wraps two different kinds of configurations for angine

Directories

Path Synopsis
blockchain
Package blockchain is a generated protocol buffer package.
Package blockchain is a generated protocol buffer package.
consensus
Package consensus is a generated protocol buffer package.
Package consensus is a generated protocol buffer package.
events
Package events is a generated protocol buffer package.
Package events is a generated protocol buffer package.
mempool
Package mempool is a generated protocol buffer package.
Package mempool is a generated protocol buffer package.
rpc
Package rpc is a generated protocol buffer package.
Package rpc is a generated protocol buffer package.
state
Package state is a generated protocol buffer package.
Package state is a generated protocol buffer package.
trace
Package trace is a generated protocol buffer package.
Package trace is a generated protocol buffer package.
types
Package types is a generated protocol buffer package.
Package types is a generated protocol buffer package.
zip

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL