Documentation
¶
Index ¶
- Variables
- func InitKVStore(app *PersistentKVStoreApplication)
- func RandVal(i int) abci.ValidatorUpdate
- func RandVals(cnt int) []abci.ValidatorUpdate
- type Application
- func (app *Application) ApplySnapshotChunk(ctx context.Context, req *abci.ApplySnapshotChunkRequest) (*abci.ApplySnapshotChunkResponse, error)
- func (app *Application) CheckTx(ctx context.Context, req *abci.CheckTxRequest) (*abci.CheckTxResponse, error)
- func (app *Application) Commit(ctx context.Context, req *abci.CommitRequest) (*abci.CommitResponse, error)
- func (app *Application) Echo(ctx context.Context, req *abci.EchoRequest) (*abci.EchoResponse, error)
- func (app *Application) ExtendVote(ctx context.Context, req *abci.ExtendVoteRequest) (*abci.ExtendVoteResponse, error)
- func (app *Application) FinalizeBlock(ctx context.Context, req *abci.FinalizeBlockRequest) (*abci.FinalizeBlockResponse, error)
- func (app *Application) Info(ctx context.Context, req *abci.InfoRequest) (*abci.InfoResponse, error)
- func (app *Application) InitChain(ctx context.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error)
- func (app *Application) ListSnapshots(ctx context.Context, req *abci.ListSnapshotsRequest) (*abci.ListSnapshotsResponse, error)
- func (app *Application) LoadSnapshotChunk(ctx context.Context, req *abci.LoadSnapshotChunkRequest) (*abci.LoadSnapshotChunkResponse, error)
- func (app *Application) OfferSnapshot(ctx context.Context, req *abci.OfferSnapshotRequest) (*abci.OfferSnapshotResponse, error)
- func (app *Application) PrepareProposal(ctx context.Context, req *abci.PrepareProposalRequest) (*abci.PrepareProposalResponse, error)
- func (app *Application) ProcessProposal(ctx context.Context, req *abci.ProcessProposalRequest) (*abci.ProcessProposalResponse, error)
- func (app *Application) Query(ctx context.Context, reqQuery *abci.QueryRequest) (*abci.QueryResponse, error)
- func (app *Application) VerifyVoteExtension(ctx context.Context, req *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error)
- type PersistentKVStoreApplication
- func (app *PersistentKVStoreApplication) ApplySnapshotChunk(ctx context.Context, req *abci.ApplySnapshotChunkRequest) (*abci.ApplySnapshotChunkResponse, error)
- func (app *PersistentKVStoreApplication) CheckTx(ctx context.Context, req *abci.CheckTxRequest) (*abci.CheckTxResponse, error)
- func (app *PersistentKVStoreApplication) Commit(ctx context.Context, req *abci.CommitRequest) (*abci.CommitResponse, error)
- func (app *PersistentKVStoreApplication) Echo(ctx context.Context, req *abci.EchoRequest) (*abci.EchoResponse, error)
- func (app *PersistentKVStoreApplication) ExtendVote(ctx context.Context, req *abci.ExtendVoteRequest) (*abci.ExtendVoteResponse, error)
- func (app *PersistentKVStoreApplication) FinalizeBlock(ctx context.Context, req *abci.FinalizeBlockRequest) (*abci.FinalizeBlockResponse, error)
- func (app *PersistentKVStoreApplication) Info(ctx context.Context, req *abci.InfoRequest) (*abci.InfoResponse, error)
- func (app *PersistentKVStoreApplication) InitChain(ctx context.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error)
- func (app *PersistentKVStoreApplication) ListSnapshots(ctx context.Context, req *abci.ListSnapshotsRequest) (*abci.ListSnapshotsResponse, error)
- func (app *PersistentKVStoreApplication) LoadSnapshotChunk(ctx context.Context, req *abci.LoadSnapshotChunkRequest) (*abci.LoadSnapshotChunkResponse, error)
- func (app *PersistentKVStoreApplication) OfferSnapshot(ctx context.Context, req *abci.OfferSnapshotRequest) (*abci.OfferSnapshotResponse, error)
- func (app *PersistentKVStoreApplication) PrepareProposal(ctx context.Context, req *abci.PrepareProposalRequest) (*abci.PrepareProposalResponse, error)
- func (app *PersistentKVStoreApplication) ProcessProposal(ctx context.Context, req *abci.ProcessProposalRequest) (*abci.ProcessProposalResponse, error)
- func (app *PersistentKVStoreApplication) Query(ctx context.Context, reqQuery *abci.QueryRequest) (*abci.QueryResponse, error)
- func (app *PersistentKVStoreApplication) SetLogger(l log.Logger)
- func (app *PersistentKVStoreApplication) VerifyVoteExtension(ctx context.Context, req *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error)
- type State
Constants ¶
This section is empty.
Variables ¶
var (
ProtocolVersion uint64 = 0x1
)
Functions ¶
func InitKVStore ¶
func InitKVStore(app *PersistentKVStoreApplication)
InitKVStore initializes the kvstore app with some data, which allows tests to pass and is fine as long as you don't make any tx that modify the validator state
func RandVal ¶
func RandVal(i int) abci.ValidatorUpdate
RandVal creates one random validator, with a key derived from the input value
func RandVals ¶
func RandVals(cnt int) []abci.ValidatorUpdate
RandVals returns a list of cnt validators for initializing the application. Note that the keys are deterministically derived from the index in the array, while the power is random (Change this if not desired)
Types ¶
type Application ¶
type Application struct {
RetainBlocks int64 // blocks to retain after commit (via ResponseCommit.RetainHeight)
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication() *Application
func (*Application) ApplySnapshotChunk ¶
func (app *Application) ApplySnapshotChunk(ctx context.Context, req *abci.ApplySnapshotChunkRequest) (*abci.ApplySnapshotChunkResponse, error)
func (*Application) CheckTx ¶
func (app *Application) CheckTx(ctx context.Context, req *abci.CheckTxRequest) (*abci.CheckTxResponse, error)
func (*Application) Commit ¶
func (app *Application) Commit(ctx context.Context, req *abci.CommitRequest) (*abci.CommitResponse, error)
func (*Application) Echo ¶
func (app *Application) Echo(ctx context.Context, req *abci.EchoRequest) (*abci.EchoResponse, error)
func (*Application) ExtendVote ¶
func (app *Application) ExtendVote(ctx context.Context, req *abci.ExtendVoteRequest) (*abci.ExtendVoteResponse, error)
func (*Application) FinalizeBlock ¶
func (app *Application) FinalizeBlock(ctx context.Context, req *abci.FinalizeBlockRequest) (*abci.FinalizeBlockResponse, error)
func (*Application) Info ¶
func (app *Application) Info(ctx context.Context, req *abci.InfoRequest) (*abci.InfoResponse, error)
func (*Application) InitChain ¶
func (app *Application) InitChain(ctx context.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error)
func (*Application) ListSnapshots ¶
func (app *Application) ListSnapshots(ctx context.Context, req *abci.ListSnapshotsRequest) (*abci.ListSnapshotsResponse, error)
func (*Application) LoadSnapshotChunk ¶
func (app *Application) LoadSnapshotChunk(ctx context.Context, req *abci.LoadSnapshotChunkRequest) (*abci.LoadSnapshotChunkResponse, error)
func (*Application) OfferSnapshot ¶
func (app *Application) OfferSnapshot(ctx context.Context, req *abci.OfferSnapshotRequest) (*abci.OfferSnapshotResponse, error)
func (*Application) PrepareProposal ¶
func (app *Application) PrepareProposal(ctx context.Context, req *abci.PrepareProposalRequest) (*abci.PrepareProposalResponse, error)
Additional methods required by the Application interface
func (*Application) ProcessProposal ¶
func (app *Application) ProcessProposal(ctx context.Context, req *abci.ProcessProposalRequest) (*abci.ProcessProposalResponse, error)
func (*Application) Query ¶
func (app *Application) Query(ctx context.Context, reqQuery *abci.QueryRequest) (*abci.QueryResponse, error)
Returns an associated value or nil if missing.
func (*Application) VerifyVoteExtension ¶
func (app *Application) VerifyVoteExtension(ctx context.Context, req *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error)
type PersistentKVStoreApplication ¶
type PersistentKVStoreApplication struct {
// validator set
ValUpdates []abci.ValidatorUpdate
// contains filtered or unexported fields
}
func NewPersistentKVStoreApplication ¶
func NewPersistentKVStoreApplication(dbDir string) *PersistentKVStoreApplication
func (*PersistentKVStoreApplication) ApplySnapshotChunk ¶
func (app *PersistentKVStoreApplication) ApplySnapshotChunk(ctx context.Context, req *abci.ApplySnapshotChunkRequest) (*abci.ApplySnapshotChunkResponse, error)
func (*PersistentKVStoreApplication) CheckTx ¶
func (app *PersistentKVStoreApplication) CheckTx(ctx context.Context, req *abci.CheckTxRequest) (*abci.CheckTxResponse, error)
func (*PersistentKVStoreApplication) Commit ¶
func (app *PersistentKVStoreApplication) Commit(ctx context.Context, req *abci.CommitRequest) (*abci.CommitResponse, error)
Commit will panic if InitChain was not called
func (*PersistentKVStoreApplication) Echo ¶
func (app *PersistentKVStoreApplication) Echo(ctx context.Context, req *abci.EchoRequest) (*abci.EchoResponse, error)
func (*PersistentKVStoreApplication) ExtendVote ¶
func (app *PersistentKVStoreApplication) ExtendVote(ctx context.Context, req *abci.ExtendVoteRequest) (*abci.ExtendVoteResponse, error)
func (*PersistentKVStoreApplication) FinalizeBlock ¶
func (app *PersistentKVStoreApplication) FinalizeBlock(ctx context.Context, req *abci.FinalizeBlockRequest) (*abci.FinalizeBlockResponse, error)
func (*PersistentKVStoreApplication) Info ¶
func (app *PersistentKVStoreApplication) Info(ctx context.Context, req *abci.InfoRequest) (*abci.InfoResponse, error)
func (*PersistentKVStoreApplication) InitChain ¶
func (app *PersistentKVStoreApplication) InitChain(ctx context.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error)
Save the validators in the merkle tree
func (*PersistentKVStoreApplication) ListSnapshots ¶
func (app *PersistentKVStoreApplication) ListSnapshots(ctx context.Context, req *abci.ListSnapshotsRequest) (*abci.ListSnapshotsResponse, error)
func (*PersistentKVStoreApplication) LoadSnapshotChunk ¶
func (app *PersistentKVStoreApplication) LoadSnapshotChunk(ctx context.Context, req *abci.LoadSnapshotChunkRequest) (*abci.LoadSnapshotChunkResponse, error)
func (*PersistentKVStoreApplication) OfferSnapshot ¶
func (app *PersistentKVStoreApplication) OfferSnapshot(ctx context.Context, req *abci.OfferSnapshotRequest) (*abci.OfferSnapshotResponse, error)
func (*PersistentKVStoreApplication) PrepareProposal ¶
func (app *PersistentKVStoreApplication) PrepareProposal(ctx context.Context, req *abci.PrepareProposalRequest) (*abci.PrepareProposalResponse, error)
Additional required methods for the Application interface
func (*PersistentKVStoreApplication) ProcessProposal ¶
func (app *PersistentKVStoreApplication) ProcessProposal(ctx context.Context, req *abci.ProcessProposalRequest) (*abci.ProcessProposalResponse, error)
func (*PersistentKVStoreApplication) Query ¶
func (app *PersistentKVStoreApplication) Query(ctx context.Context, reqQuery *abci.QueryRequest) (*abci.QueryResponse, error)
When path=/val and data={validator address}, returns the validator update (types.ValidatorUpdate) varint encoded. For any other path, returns an associated value or nil if missing.
func (*PersistentKVStoreApplication) SetLogger ¶
func (app *PersistentKVStoreApplication) SetLogger(l log.Logger)
func (*PersistentKVStoreApplication) VerifyVoteExtension ¶
func (app *PersistentKVStoreApplication) VerifyVoteExtension(ctx context.Context, req *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error)