Documentation ¶
Index ¶
- Constants
- func CreateLedgerConnector(params ledger.Parameters, ns notification.Service, ...) (model.Ledger, error)
- func InstallLedgerSchema(bc *utils.BoltClient) error
- type BoltLedger
- func (bl *BoltLedger) Close() error
- func (bl *BoltLedger) CurrentBlockSession() string
- func (bl *BoltLedger) GetAssetHead(headID string) (*model.Record, error)
- func (bl *BoltLedger) GetBlock(bn int64) (*model.Block, error)
- func (bl *BoltLedger) GetBlockRecords(bn int64) ([][]string, error)
- func (bl *BoltLedger) GetChain(startNumber int64, depth int) ([]*model.Block, error)
- func (bl *BoltLedger) GetDataAssetState(id string) (model.DataAssetState, error)
- func (bl *BoltLedger) GetGenesisBlock() (*model.Block, error)
- func (bl *BoltLedger) GetRecord(rid string) (*model.Record, error)
- func (bl *BoltLedger) GetRecordState(rid string) (*model.RecordState, error)
- func (bl *BoltLedger) GetTopBlock() (*model.Block, 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(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(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(dbFilepath string, ns notification.Service, maxRecordsPerBlock int, blockCheckInterval uint64) (*BoltLedger, error)
func (*BoltLedger) Close ¶
func (bl *BoltLedger) Close() error
func (*BoltLedger) CurrentBlockSession ¶
func (bl *BoltLedger) CurrentBlockSession() string
func (*BoltLedger) GetAssetHead ¶
func (bl *BoltLedger) GetAssetHead(headID string) (*model.Record, error)
func (*BoltLedger) GetBlockRecords ¶
func (bl *BoltLedger) GetBlockRecords(bn int64) ([][]string, error)
func (*BoltLedger) GetDataAssetState ¶
func (bl *BoltLedger) GetDataAssetState(id string) (model.DataAssetState, error)
func (*BoltLedger) GetGenesisBlock ¶
func (bl *BoltLedger) GetGenesisBlock() (*model.Block, error)
func (*BoltLedger) GetRecordState ¶
func (bl *BoltLedger) GetRecordState(rid string) (*model.RecordState, error)
func (*BoltLedger) GetTopBlock ¶
func (bl *BoltLedger) GetTopBlock() (*model.Block, error)
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 ¶
func (bl *BoltLedger) SubmitRecord(r *model.Record) error
type LocalBlock ¶
type LocalBlock struct { Number int64 `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.