Documentation ¶
Index ¶
- func CheckSpecialOPVoteSig(cmd *types.SpecialOPCmd, pk crypto.PubKey, sigData []byte) error
- func GenChainid() string
- func Initialize(tune *Tunes, chainId string)
- func InitializeLog(env, logpath string) *zap.Logger
- func ProtocolAndAddress(listenAddr string) (string, string)
- type Angine
- func (e *Angine) AppendSignatureToSpecialCmd(cmd *types.SpecialOPCmd, pubkey crypto.PubKey, sig crypto.Signature)
- func (ang *Angine) BeginBlock(block *agtypes.BlockCache, eventFireable events.Fireable, ...)
- func (ang *Angine) BroadcastTx(tx []byte) error
- func (ang *Angine) BroadcastTxCommit(tx []byte) error
- func (e *Angine) CollectSpecialVotes(cmd *types.SpecialOPCmd) error
- func (ang *Angine) ConnectApp(app agtypes.Application) error
- func (ang *Angine) Destroy()
- func (ang *Angine) DialSeeds(seeds []string) error
- func (ang *Angine) EndBlock(block *agtypes.BlockCache, eventFireable events.Fireable, ...)
- func (ang *Angine) ExecBlock(block *agtypes.BlockCache, eventFireable events.Fireable, ...)
- func (ang *Angine) FlushMempool()
- func (ang *Angine) Genesis() *agtypes.GenesisDoc
- func (ang *Angine) GetBlacklist() []string
- func (ang *Angine) GetBlock(height def.INT) (block *agtypes.BlockCache, meta *pbtypes.BlockMeta, err error)
- func (ang *Angine) GetBlockMeta(height def.INT) (meta *pbtypes.BlockMeta, err error)
- func (ang *Angine) GetConsensusStateInfo() (string, []string)
- func (ang *Angine) GetNodeInfo() *p2p.NodeInfo
- func (ang *Angine) GetNonEmptyBlockIterator() *blockchain.NonEmptyBlockIterator
- func (ang *Angine) GetNumPeers() int
- func (ang *Angine) GetNumUnconfirmedTxs() int
- func (ang *Angine) GetP2PNetInfo() (bool, []string, []*agtypes.Peer)
- func (ang *Angine) GetUnconfirmedTxs() []agtypes.Tx
- func (ang *Angine) GetValidators() (def.INT, *agtypes.ValidatorSet)
- func (ang *Angine) Height() def.INT
- func (ang *Angine) InitPlugins()
- func (ang *Angine) IsNodeValidator(pub crypto.PubKey) bool
- func (ang *Angine) NonEmptyHeight() def.INT
- func (ang *Angine) OriginHeight() def.INT
- func (ang *Angine) P2PHost() string
- func (ang *Angine) P2PPort() uint16
- func (ang *Angine) PrivValidator() *agtypes.PrivValidator
- func (e *Angine) ProcessSpecialOP(tx []byte) error
- func (e *Angine) ProcessVoteChannel(tx atypes.Tx) (*atypes.ResultRequestVoteChannel, error)
- func (ang *Angine) Query(queryType byte, load []byte) (interface{}, error)
- func (ang *Angine) RecoverFromCrash(appHash []byte, appBlockHeight def.INT) error
- func (ang *Angine) RegisterNodeInfo(ni *p2p.NodeInfo)
- func (e *Angine) SignSpecialOP(cmd *types.SpecialOPCmd) ([]byte, error)
- func (e *Angine) SpecialOPResponseHandler(data []byte) []byte
- func (ang *Angine) Start() (err error)
- func (ang *Angine) Stop() bool
- type ITxCheck
- type MempoolFilter
- type MockMempool
- type Tunes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSpecialOPVoteSig ¶
CheckSpecialOPVoteSig just wraps the action on how to check the votes we got.
func GenChainid ¶
func GenChainid() string
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 InitializeLog ¶
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 ¶
NewAngine makes and returns a new angine, which can be used directly after being imported
func (*Angine) AppendSignatureToSpecialCmd ¶
func (e *Angine) AppendSignatureToSpecialCmd(cmd *types.SpecialOPCmd, pubkey crypto.PubKey, sig crypto.Signature)
AppendSignatureToSpecialCmd appends signature onto cmd.Sigs
func (*Angine) BeginBlock ¶
func (ang *Angine) BeginBlock(block *agtypes.BlockCache, eventFireable events.Fireable, blockPartsHeader *pbtypes.PartSetHeader)
func (*Angine) BroadcastTx ¶
func (*Angine) BroadcastTxCommit ¶
func (*Angine) CollectSpecialVotes ¶
func (e *Angine) CollectSpecialVotes(cmd *types.SpecialOPCmd) error
CollectSpecialVotes collects special votes. Communications are made on p2p port by a dedicated reactor. Within tracerouter_msg_ttl timeout, see if we can get more than 2/3 voting power.
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) EndBlock ¶
func (ang *Angine) EndBlock(block *agtypes.BlockCache, eventFireable events.Fireable, blockPartsHeader *pbtypes.PartSetHeader, changedValAttrs []*agtypes.ValidatorAttr, nextVS *agtypes.ValidatorSet)
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 (*Angine) GetBlockMeta ¶
func (*Angine) GetConsensusStateInfo ¶
func (*Angine) GetNodeInfo ¶
func (*Angine) GetNonEmptyBlockIterator ¶
func (ang *Angine) GetNonEmptyBlockIterator() *blockchain.NonEmptyBlockIterator
func (*Angine) GetNumPeers ¶
func (*Angine) GetNumUnconfirmedTxs ¶
func (*Angine) GetUnconfirmedTxs ¶
func (*Angine) GetValidators ¶
func (ang *Angine) GetValidators() (def.INT, *agtypes.ValidatorSet)
func (*Angine) InitPlugins ¶
func (ang *Angine) InitPlugins()
func (*Angine) NonEmptyHeight ¶
func (*Angine) OriginHeight ¶
func (*Angine) PrivValidator ¶
func (ang *Angine) PrivValidator() *agtypes.PrivValidator
func (*Angine) ProcessSpecialOP ¶
ProcessSpecialOP is the ability of Angine. It is called when a specialop tx comes in but before going into mempool. We do a specialvotes collection here. Only with 2/3+ voting power can the tx go into mempool.
func (*Angine) ProcessVoteChannel ¶
RequestVoteChannel handle user rpc requst
func (*Angine) RecoverFromCrash ¶
Recover world status Replay all blocks after blockHeight and ensure the result matches the current state.
func (*Angine) RegisterNodeInfo ¶
func (*Angine) SignSpecialOP ¶
func (e *Angine) SignSpecialOP(cmd *types.SpecialOPCmd) ([]byte, error)
SignSpecialOP wraps around plugin.Specialop
func (*Angine) SpecialOPResponseHandler ¶
SpecialOPResponseHandler defines what we do when we get a specialop request from a peer. This is mainly used as a callback within TraceRouter.
type MempoolFilter ¶
type MempoolFilter struct {
// contains filtered or unexported fields
}
func NewMempoolFilter ¶
func NewMempoolFilter(f func([]byte) (bool, error)) MempoolFilter
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 |
---|---|
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. |
utils
|
|