Documentation
¶
Index ¶
- Constants
- func CreateLedgerConnector(ctx context.Context, params ledger.Parameters, ns notification.Service, ...) (model.Ledger, error)
- func InstallLedgerSchema(bc *utils.BoltClient) error
- type BoltLedger
- func (bl *BoltLedger) ClearPendingRecordsIfExist() error
- func (bl *BoltLedger) Close() error
- func (bl *BoltLedger) CurrentBlockSession() string
- func (bl *BoltLedger) GetAssetHead(ctx context.Context, headID string) (*model.Record, error)
- func (bl *BoltLedger) GetBlock(ctx context.Context, bn uint64) (*model.Block, error)
- func (bl *BoltLedger) GetBlockRecords(ctx context.Context, bn uint64) ([][]string, error)
- func (bl *BoltLedger) GetChain(ctx context.Context, startNumber uint64, depth int) ([]*model.Block, error)
- func (bl *BoltLedger) GetDataAssetState(ctx context.Context, id string) (model.DataAssetState, error)
- func (bl *BoltLedger) GetGenesisBlock(ctx context.Context) (*model.Block, error)
- func (bl *BoltLedger) GetRecord(ctx context.Context, rid string) (*model.Record, error)
- func (bl *BoltLedger) GetRecordState(ctx context.Context, rid string) (*model.RecordState, error)
- func (bl *BoltLedger) GetTopBlock(ctx context.Context) (*model.Block, error)
- func (bl *BoltLedger) ImportBlock(ctx context.Context, blockNumber uint64, records []*model.Record) error
- func (bl *BoltLedger) OpenNewBlockSession() (string, error)
- func (bl *BoltLedger) SaveRecord(r *model.Record) error
- func (bl *BoltLedger) SubmitNewBlock(block *model.Block, records []*model.Record) error
- func (bl *BoltLedger) SubmitRecord(ctx context.Context, r *model.Record) error
- type LocalBlock
Constants ¶
View Source
const ( BlocksKey = "blocks" BlockCompositionsKey = "block_composition" RecordsKey = "records" RecordStatesKey = "record_states" ControlsKey = "controls" UnconfirmedRecordsKey = "unconfirmed_records" DataAssetStatesKey = "data_asset_states" HeadsKey = "heads" TopBlockNumberKey = "top_block_number" CurrentSessionIDKey = "current_session_id" )
Variables ¶
This section is empty.
Functions ¶
func CreateLedgerConnector ¶
func CreateLedgerConnector(ctx context.Context, params ledger.Parameters, ns notification.Service, resolver cmdbase.ParameterResolver) (model.Ledger, error)
func InstallLedgerSchema ¶
func InstallLedgerSchema(bc *utils.BoltClient) error
Types ¶
type BoltLedger ¶
type BoltLedger struct {
// contains filtered or unexported fields
}
func NewBoltLedger ¶
func NewBoltLedger(ctx context.Context, dbFilepath string, ns notification.Service, maxRecordsPerBlock int, blockCheckInterval uint64) (*BoltLedger, error)
func (*BoltLedger) ClearPendingRecordsIfExist ¶ added in v1.3.0
func (bl *BoltLedger) ClearPendingRecordsIfExist() error
func (*BoltLedger) Close ¶
func (bl *BoltLedger) Close() error
func (*BoltLedger) CurrentBlockSession ¶
func (bl *BoltLedger) CurrentBlockSession() string
func (*BoltLedger) GetAssetHead ¶
func (*BoltLedger) GetBlockRecords ¶
func (*BoltLedger) GetDataAssetState ¶
func (bl *BoltLedger) GetDataAssetState(ctx context.Context, id string) (model.DataAssetState, error)
func (*BoltLedger) GetGenesisBlock ¶
func (*BoltLedger) GetRecordState ¶
func (bl *BoltLedger) GetRecordState(ctx context.Context, rid string) (*model.RecordState, error)
func (*BoltLedger) GetTopBlock ¶
func (*BoltLedger) ImportBlock ¶ added in v1.3.0
func (*BoltLedger) OpenNewBlockSession ¶
func (bl *BoltLedger) OpenNewBlockSession() (string, error)
func (*BoltLedger) SaveRecord ¶
func (bl *BoltLedger) SaveRecord(r *model.Record) error
func (*BoltLedger) SubmitNewBlock ¶
func (*BoltLedger) SubmitRecord ¶
type LocalBlock ¶
type LocalBlock struct {
Number uint64 `json:"number"`
Hash string `json:"hash"`
ParentHash string `json:"parentHash,omitempty"`
Nonce string `json:"nonce,omitempty"`
}
func (*LocalBlock) Seal ¶
func (b *LocalBlock) Seal() error
Click to show internal directories.
Click to hide internal directories.