Documentation ¶
Index ¶
- Constants
- func BuildQueryBinary(args interface{}) (argsBytes []byte, err error)
- func Run(a store.Adapter, config *Config)
- type BatchAdapter
- type Commit
- func (c *Commit) FindSegments(filter *store.SegmentFilter) ([]*cs.Segment, [][]byte, error)
- func (c *Commit) GetMapIDs(filter *store.MapFilter) ([]string, error)
- func (c *Commit) GetSegment(lh *types.Bytes32) (*cs.Segment, []byte, error)
- func (c *Commit) Hash() []byte
- func (c *Commit) Proof(key []byte) ([]byte, []byte, bool)
- func (c *Commit) Size() int
- type Config
- type DBAdapter
- func (a *DBAdapter) Close()
- func (a *DBAdapter) Delete(key []byte)
- func (a *DBAdapter) DeleteSync(key []byte)
- func (a *DBAdapter) Get(key []byte) []byte
- func (a *DBAdapter) Iterator() db.Iterator
- func (a *DBAdapter) NewBatch() db.Batch
- func (a *DBAdapter) Print()
- func (a *DBAdapter) Set(key, value []byte)
- func (a *DBAdapter) SetAdapter(adapter store.Adapter)
- func (a *DBAdapter) SetSync(key, value []byte)
- func (a *DBAdapter) Stats() map[string]string
- type Info
- type Snapshot
- type State
- type TMPop
- func (t *TMPop) BeginBlock(req abci.RequestBeginBlock)
- func (t *TMPop) CheckTx(tx []byte) abci.Result
- func (t *TMPop) Commit() abci.Result
- func (t *TMPop) DeliverTx(tx []byte) abci.Result
- func (t *TMPop) Info(req abci.RequestInfo) abci.ResponseInfo
- func (t *TMPop) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)
- func (t *TMPop) SetOption(key string, value string) (log string)
- type Tx
- type TxType
Constants ¶
const ( GetInfo = "GetInfo" GetSegment = "GetSegment" FindSegments = "FindSegments" GetMapIDs = "GetMapIDs" GetValue = "GetValue" )
Query types.
const ( // Name of the Tendermint Application. Name = "TMPop" // Description of this Tendermint Application. Description = "Agent Store in a Blockchain" // DefaultCacheSize is the default size of the DB cache. DefaultCacheSize = 0 )
const ( // CodeTypeValidation is the ABCI error code for a validation error. CodeTypeValidation abci.CodeType = 400 )
Variables ¶
This section is empty.
Functions ¶
func BuildQueryBinary ¶
BuildQueryBinary outputs the marshalled Query.
Types ¶
type BatchAdapter ¶
type BatchAdapter struct {
// contains filtered or unexported fields
}
BatchAdapter implements github.com/tendermint/tmlibs/db/db.Batch.
func NewBatchAdapter ¶
func NewBatchAdapter(batch store.Batch) *BatchAdapter
NewBatchAdapter returns a new Batch Adapter
func (*BatchAdapter) Delete ¶
func (b *BatchAdapter) Delete(key []byte)
Delete implements github.com/tendermint/tmlibs/db/db.Batch.Delete
func (*BatchAdapter) Set ¶
func (b *BatchAdapter) Set(key, value []byte)
Set implements github.com/tendermint/tmlibs/db/db.Batch.Set
func (*BatchAdapter) Write ¶
func (b *BatchAdapter) Write()
Write implements github.com/tendermint/tmlibs/db/db.Batch.Write
type Commit ¶
type Commit struct {
// contains filtered or unexported fields
}
Commit represents a committed state of the blockchain. It uses a tree to store all linkhashes and have a canonical app for the state of the application. It uses a store for indexed search but all results from the store must be checked within the tree.
func (*Commit) FindSegments ¶
FindSegments emulates github.com/stratumn/sdk/store.Adapter.FindSegments. with additional proofs.
func (*Commit) GetMapIDs ¶
GetMapIDs implements github.com/stratumn/sdk/store.Adapter.GetMapIDs. It might be out of sync with the tree.
func (*Commit) GetSegment ¶
GetSegment emulates github.com/stratumn/sdk/store.Adapter.GetSegments. GetSegment returns a segment and its proof.
type Config ¶
type Config struct { // A version string that will be set in the store's information. Version string // A git commit hash that will be set in the store's information. Commit string // The DB cache size. CacheSize int // JSON schema rules definition ValidatorFilename string }
Config contains configuration options for the App.
type DBAdapter ¶
type DBAdapter struct {
// contains filtered or unexported fields
}
DBAdapter implements github.com/tendermint/tmlibs/db/db.DB.
func NewDBAdapter ¶
NewDBAdapter returns a new DB Adapter
func (*DBAdapter) Close ¶
func (a *DBAdapter) Close()
Close implements github.com/tendermint/tmlibs/db/db.DB.Close
func (*DBAdapter) DeleteSync ¶
DeleteSync implements github.com/tendermint/tmlibs/db/db.DB.DeleteSync
func (*DBAdapter) Iterator ¶
Iterator implements github.com/tendermint/tmlibs/db/db.DB.Iterator. Iterator is for debugging.
func (*DBAdapter) Print ¶
func (a *DBAdapter) Print()
Print implements github.com/tendermint/tmlibs/db/db.DB.Print. Print is for debugging
func (*DBAdapter) SetAdapter ¶
SetAdapter sets a new adapter on the DB
type Info ¶
type Info struct { Name string `json:"name"` Description string `json:"description"` Version string `json:"version"` Commit string `json:"commit"` AdapterInfo interface{} `json:"adapterInfo"` }
Info is the info returned by GetInfo.
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot represents a version of the state.
func (*Snapshot) DeleteSegment ¶
DeleteSegment removes a Segment from the Snapshot.
func (*Snapshot) DeleteValue ¶
DeleteValue removes a value from the Snapshot.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents the app states, separating the commited state (for queries) from the working state (for CheckTx and AppendTx).
func (State) Append ¶
Append returns the version of the state affected by appended transaction from the current block.
func (State) Check ¶
Check returns the version of the state affected by checked transaction from the memory pool.
type TMPop ¶
type TMPop struct { abci.BaseApplication // contains filtered or unexported fields }
TMPop is the type of the application that implements github.com/tendermint/abci/types.Application, the tendermint socket protocol (ABCI).
func (*TMPop) BeginBlock ¶
func (t *TMPop) BeginBlock(req abci.RequestBeginBlock)
BeginBlock implements github.com/tendermint/abci/types.Application.BeginBlock.
func (*TMPop) Commit ¶
Commit implements github.com/tendermint/abci/types.Application.Commit. It actually commits the current state in the Store.
func (*TMPop) DeliverTx ¶
DeliverTx implements github.com/tendermint/abci/types.Application.DeliverTx.
func (*TMPop) Info ¶
func (t *TMPop) Info(req abci.RequestInfo) abci.ResponseInfo
Info implements github.com/tendermint/abci/types.Application.Info.
func (*TMPop) Query ¶
func (t *TMPop) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)
Query implements github.com/tendermint/abci/types.Application.Query.
type Tx ¶
type Tx struct { TxType TxType `json:"type"` Segment *cs.Segment `json:"segment"` LinkHash *types.Bytes32 `json:"linkhash"` Key []byte `json:"key"` Value []byte `json:"value"` }
Tx represents a TMPoP transaction
type TxType ¶
type TxType byte
TxType represents the type of a Transaction (Write Segment/Value, Delete Segment/Value)
const ( // SaveSegment characterizes a transaction that saves a new segment SaveSegment TxType = iota // DeleteSegment characterizes a transaction that deletes a segment DeleteSegment // SaveValue characterizes a transaction that saves a new value SaveValue // DeleteValue characterizes a transaction that deletes a value DeleteValue )