local

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 22 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(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 (bl *BoltLedger) GetAssetHead(ctx context.Context, headID string) (*model.Record, error)

func (*BoltLedger) GetBlock

func (bl *BoltLedger) GetBlock(ctx context.Context, bn uint64) (*model.Block, error)

func (*BoltLedger) GetBlockRecords

func (bl *BoltLedger) GetBlockRecords(ctx context.Context, bn uint64) ([][]string, error)

func (*BoltLedger) GetChain

func (bl *BoltLedger) GetChain(ctx context.Context, startNumber uint64, depth int) ([]*model.Block, error)

func (*BoltLedger) GetDataAssetState

func (bl *BoltLedger) GetDataAssetState(ctx context.Context, id string) (model.DataAssetState, error)

func (*BoltLedger) GetGenesisBlock

func (bl *BoltLedger) GetGenesisBlock(ctx context.Context) (*model.Block, error)

func (*BoltLedger) GetRecord

func (bl *BoltLedger) GetRecord(ctx context.Context, rid string) (*model.Record, error)

func (*BoltLedger) GetRecordState

func (bl *BoltLedger) GetRecordState(ctx context.Context, rid string) (*model.RecordState, error)

func (*BoltLedger) GetTopBlock

func (bl *BoltLedger) GetTopBlock(ctx context.Context) (*model.Block, error)

func (*BoltLedger) ImportBlock added in v1.3.0

func (bl *BoltLedger) ImportBlock(ctx context.Context, blockNumber uint64, records []*model.Record) 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(ctx context.Context, r *model.Record) error

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

Jump to

Keyboard shortcuts

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