Documentation ¶
Index ¶
- Variables
- func AddCommonCheckTxEvents(resp types.ResponseCheckTx, tx Tx) types.ResponseCheckTx
- func AddCommonDeliverTxEvents(resp types.ResponseDeliverTx, tx Tx) types.ResponseDeliverTx
- type App
- func (app *App) ApplySnapshotChunk(req types.RequestApplySnapshotChunk) (resp types.ResponseApplySnapshotChunk)
- func (app *App) BeginBlock(req types.RequestBeginBlock) (resp types.ResponseBeginBlock)
- func (app *App) CheckTx(req types.RequestCheckTx) (resp types.ResponseCheckTx)
- func (app *App) Commit() (resp types.ResponseCommit)
- func (app *App) DeliverTx(req types.RequestDeliverTx) (resp types.ResponseDeliverTx)
- func (app *App) EndBlock(req types.RequestEndBlock) (resp types.ResponseEndBlock)
- func (app *App) GetChainID() string
- func (app *App) HandleCheckTx(cmd txn.Command, fn TxHandler) *App
- func (app *App) HandleDeliverTx(cmd txn.Command, fn TxHandler) *App
- func (app *App) Info(req types.RequestInfo) types.ResponseInfo
- func (app *App) InitChain(req types.RequestInitChain) (resp types.ResponseInitChain)
- func (app *App) ListSnapshots(req types.RequestListSnapshots) (resp types.ResponseListSnapshots)
- func (app *App) LoadSnapshotChunk(req types.RequestLoadSnapshotChunk) (resp types.ResponseLoadSnapshotChunk)
- func (app *App) OfferSnapshot(req types.RequestOfferSnapshot) (resp types.ResponseOfferSnapshot)
- func (app *App) SetChainID(chainID string)
- type ApplySnapshotChunkHandler
- type Client
- func (c *Client) CheckTransaction(ctx context.Context, bytes []byte) (*tmctypes.ResultCheckTx, error)
- func (c *Client) Genesis(ctx context.Context) (*tmtypes.GenesisDoc, error)
- func (c *Client) GenesisValidators(ctx context.Context) ([]*tmtypes.Validator, error)
- func (c *Client) GetChainID(ctx context.Context) (chainID string, err error)
- func (c *Client) GetGenesisTime(ctx context.Context) (genesisTime time.Time, err error)
- func (c *Client) GetNetworkInfo(ctx context.Context) (netInfo *tmctypes.ResultNetInfo, err error)
- func (c *Client) GetStatus(ctx context.Context) (status *tmctypes.ResultStatus, err error)
- func (c *Client) GetUnconfirmedTxCount(ctx context.Context) (count int, err error)
- func (c *Client) Health(ctx context.Context) (*tmctypes.ResultHealth, error)
- func (c *Client) SendTransactionAsync(ctx context.Context, bytes []byte) (*tmctypes.ResultBroadcastTx, error)
- func (c *Client) SendTransactionCommit(ctx context.Context, bytes []byte) (*tmctypes.ResultBroadcastTxCommit, error)
- func (c *Client) SendTransactionSync(ctx context.Context, bytes []byte) (*tmctypes.ResultBroadcastTx, error)
- func (c *Client) Start() error
- func (c *Client) Subscribe(ctx context.Context, fn func(tmctypes.ResultEvent) error, queries ...string) error
- func (c *Client) Validators(ctx context.Context, height *int64) ([]*tmtypes.Validator, error)
- type Codec
- type Command
- type GenesisState
- type InfoHandler
- type ListSnapshotsHandler
- type LoadSnapshotChunkHandler
- type LocalClient
- func (c *LocalClient) CheckTransaction(ctx context.Context, bytes []byte) (*tmctypes.ResultCheckTx, error)
- func (c *LocalClient) Genesis(ctx context.Context) (*tmtypes.GenesisDoc, error)
- func (c *LocalClient) GenesisValidators(ctx context.Context) ([]*tmtypes.Validator, error)
- func (c *LocalClient) GetChainID(ctx context.Context) (chainID string, err error)
- func (c *LocalClient) GetGenesisTime(ctx context.Context) (genesisTime time.Time, err error)
- func (c *LocalClient) GetNetworkInfo(ctx context.Context) (netInfo *tmctypes.ResultNetInfo, err error)
- func (c *LocalClient) GetStatus(ctx context.Context) (status *tmctypes.ResultStatus, err error)
- func (c *LocalClient) GetUnconfirmedTxCount(ctx context.Context) (count int, err error)
- func (c *LocalClient) Health(ctx context.Context) (*tmctypes.ResultHealth, error)
- func (c *LocalClient) SendTransactionAsync(ctx context.Context, bytes []byte) (*tmctypes.ResultBroadcastTx, error)
- func (c *LocalClient) SendTransactionCommit(ctx context.Context, bytes []byte) (*tmctypes.ResultBroadcastTxCommit, error)
- func (c *LocalClient) SendTransactionSync(ctx context.Context, bytes []byte) (*tmctypes.ResultBroadcastTx, error)
- func (c *LocalClient) Start() error
- func (c *LocalClient) Subscribe(ctx context.Context, fn func(tmctypes.ResultEvent) error, queries ...string) error
- func (c *LocalClient) Validators(ctx context.Context, height *int64) ([]*tmtypes.Validator, error)
- type MaybePartialError
- type OffserSnapshotHandler
- type OnBeginBlockHandler
- type OnCheckTxHandler
- type OnCheckTxSpamHandler
- type OnCommitHandler
- type OnDeliverTxHandler
- type OnDeliverTxSpamHandler
- type OnEndBlockHandler
- type OnInitChainHandler
- type SnapshotEngine
- type TmLogger
- type TmNode
- type Tx
- type TxHandler
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyClientAddr = errors.New("abci client addr is empty in config")
var ErrNoNetworkGenesisState = errors.New("no network genesis state")
Functions ¶
func AddCommonCheckTxEvents ¶
func AddCommonCheckTxEvents(resp types.ResponseCheckTx, tx Tx) types.ResponseCheckTx
func AddCommonDeliverTxEvents ¶
func AddCommonDeliverTxEvents(resp types.ResponseDeliverTx, tx Tx) types.ResponseDeliverTx
Types ¶
type App ¶
type App struct { abci.BaseApplication // handlers OnInitChain OnInitChainHandler OnBeginBlock OnBeginBlockHandler OnEndBlock OnEndBlockHandler OnCheckTx OnCheckTxHandler OnDeliverTx OnDeliverTxHandler OnCommit OnCommitHandler // spam check OnCheckTxSpam OnCheckTxSpamHandler OnDeliverTxSpam OnDeliverTxSpamHandler OnListSnapshots ListSnapshotsHandler OnOfferSnapshot OffserSnapshotHandler OnLoadSnapshotChunk LoadSnapshotChunkHandler OnApplySnapshotChunk ApplySnapshotChunkHandler OnInfo InfoHandler // contains filtered or unexported fields }
func (*App) ApplySnapshotChunk ¶
func (app *App) ApplySnapshotChunk(req types.RequestApplySnapshotChunk) (resp types.ResponseApplySnapshotChunk)
func (*App) BeginBlock ¶
func (app *App) BeginBlock(req types.RequestBeginBlock) (resp types.ResponseBeginBlock)
func (*App) CheckTx ¶
func (app *App) CheckTx(req types.RequestCheckTx) (resp types.ResponseCheckTx)
func (*App) Commit ¶
func (app *App) Commit() (resp types.ResponseCommit)
func (*App) DeliverTx ¶
func (app *App) DeliverTx(req types.RequestDeliverTx) (resp types.ResponseDeliverTx)
func (*App) EndBlock ¶
func (app *App) EndBlock(req types.RequestEndBlock) (resp types.ResponseEndBlock)
func (*App) GetChainID ¶
func (*App) Info ¶
func (app *App) Info(req types.RequestInfo) types.ResponseInfo
func (*App) InitChain ¶
func (app *App) InitChain(req types.RequestInitChain) (resp types.ResponseInitChain)
func (*App) ListSnapshots ¶
func (app *App) ListSnapshots(req types.RequestListSnapshots) (resp types.ResponseListSnapshots)
func (*App) LoadSnapshotChunk ¶
func (app *App) LoadSnapshotChunk(req types.RequestLoadSnapshotChunk) (resp types.ResponseLoadSnapshotChunk)
func (*App) OfferSnapshot ¶
func (app *App) OfferSnapshot(req types.RequestOfferSnapshot) (resp types.ResponseOfferSnapshot)
func (*App) SetChainID ¶
type ApplySnapshotChunkHandler ¶
type ApplySnapshotChunkHandler func(context.Context, types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk
ABCI hooks.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CheckTransaction ¶
func (*Client) GenesisValidators ¶
func (*Client) GetChainID ¶
GetChainID retrieves the chainID from the blockchain.
func (*Client) GetGenesisTime ¶
GetGenesisTime retrieves the genesis time from the blockchain.
func (*Client) GetNetworkInfo ¶
GetNetworkInfo return information of the current network.
func (*Client) GetUnconfirmedTxCount ¶
GetUnconfirmedTxCount return the current count of unconfirmed transactions.
func (*Client) SendTransactionAsync ¶
func (*Client) SendTransactionCommit ¶
func (*Client) SendTransactionSync ¶
func (*Client) Subscribe ¶
func (c *Client) Subscribe(ctx context.Context, fn func(tmctypes.ResultEvent) error, queries ...string) error
Subscribe subscribes to any event matching query (https://godoc.org/github.com/tendermint/tendermint/types#pkg-constants). Subscribe will call fn each time it receives an event from the node. The function returns nil when the context is canceled or when fn returns an error.
type GenesisState ¶
type GenesisState struct { // ReplayAttackThreshold protects the network against replay attacks. It sets a // toleration thershold between the current block in the chain and the block // heigh specified in the Tx. Tx with blocks height >= than (chain's height - // distance) are rejected with a AbciTxnRejected. It also keeps a ring-buffer // to cache seen Tx. The Ring buffer size defines the number of block to cache, // each block can hold an unlimited number of Txs. ReplayAttackThreshold uint `json:"replay_attack_threshold"` }
func DefaultGenesis ¶
func DefaultGenesis() GenesisState
func LoadGenesisState ¶
func LoadGenesisState(bytes []byte) (*GenesisState, error)
type ListSnapshotsHandler ¶
type ListSnapshotsHandler func(types.RequestListSnapshots) types.ResponseListSnapshots
ABCI hooks.
type LoadSnapshotChunkHandler ¶
type LoadSnapshotChunkHandler func(types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk
ABCI hooks.
type LocalClient ¶
type LocalClient struct {
// contains filtered or unexported fields
}
func (*LocalClient) CheckTransaction ¶
func (c *LocalClient) CheckTransaction(ctx context.Context, bytes []byte) (*tmctypes.ResultCheckTx, error)
func (*LocalClient) Genesis ¶
func (c *LocalClient) Genesis(ctx context.Context) (*tmtypes.GenesisDoc, error)
func (*LocalClient) GenesisValidators ¶
func (*LocalClient) GetChainID ¶
func (c *LocalClient) GetChainID(ctx context.Context) (chainID string, err error)
GetChainID retrieves the chainID from the blockchain.
func (*LocalClient) GetGenesisTime ¶
GetGenesisTime retrieves the genesis time from the blockchain.
func (*LocalClient) GetNetworkInfo ¶
func (c *LocalClient) GetNetworkInfo(ctx context.Context) (netInfo *tmctypes.ResultNetInfo, err error)
GetNetworkInfo return information of the current network.
func (*LocalClient) GetStatus ¶
func (c *LocalClient) GetStatus(ctx context.Context) (status *tmctypes.ResultStatus, err error)
GetStatus returns the current status of the chain.
func (*LocalClient) GetUnconfirmedTxCount ¶
func (c *LocalClient) GetUnconfirmedTxCount(ctx context.Context) (count int, err error)
GetUnconfirmedTxCount return the current count of unconfirmed transactions.
func (*LocalClient) Health ¶
func (c *LocalClient) Health(ctx context.Context) (*tmctypes.ResultHealth, error)
Health returns the result of the health endpoint of the chain.
func (*LocalClient) SendTransactionAsync ¶
func (c *LocalClient) SendTransactionAsync(ctx context.Context, bytes []byte) (*tmctypes.ResultBroadcastTx, error)
func (*LocalClient) SendTransactionCommit ¶
func (c *LocalClient) SendTransactionCommit(ctx context.Context, bytes []byte) (*tmctypes.ResultBroadcastTxCommit, error)
func (*LocalClient) SendTransactionSync ¶
func (c *LocalClient) SendTransactionSync(ctx context.Context, bytes []byte) (*tmctypes.ResultBroadcastTx, error)
func (*LocalClient) Start ¶
func (c *LocalClient) Start() error
func (*LocalClient) Subscribe ¶
func (c *LocalClient) Subscribe(ctx context.Context, fn func(tmctypes.ResultEvent) error, queries ...string) error
Subscribe subscribes to any event matching query (https://godoc.org/github.com/tendermint/tendermint/types#pkg-constants). Subscribe will call fn each time it receives an event from the node. The function returns nil when the context is canceled or when fn returns an error.
func (*LocalClient) Validators ¶
type MaybePartialError ¶
type OffserSnapshotHandler ¶
type OffserSnapshotHandler func(types.RequestOfferSnapshot) types.ResponseOfferSnapshot
ABCI hooks.
type OnBeginBlockHandler ¶
type OnBeginBlockHandler func(types.RequestBeginBlock) (context.Context, types.ResponseBeginBlock)
ABCI hooks.
type OnCheckTxHandler ¶
type OnCheckTxHandler func(context.Context, types.RequestCheckTx, Tx) (context.Context, types.ResponseCheckTx)
ABCI hooks.
type OnDeliverTxHandler ¶
type OnDeliverTxHandler func(context.Context, types.RequestDeliverTx, Tx) (context.Context, types.ResponseDeliverTx)
ABCI hooks.
type OnDeliverTxSpamHandler ¶
type OnDeliverTxSpamHandler func(context.Context, Tx) types.ResponseDeliverTx
ABCI hooks.
type OnEndBlockHandler ¶
type OnEndBlockHandler func(types.RequestEndBlock) (context.Context, types.ResponseEndBlock)
ABCI hooks.
type OnInitChainHandler ¶
type OnInitChainHandler func(types.RequestInitChain) types.ResponseInitChain
ABCI hooks.
type SnapshotEngine ¶
type SnapshotEngine interface {
AddProviders(provs ...types.StateProvider)
}
type TmNode ¶
type TmNode struct {
// contains filtered or unexported fields
}
func NewTmNode ¶
func NewTmNode( conf blockchain.Config, log *logging.Logger, homeDir string, app types.Application, genesisDoc *tmtypes.GenesisDoc, ) (*TmNode, error)
func (*TmNode) GetClient ¶
func (t *TmNode) GetClient() (*LocalClient, error)
func (*TmNode) ReloadConf ¶
func (*TmNode) ReloadConf(cfg blockchain.Config)