local

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

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) GetBlock

func (bl *BoltLedger) GetBlock(bn int64) (*model.Block, error)

func (*BoltLedger) GetBlockRecords

func (bl *BoltLedger) GetBlockRecords(bn int64) ([][]string, error)

func (*BoltLedger) GetChain

func (bl *BoltLedger) GetChain(startNumber int64, depth int) ([]*model.Block, 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) GetRecord

func (bl *BoltLedger) GetRecord(rid string) (*model.Record, 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 (bl *BoltLedger) SubmitNewBlock(block *model.Block, records []*model.Record) error

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

Jump to

Keyboard shortcuts

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