Documentation ¶
Index ¶
- Constants
- Variables
- func Initialize(tune *Tunes, chainId string)
- func ProtocolAndAddress(listenAddr string) (string, string)
- type Angine
- func (a *Angine) APIs() []map[string]*rpcserver.RPCFunc
- func (ang *Angine) BeginBlock(block *types.Block, eventFireable events.Fireable, ...) error
- func (e *Angine) BroadcastTx(tx []byte) error
- func (e *Angine) BroadcastTxCommit(tx []byte) (err error)
- func (e *Angine) ConnectApp(app types.Application)
- func (ang *Angine) Destroy()
- func (e *Angine) DialSeeds(seeds []string)
- func (ang *Angine) EndBlock(block *types.Block, eventFireable events.Fireable, ...) error
- func (ang *Angine) ExecAdminTx(app plugin.AdminApp, tx []byte) error
- func (ang *Angine) ExecBlock(block *types.Block, eventFireable events.Fireable, ...) error
- func (e *Angine) FlushMempool()
- func (e *Angine) Genesis() *types.GenesisDoc
- func (e *Angine) GetBlacklist() []string
- func (e *Angine) GetBlock(height int64) (block *types.Block, meta *types.BlockMeta, err error)
- func (e *Angine) GetBlockMeta(height int64) (meta *types.BlockMeta, err error)
- func (e *Angine) GetConsensusStateInfo() (string, []string)
- func (e *Angine) GetNodeInfo() *p2p.NodeInfo
- func (e *Angine) GetNumPeers() int
- func (e *Angine) GetNumUnconfirmedTxs() int
- func (e *Angine) GetP2PNetInfo() (bool, []string, []*types.Peer)
- func (e *Angine) GetUnconfirmedTxs() []types.Tx
- func (e *Angine) GetValidators() (int64, *types.ValidatorSet)
- func (ag *Angine) HealthStatus() int
- func (e *Angine) Height() int64
- func (ang *Angine) InitPlugins()
- func (e *Angine) IsNodeValidator(pub crypto.PubKey) bool
- func (e *Angine) NoneGenesis() bool
- func (a *Angine) OnRecvExchangeData(data *p2p.ExchangeData) error
- func (e *Angine) OriginHeight() int64
- func (e *Angine) P2PHost() string
- func (e *Angine) P2PPort() uint16
- func (e *Angine) PrivValidator() *types.PrivValidator
- func (ang *Angine) Query(queryType byte, load []byte) (interface{}, error)
- func (ang *Angine) QueryPayLoad(load []byte) (interface{}, error)
- func (ang *Angine) QueryTransaction(load []byte) (interface{}, error)
- func (e *Angine) RecoverFromCrash(appHash []byte, appBlockHeight int64) error
- func (e *Angine) RegisterNodeInfo(ni *p2p.NodeInfo)
- func (a *Angine) SetQueryPayLoadTxParser(fn func([]byte) ([]byte, error))
- func (e *Angine) Start() error
- func (ang *Angine) Stop() bool
- func (ang *Angine) UpdateStateMachine(s *state.State)
- type ITxCheck
- type MockMempool
- type Tunes
Constants ¶
const Gversion = "0.1.5"
const (
TIME_OUT_HEALTH = int64(time.Second * 60)
)
Variables ¶
var (
GENESIS_NOT_FOUND = errors.New("missing genesis_file")
)
Functions ¶
func Initialize ¶
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 ¶
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) BeginBlock ¶
func (*Angine) BroadcastTx ¶
func (*Angine) BroadcastTxCommit ¶
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) 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) FlushMempool ¶
func (e *Angine) FlushMempool()
func (*Angine) Genesis ¶
func (e *Angine) Genesis() *types.GenesisDoc
func (*Angine) GetBlacklist ¶
func (*Angine) GetBlockMeta ¶
func (*Angine) GetConsensusStateInfo ¶
func (*Angine) GetNodeInfo ¶
func (*Angine) GetNumPeers ¶
func (*Angine) GetNumUnconfirmedTxs ¶
func (*Angine) GetUnconfirmedTxs ¶
func (*Angine) GetValidators ¶
func (e *Angine) GetValidators() (int64, *types.ValidatorSet)
func (*Angine) HealthStatus ¶
func (*Angine) InitPlugins ¶
func (ang *Angine) InitPlugins()
func (*Angine) IsNodeValidator ¶
func (*Angine) NoneGenesis ¶
func (*Angine) OnRecvExchangeData ¶
func (a *Angine) OnRecvExchangeData(data *p2p.ExchangeData) error
func (*Angine) OriginHeight ¶
func (*Angine) PrivValidator ¶
func (e *Angine) PrivValidator() *types.PrivValidator
func (*Angine) QueryPayLoad ¶
func (*Angine) QueryTransaction ¶
func (*Angine) RecoverFromCrash ¶
Recover world status Replay all blocks after blockHeight and ensure the result matches the current state.
func (*Angine) RegisterNodeInfo ¶
func (*Angine) SetQueryPayLoadTxParser ¶
func (*Angine) UpdateStateMachine ¶ added in v1.4.2
UpdateStateMachine
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()
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. |
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 |
server
Commons for HTTP handling
|
Commons for HTTP handling |