store

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthQueryResult        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQueryResult          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQueryResult = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthStore        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStore          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupStore = fmt.Errorf("proto: unexpected end of group")
)
View Source
var DataStoreType_name = map[int32]string{
	0: "FILE_STORE",
	1: "SQL_STORE",
	2: "COS",
}
View Source
var DataStoreType_value = map[string]int32{
	"FILE_STORE": 0,
	"SQL_STORE":  1,
	"COS":        2,
}
View Source
var DbType_name = map[int32]string{
	0: "INVALID_DB",
	1: "BLOCK_DB",
	2: "BLOCK_INDEX_DB",
	3: "TX_DB",
	4: "TX_INDEX_DB",
	5: "SOFT_DB",
	6: "STATE_DB",
	7: "READ_WRITE_DB",
}
View Source
var DbType_value = map[string]int32{
	"INVALID_DB":     0,
	"BLOCK_DB":       1,
	"BLOCK_INDEX_DB": 2,
	"TX_DB":          3,
	"TX_INDEX_DB":    4,
	"SOFT_DB":        5,
	"STATE_DB":       6,
	"READ_WRITE_DB":  7,
}

Functions

This section is empty.

Types

type BlockWithRWSet

type BlockWithRWSet struct {
	// block data
	Block *common.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"`
	// transaction read/write set of blocks
	TxRWSets []*common.TxRWSet `protobuf:"bytes,2,rep,name=txRWSets,proto3" json:"txRWSets,omitempty"`
	// contract event info
	ContractEvents []*common.ContractEvent `protobuf:"bytes,3,rep,name=contract_events,json=contractEvents,proto3" json:"contract_events,omitempty"`
}

Block and its read/write set information

func (*BlockWithRWSet) Descriptor

func (*BlockWithRWSet) Descriptor() ([]byte, []int)

func (*BlockWithRWSet) GetBlock

func (m *BlockWithRWSet) GetBlock() *common.Block

func (*BlockWithRWSet) GetContractEvents

func (m *BlockWithRWSet) GetContractEvents() []*common.ContractEvent

func (*BlockWithRWSet) GetTxRWSets

func (m *BlockWithRWSet) GetTxRWSets() []*common.TxRWSet

func (*BlockWithRWSet) Marshal

func (m *BlockWithRWSet) Marshal() (dAtA []byte, err error)

func (*BlockWithRWSet) MarshalTo

func (m *BlockWithRWSet) MarshalTo(dAtA []byte) (int, error)

func (*BlockWithRWSet) MarshalToSizedBuffer

func (m *BlockWithRWSet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BlockWithRWSet) ProtoMessage

func (*BlockWithRWSet) ProtoMessage()

func (*BlockWithRWSet) Reset

func (m *BlockWithRWSet) Reset()

func (*BlockWithRWSet) Size

func (m *BlockWithRWSet) Size() (n int)

func (*BlockWithRWSet) String

func (m *BlockWithRWSet) String() string

func (*BlockWithRWSet) Unmarshal

func (m *BlockWithRWSet) Unmarshal(dAtA []byte) error

func (*BlockWithRWSet) XXX_DiscardUnknown

func (m *BlockWithRWSet) XXX_DiscardUnknown()

func (*BlockWithRWSet) XXX_Marshal

func (m *BlockWithRWSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockWithRWSet) XXX_Merge

func (m *BlockWithRWSet) XXX_Merge(src proto.Message)

func (*BlockWithRWSet) XXX_Size

func (m *BlockWithRWSet) XXX_Size() int

func (*BlockWithRWSet) XXX_Unmarshal

func (m *BlockWithRWSet) XXX_Unmarshal(b []byte) error

type DataStoreType

type DataStoreType int32
const (
	// 文件系统存储
	DataStoreType_FILE_STORE DataStoreType = 0
	//SQL数据库存储
	DataStoreType_SQL_STORE DataStoreType = 1
	//云对象存储
	DataStoreType_COS DataStoreType = 2
)

func (DataStoreType) EnumDescriptor

func (DataStoreType) EnumDescriptor() ([]byte, []int)

func (DataStoreType) String

func (x DataStoreType) String() string

type DbType

type DbType int32
const (
	DbType_INVALID_DB     DbType = 0
	DbType_BLOCK_DB       DbType = 1
	DbType_BLOCK_INDEX_DB DbType = 2
	DbType_TX_DB          DbType = 3
	DbType_TX_INDEX_DB    DbType = 4
	DbType_SOFT_DB        DbType = 5
	DbType_STATE_DB       DbType = 6
	DbType_READ_WRITE_DB  DbType = 7
)

