Documentation ¶
Index ¶
- type Application
- func (app *Application) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk
- func (app *Application) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx
- func (app *Application) Commit() abci.ResponseCommit
- func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx
- func (app *Application) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo
- func (app *Application) InitChain(req abci.RequestInitChain) abci.ResponseInitChain
- func (app *Application) ListSnapshots(req abci.RequestListSnapshots) abci.ResponseListSnapshots
- func (app *Application) LoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk
- func (app *Application) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot
- func (app *Application) Query(req abci.RequestQuery) abci.ResponseQuery
- func (app *Application) Rollback() error
- type Config
- type SnapshotStore
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { abci.BaseApplication // contains filtered or unexported fields }
func NewApplication ¶
func NewApplication(cfg *Config) (*Application, error)
NewApplication creates the application.
func (*Application) ApplySnapshotChunk ¶
func (app *Application) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk
ApplySnapshotChunk implements ABCI.
func (*Application) CheckTx ¶
func (app *Application) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx
CheckTx implements ABCI.
func (*Application) Commit ¶
func (app *Application) Commit() abci.ResponseCommit
Commit implements ABCI.
func (*Application) DeliverTx ¶
func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx
DeliverTx implements ABCI.
func (*Application) EndBlock ¶
func (app *Application) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlock implements ABCI.
func (*Application) Info ¶
func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo
Info implements ABCI.
func (*Application) InitChain ¶
func (app *Application) InitChain(req abci.RequestInitChain) abci.ResponseInitChain
Info implements ABCI.
func (*Application) ListSnapshots ¶
func (app *Application) ListSnapshots(req abci.RequestListSnapshots) abci.ResponseListSnapshots
ListSnapshots implements ABCI.
func (*Application) LoadSnapshotChunk ¶
func (app *Application) LoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk
LoadSnapshotChunk implements ABCI.
func (*Application) OfferSnapshot ¶
func (app *Application) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot
OfferSnapshot implements ABCI.
func (*Application) Query ¶
func (app *Application) Query(req abci.RequestQuery) abci.ResponseQuery
Query implements ABCI.
func (*Application) Rollback ¶
func (app *Application) Rollback() error
type Config ¶
type Config struct { // The directory with which state.json will be persisted in. Usually $HOME/.tendermint/data Dir string `toml:"dir"` // SnapshotInterval specifies the height interval at which the application // will take state sync snapshots. Defaults to 0 (disabled). SnapshotInterval uint64 `toml:"snapshot_interval"` // RetainBlocks specifies the number of recent blocks to retain. Defaults to // 0, which retains all blocks. Must be greater that PersistInterval, // SnapshotInterval and EvidenceAgeHeight. RetainBlocks uint64 `toml:"retain_blocks"` // KeyType sets the curve that will be used by validators. // Options are ed25519 & secp256k1 KeyType string `toml:"key_type"` // PersistInterval specifies the height interval at which the application // will persist state to disk. Defaults to 1 (every height), setting this to // 0 disables state persistence. PersistInterval uint64 `toml:"persist_interval"` // ValidatorUpdates is a map of heights to validator names and their power, // and will be returned by the ABCI application. For example, the following // changes the power of validator01 and validator02 at height 1000: // // [validator_update.1000] // validator01 = 20 // validator02 = 10 // // Specifying height 0 returns the validator update during InitChain. The // application returns the validator updates as-is, i.e. removing a // validator must be done by returning it with power 0, and any validators // not specified are not changed. // // height <-> pubkey <-> voting power ValidatorUpdates map[string]map[string]uint8 `toml:"validator_update"` }
Config allows for the setting of high level parameters for running the e2e Application KeyType and ValidatorUpdates must be the same for all nodes running the same application.
func DefaultConfig ¶
type SnapshotStore ¶
SnapshotStore stores state sync snapshots. Snapshots are stored simply as JSON files, and chunks are generated on-the-fly by splitting the JSON data into fixed-size chunks.
func NewSnapshotStore ¶
func NewSnapshotStore(dir string) (*SnapshotStore, error)
NewSnapshotStore creates a new snapshot store.
func (*SnapshotStore) Create ¶
func (s *SnapshotStore) Create(state *State) (abci.Snapshot, error)
Create creates a snapshot of the given application state's key/value pairs.
type State ¶
type State struct { sync.RWMutex Height uint64 Values map[string]string Hash []byte // contains filtered or unexported fields }
State is the application state.