gemmill

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0, Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

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

Variables

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

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 ProtocolAndAddress

func ProtocolAndAddress(listenAddr string) (string, string)

ProtocolAndAddress accepts tcp by default

Types

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 added in v1.4.0

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 added in v1.4.2

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

UpdateStateMachine

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
}

Directories

Path Synopsis
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.
modules
go-common
Classical-inheritance-style service declarations.
Classical-inheritance-style service declarations.
go-flowrate/flowrate
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.
p2p
Uses nacl's secret_box to encrypt a net.Conn.
Uses nacl's secret_box to encrypt a net.Conn.
upnp
Taken from taipei-torrent Just enough UPnP to be able to forward ports
Taken from taipei-torrent Just enough UPnP to be able to forward ports
rpc
server
Commons for HTTP handling
Commons for HTTP handling
zip

Jump to

Keyboard shortcuts

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