func (DbType) EnumDescriptor

func (DbType) EnumDescriptor() ([]byte, []int)

func (DbType) String

func (x DbType) String() string

type KV

type KV struct {
	ContractName string `protobuf:"bytes,1,opt,name=contract_name,json=contractName,proto3" json:"contract_name,omitempty"`
	Key          []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Value        []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
}

func (*KV) Descriptor

func (*KV) Descriptor() ([]byte, []int)

func (*KV) GetContractName

func (m *KV) GetContractName() string

func (*KV) GetKey

func (m *KV) GetKey() []byte

func (*KV) GetValue

func (m *KV) GetValue() []byte

func (*KV) Marshal

func (m *KV) Marshal() (dAtA []byte, err error)

func (*KV) MarshalTo

func (m *KV) MarshalTo(dAtA []byte) (int, error)

func (*KV) MarshalToSizedBuffer

func (m *KV) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*KV) ProtoMessage

func (*KV) ProtoMessage()

func (*KV) Reset

func (m *KV) Reset()

func (*KV) Size

func (m *KV) Size() (n int)

func (*KV) String

func (m *KV) String() string

func (*KV) Unmarshal

func (m *KV) Unmarshal(dAtA []byte) error

func (*KV) XXX_DiscardUnknown

func (m *KV) XXX_DiscardUnknown()

func (*KV) XXX_Marshal

func (m *KV) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KV) XXX_Merge

func (m *KV) XXX_Merge(src proto.Message)

func (*KV) XXX_Size

func (m *KV) XXX_Size() int

func (*KV) XXX_Unmarshal

func (m *KV) XXX_Unmarshal(b []byte) error

type KeyModification

type KeyModification struct {
	TxId        string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"`
	Value       []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Timestamp   int64  `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	IsDelete    bool   `protobuf:"varint,4,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"`
	BlockHeight uint64 `protobuf:"varint,5,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
}

KeyModification -- QueryResult for history db query. Holds a transaction ID, value, timestamp, and delete marker which resulted from a history query.

func (*KeyModification) Descriptor

func (*KeyModification) Descriptor() ([]byte, []int)

func (*KeyModification) GetBlockHeight

func (m *KeyModification) GetBlockHeight() uint64

func (*KeyModification) GetIsDelete

func (m *KeyModification) GetIsDelete() bool

func (*KeyModification) GetTimestamp

func (m *KeyModification) GetTimestamp() int64

func (*KeyModification) GetTxId

func (m *KeyModification) GetTxId() string

func (*KeyModification) GetValue

func (m *KeyModification) GetValue() []byte

func (*KeyModification) Marshal

func (m *KeyModification) Marshal() (dAtA []byte, err error)

func (*KeyModification) MarshalTo

func (m *KeyModification) MarshalTo(dAtA []byte) (int, error)

func (*KeyModification) MarshalToSizedBuffer

func (m *KeyModification) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*KeyModification) ProtoMessage

func (*KeyModification) ProtoMessage()

func (*KeyModification) Reset

func (m *KeyModification) Reset()

func (*KeyModification) Size

func (m *KeyModification) Size() (n int)

func (*KeyModification) String

func (m *KeyModification) String() string

func (*KeyModification) Unmarshal

func (m *KeyModification) Unmarshal(dAtA []byte) error

func (*KeyModification) XXX_DiscardUnknown

func (m *KeyModification) XXX_DiscardUnknown()

func (*KeyModification) XXX_Marshal

func (m *KeyModification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KeyModification) XXX_Merge

func (m *KeyModification) XXX_Merge(src proto.Message)

func (*KeyModification) XXX_Size

func (m *KeyModification) XXX_Size() int

func (*KeyModification) XXX_Unmarshal

func (m *KeyModification) XXX_Unmarshal(b []byte) error

type SerializedBlock

type SerializedBlock struct {
	// header of block
	Header *common.BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// transaction execution sequence of the block, described by DAG
	Dag *common.DAG `protobuf:"bytes,2,opt,name=dag,proto3" json:"dag,omitempty"`
	// transaction id list within the block
	TxIds []string `protobuf:"bytes,3,rep,name=tx_ids,json=txIds,proto3" json:"tx_ids,omitempty"`
	// block additional data, not included in block hash calculation
	AdditionalData *common.AdditionalData `protobuf:"bytes,4,opt,name=additional_data,json=additionalData,proto3" json:"additional_data,omitempty"`
}

block structure used in serialization

func (*SerializedBlock) Descriptor

