store

package
v0.0.0-...-4619e39 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

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 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,
}
View Source
var DataStoreType_name = map[int32]string{
	0: "FILE_STORE",
	1: "SQL_STORE",
	3: "MINIO",
}
View Source
var DataStoreType_value = map[string]int32{
	"FILE_STORE": 0,
	"SQL_STORE":  1,
	"MINIO":      3,
}

Functions

This section is empty.

Types

type BlockWithRWSet

type BlockWithRWSet struct {
	// 块数据
	Block *common.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"`
	// 事务读/写块集
	TxRWSets []*common.TxRWSet `protobuf:"bytes,2,rep,name=txRWSets,proto3" json:"txRWSets,omitempty"`
	// 合约事件信息
	ContractEvents []*common.ContractEvent `protobuf:"bytes,3,rep,name=contract_events,json=contractEvents,proto3" json:"contract_events,omitempty"`
}

Block及其读/写集信息

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 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 DataStoreType

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

func (DataStoreType) EnumDescriptor

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

func (DataStoreType) String

func (x DataStoreType) 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。 保存历史查询产生的交易 ID、价值、时间戳和删除标记。

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 *common.BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// 区块的交易执行顺序,由 DAG 描述
	Dag *common.DAG `protobuf:"bytes,2,opt,name=dag,proto3" json:"dag,omitempty"`
	// 区块内的交易id列表
	TxIds []string `protobuf:"bytes,3,rep,name=tx_ids,json=txIds,proto3" json:"tx_ids,omitempty"`
	// 区块附加数据,不包含在区块哈希计算中
	AdditionalData *common.AdditionalData `protobuf:"bytes,4,opt,name=additional_data,json=additionalData,proto3" json:"additional_data,omitempty"`
}

序列化中使用的块结构

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 {
	// 存储类型
	StoreType DataStoreType `protobuf:"varint,1,opt,name=store_type,json=storeType,proto3,enum=store.DataStoreType" json:"store_type,omitempty"`
	// 文件名称
	FileName string `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
	// 文件中的偏移量
	Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	// 数据长度
	ByteLen uint64 `protobuf:"varint,4,opt,name=byte_len,json=byteLen,proto3" json:"byte_len,omitempty"`
}

存储数据信息

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 *common.Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,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"`
	// 区块中的交易索引
	TxIndex uint32 `protobuf:"varint,4,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"`
	// 区块头时间戳
	BlockTimestamp int64 `protobuf:"varint,5,opt,name=block_timestamp,json=blockTimestamp,proto3" json:"block_timestamp,omitempty"`
	// 文件中的事务偏移索引
	TransactionStoreInfo *StoreInfo `protobuf:"bytes,6,opt,name=transaction_store_info,json=transactionStoreInfo,proto3" json:"transaction_store_info,omitempty"`
}

交易信息包括交易及其区块高度哈希和交易索引

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