tendermint: github.com/tendermint/tendermint/abci/example/kvstore Index | Files

package kvstore

import "github.com/tendermint/tendermint/abci/example/kvstore"

Index

Package Files

helpers.go kvstore.go persistent_kvstore.go

Constants

const (
    ValidatorSetChangePrefix string = "val:"
)

Variables

var (
    ProtocolVersion version.Protocol = 0x1
)

func InitKVStore Uses

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 MakeValSetChangeTx Uses

func MakeValSetChangeTx(pubkey types.PubKey, power int64) []byte

func RandVal Uses

func RandVal(i int) types.ValidatorUpdate

RandVal creates one random validator, with a key derived from the input value

func RandVals Uses

func RandVals(cnt int) []types.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)

type KVStoreApplication Uses

type KVStoreApplication struct {
    types.BaseApplication
    // contains filtered or unexported fields
}

func NewKVStoreApplication Uses

func NewKVStoreApplication() *KVStoreApplication

func (*KVStoreApplication) CheckTx Uses

func (app *KVStoreApplication) CheckTx(req types.RequestCheckTx) types.ResponseCheckTx

func (*KVStoreApplication) Commit Uses

func (app *KVStoreApplication) Commit() types.ResponseCommit

func (*KVStoreApplication) DeliverTx Uses

func (app *KVStoreApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx

tx is either "key=value" or just arbitrary bytes

func (*KVStoreApplication) Info Uses

func (app *KVStoreApplication) Info(req types.RequestInfo) (resInfo types.ResponseInfo)

func (*KVStoreApplication) Query Uses

func (app *KVStoreApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery)

Returns an associated value or nil if missing.

type PersistentKVStoreApplication Uses

type PersistentKVStoreApplication struct {

    // validator set
    ValUpdates []types.ValidatorUpdate
    // contains filtered or unexported fields
}

func NewPersistentKVStoreApplication Uses

func NewPersistentKVStoreApplication(dbDir string) *PersistentKVStoreApplication

func (*PersistentKVStoreApplication) BeginBlock Uses

func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock

Track the block hash and header information

func (*PersistentKVStoreApplication) CheckTx Uses

func (app *PersistentKVStoreApplication) CheckTx(req types.RequestCheckTx) types.ResponseCheckTx

func (*PersistentKVStoreApplication) Commit Uses

func (app *PersistentKVStoreApplication) Commit() types.ResponseCommit

Commit will panic if InitChain was not called

func (*PersistentKVStoreApplication) DeliverTx Uses

func (app *PersistentKVStoreApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx

tx is either "val:pubkey!power" or "key=value" or just arbitrary bytes

func (*PersistentKVStoreApplication) EndBlock Uses

func (app *PersistentKVStoreApplication) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock

Update the validator set

func (*PersistentKVStoreApplication) Info Uses

func (app *PersistentKVStoreApplication) Info(req types.RequestInfo) types.ResponseInfo

func (*PersistentKVStoreApplication) InitChain Uses

func (app *PersistentKVStoreApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain

Save the validators in the merkle tree

func (*PersistentKVStoreApplication) Query Uses

func (app *PersistentKVStoreApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery)

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 Uses

func (app *PersistentKVStoreApplication) SetLogger(l log.Logger)

func (*PersistentKVStoreApplication) SetOption Uses

func (app *PersistentKVStoreApplication) SetOption(req types.RequestSetOption) types.ResponseSetOption

func (*PersistentKVStoreApplication) Validators Uses

func (app *PersistentKVStoreApplication) Validators() (validators []types.ValidatorUpdate)

type State Uses

type State struct {
    Size    int64  `json:"size"`
    Height  int64  `json:"height"`
    AppHash []byte `json:"app_hash"`
    // contains filtered or unexported fields
}

Package kvstore imports 15 packages (graph) and is imported by 6 packages. Updated 2019-09-14. Refresh now. Tools for package owners.