func (*SerializedBlock) Descriptor() ([]byte, []int)

func (*SerializedBlock) GetAdditionalData

func (m *SerializedBlock) GetAdditionalData() *common.AdditionalData

func (*SerializedBlock) GetDag

func (m *SerializedBlock) GetDag() *common.DAG

func (*SerializedBlock) GetHeader

func (m *SerializedBlock) GetHeader() *common.BlockHeader

func (*SerializedBlock) GetTxIds

func (m *SerializedBlock) GetTxIds() []string

func (*SerializedBlock) Marshal

func (m *SerializedBlock) Marshal() (dAtA []byte, err error)

func (*SerializedBlock) MarshalTo

func (m *SerializedBlock) MarshalTo(dAtA []byte) (int, error)

func (*SerializedBlock) MarshalToSizedBuffer

func (m *SerializedBlock) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SerializedBlock) ProtoMessage

func (*SerializedBlock) ProtoMessage()

func (*SerializedBlock) Reset

func (m *SerializedBlock) Reset()

func (*SerializedBlock) Size

func (m *SerializedBlock) Size() (n int)

func (*SerializedBlock) String

func (m *SerializedBlock) String() string

func (*SerializedBlock) Unmarshal

func (m *SerializedBlock) Unmarshal(dAtA []byte) error

func (*SerializedBlock) XXX_DiscardUnknown

func (m *SerializedBlock) XXX_DiscardUnknown()

func (*SerializedBlock) XXX_Marshal

func (m *SerializedBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SerializedBlock) XXX_Merge

func (m *SerializedBlock) XXX_Merge(src proto.Message)

func (*SerializedBlock) XXX_Size

func (m *SerializedBlock) XXX_Size() int

func (*SerializedBlock) XXX_Unmarshal

func (m *SerializedBlock) XXX_Unmarshal(b []byte) error

type StoreInfo

type StoreInfo struct {
	//store type
	StoreType DataStoreType `protobuf:"varint,1,opt,name=store_type,json=storeType,proto3,enum=store.DataStoreType" json:"store_type,omitempty"`
	// file name
	FileName string `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
	// offset in file
	Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	// data length
	ByteLen uint64 `protobuf:"varint,4,opt,name=byte_len,json=byteLen,proto3" json:"byte_len,omitempty"`
}

store data information

func (*StoreInfo) Descriptor

func (*StoreInfo) Descriptor() ([]byte, []int)

func (*StoreInfo) GetByteLen

func (m *StoreInfo) GetByteLen() uint64

func (*StoreInfo) GetFileName

func (m *StoreInfo) GetFileName() string

func (*StoreInfo) GetOffset

func (m *StoreInfo) GetOffset() uint64

func (*StoreInfo) GetStoreType

func (m *StoreInfo) GetStoreType() DataStoreType

func (*StoreInfo) Marshal

func (m *StoreInfo) Marshal() (dAtA []byte, err error)

func (*StoreInfo) MarshalTo

func (m *StoreInfo) MarshalTo(dAtA []byte) (int, error)

func (*StoreInfo) MarshalToSizedBuffer

func (m *StoreInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StoreInfo) ProtoMessage

func (*StoreInfo) ProtoMessage()

func (*StoreInfo) Reset

func (m *StoreInfo) Reset()

func (*StoreInfo) Size

func (m *StoreInfo) Size() (n int)

func (*StoreInfo) String

func (m *StoreInfo) String() string

func (*StoreInfo) Unmarshal

func (m *StoreInfo) Unmarshal(dAtA []byte) error

func (*StoreInfo) XXX_DiscardUnknown

func (m *StoreInfo) XXX_DiscardUnknown()

func (*StoreInfo) XXX_Marshal

func (m *StoreInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StoreInfo) XXX_Merge

func (m *StoreInfo) XXX_Merge(src proto.Message)

func (*StoreInfo) XXX_Size

func (m *StoreInfo) XXX_Size() int

func (*StoreInfo) XXX_Unmarshal

func (m *StoreInfo) XXX_Unmarshal(b []byte) error

type TransactionStoreInfo

type TransactionStoreInfo struct {
	// transaction raw data
	Transaction *common.Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"`
	// block height
	BlockHeight uint64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	// Deprecated, block hash
	BlockHash []byte `protobuf:"bytes,3,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`
	// transaction index in block
	TxIndex uint32 `protobuf:"varint,4,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"`
	// block header timestamp
	BlockTimestamp int64 `protobuf:"varint,5,opt,name=block_timestamp,json=blockTimestamp,proto3" json:"block_timestamp,omitempty"`
	// transaction offset index in file
	TransactionStoreInfo *StoreInfo `protobuf:"bytes,6,opt,name=transaction_store_info,json=transactionStoreInfo,proto3" json:"transaction_store_info,omitempty"`
}

