Documentation
¶
Index ¶
- Constants
- Variables
- type GrpcMptKV
- func (g *GrpcMptKV) Commit(context.Context, *emptypb.Empty) (*goproto.TxnHashResponse, error)
- func (g *GrpcMptKV) Delete(_ context.Context, key *goproto.Key) (*emptypb.Empty, error)
- func (g *GrpcMptKV) Discard(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (g *GrpcMptKV) DiscardAll(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (g *GrpcMptKV) Exist(_ context.Context, key *goproto.Key) (*goproto.Bool, error)
- func (g *GrpcMptKV) Get(_ context.Context, key *goproto.Key) (*goproto.ValueResponse, error)
- func (g *GrpcMptKV) GetByBlockHash(_ context.Context, hash *goproto.KeyByHash) (*goproto.ValueResponse, error)
- func (g *GrpcMptKV) GetFinalized(_ context.Context, key *goproto.Key) (*goproto.ValueResponse, error)
- func (g *GrpcMptKV) NextTxn(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (g *GrpcMptKV) Set(_ context.Context, keyValue *goproto.KeyValue) (*emptypb.Empty, error)
- func (g *GrpcMptKV) StartBlock(_ context.Context, hash *goproto.TxnHash) (*emptypb.Empty, error)
- type IState
- type KvStash
- type NameString
- type Ops
- type SpmtKV
- func (skv *SpmtKV) Commit() ([]byte, error)
- func (skv *SpmtKV) Delete(triName NameString, key []byte)
- func (skv *SpmtKV) Discard()
- func (skv *SpmtKV) DiscardAll()
- func (skv *SpmtKV) Exist(triName NameString, key []byte) bool
- func (skv *SpmtKV) FinalizeBlock(blockHash Hash)
- func (skv *SpmtKV) Get(triName NameString, key []byte) ([]byte, error)
- func (skv *SpmtKV) GetByBlockHash(triName NameString, key []byte, blockHash Hash) ([]byte, error)
- func (skv *SpmtKV) GetFinalized(triName NameString, key []byte) ([]byte, error)
- func (skv *SpmtKV) NextTxn()
- func (skv *SpmtKV) Set(triName NameString, key, value []byte)
- func (skv *SpmtKV) StartBlock(blockHash Hash)
- type TxnStashes
Constants ¶
View Source
const ( SpmtIndex = "spmt-index" Nodes = "spmt-nodes" Values = "spmt-values" )
View Source
const ( SetOp = iota DeleteOp )
Variables ¶
View Source
var (
EmptyRoot = HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
)
Functions ¶
This section is empty.
Types ¶
type GrpcMptKV ¶
type GrpcMptKV struct {
// contains filtered or unexported fields
}
func NewGrpcMptKV ¶
func (*GrpcMptKV) DiscardAll ¶
func (*GrpcMptKV) GetByBlockHash ¶
func (*GrpcMptKV) GetFinalized ¶
type IState ¶
type IState interface {
Set(triName NameString, key, value []byte)
Delete(triName NameString, key []byte)
Get(triName NameString, key []byte) ([]byte, error)
GetFinalized(triName NameString, key []byte) ([]byte, error)
Exist(triName NameString, key []byte) bool
GetByBlockHash(triName NameString, key []byte, blockHash Hash) ([]byte, error)
Commit() ([]byte, error)
NextTxn()
Discard()
DiscardAll()
StartBlock(blockHash Hash)
FinalizeBlock(blockHash Hash)
}
TODO: need to add prove() and verify()
func NewStateDB ¶
type NameString ¶
type NameString interface {
Name() string
}
type SpmtKV ¶
type SpmtKV struct {
// contains filtered or unexported fields
}
func (*SpmtKV) Delete ¶
func (skv *SpmtKV) Delete(triName NameString, key []byte)
func (*SpmtKV) DiscardAll ¶
func (skv *SpmtKV) DiscardAll()
func (*SpmtKV) FinalizeBlock ¶
func (skv *SpmtKV) FinalizeBlock(blockHash Hash)
func (*SpmtKV) GetByBlockHash ¶
func (skv *SpmtKV) GetByBlockHash(triName NameString, key []byte, blockHash Hash) ([]byte, error)
FIXME
func (*SpmtKV) GetFinalized ¶
func (skv *SpmtKV) GetFinalized(triName NameString, key []byte) ([]byte, error)
func (*SpmtKV) Set ¶
func (skv *SpmtKV) Set(triName NameString, key, value []byte)
func (*SpmtKV) StartBlock ¶
func (skv *SpmtKV) StartBlock(blockHash Hash)
type TxnStashes ¶
type TxnStashes struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.