transaction info include transaction and its block height hash and tx index

func (*TransactionStoreInfo) Descriptor

func (*TransactionStoreInfo) Descriptor() ([]byte, []int)

func (*TransactionStoreInfo) GetBlockHash

func (m *TransactionStoreInfo) GetBlockHash() []byte

func (*TransactionStoreInfo) GetBlockHeight

func (m *TransactionStoreInfo) GetBlockHeight() uint64

func (*TransactionStoreInfo) GetBlockTimestamp

func (m *TransactionStoreInfo) GetBlockTimestamp() int64

func (*TransactionStoreInfo) GetTransaction

func (m *TransactionStoreInfo) GetTransaction() *common.Transaction

func (*TransactionStoreInfo) GetTransactionStoreInfo

func (m *TransactionStoreInfo) GetTransactionStoreInfo() *StoreInfo

func (*TransactionStoreInfo) GetTxIndex

func (m *TransactionStoreInfo) GetTxIndex() uint32

func (*TransactionStoreInfo) Marshal

func (m *TransactionStoreInfo) Marshal() (dAtA []byte, err error)

func (*TransactionStoreInfo) MarshalTo

func (m *TransactionStoreInfo) MarshalTo(dAtA []byte) (int, error)

func (*TransactionStoreInfo) MarshalToSizedBuffer

func (m *TransactionStoreInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TransactionStoreInfo) ProtoMessage

func (*TransactionStoreInfo) ProtoMessage()

func (*TransactionStoreInfo) Reset

func (m *TransactionStoreInfo) Reset()

func (*TransactionStoreInfo) Size

func (m *TransactionStoreInfo) Size() (n int)

func (*TransactionStoreInfo) String

func (m *TransactionStoreInfo) String() string

func (*TransactionStoreInfo) Unmarshal

func (m *TransactionStoreInfo) Unmarshal(dAtA []byte) error

func (*TransactionStoreInfo) XXX_DiscardUnknown

func (m *TransactionStoreInfo) XXX_DiscardUnknown()

func (*TransactionStoreInfo) XXX_Marshal

func (m *TransactionStoreInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TransactionStoreInfo) XXX_Merge

func (m *TransactionStoreInfo) XXX_Merge(src proto.Message)

func (*TransactionStoreInfo) XXX_Size

func (m *TransactionStoreInfo) XXX_Size() int

func (*TransactionStoreInfo) XXX_Unmarshal

func (m *TransactionStoreInfo) XXX_Unmarshal(b []byte) error

type TxHistory

type TxHistory struct {
	TxId        string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"`
	BlockHeight uint64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	BlockHash   []byte `protobuf:"bytes,3,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`
	Timestamp   int64  `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
}

func (*TxHistory) Descriptor

func (*TxHistory) Descriptor() ([]byte, []int)

func (*TxHistory) GetBlockHash

func (m *TxHistory) GetBlockHash() []byte

func (*TxHistory) GetBlockHeight

func (m *TxHistory) GetBlockHeight() uint64

func (*TxHistory) GetTimestamp

func (m *TxHistory) GetTimestamp() int64

func (*TxHistory) GetTxId

func (m *TxHistory) GetTxId() string

func (*TxHistory) Marshal

func (m *TxHistory) Marshal() (dAtA []byte, err error)

func (*TxHistory) MarshalTo

func (m *TxHistory) MarshalTo(dAtA []byte) (int, error)

func (*TxHistory) MarshalToSizedBuffer

func (m *TxHistory) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxHistory) ProtoMessage

func (*TxHistory) ProtoMessage()

func (*TxHistory) Reset

func (m *TxHistory) Reset()

func (*TxHistory) Size

func (m *TxHistory) Size() (n int)

func (*TxHistory) String

func (m *TxHistory) String() string

func (*TxHistory) Unmarshal

func (m *TxHistory) Unmarshal(dAtA []byte) error

func (*TxHistory) XXX_DiscardUnknown

func (m *TxHistory) XXX_DiscardUnknown()

func (*TxHistory) XXX_Marshal

func (m *TxHistory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxHistory) XXX_Merge

func (m *TxHistory) XXX_Merge(src proto.Message)

func (*TxHistory) XXX_Size

func (m *TxHistory) XXX_Size() int

func (*TxHistory) XXX_Unmarshal

func (m *TxHistory) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL