Documentation
¶
Index ¶
Constants ¶
View Source
const ( KiB = 1024 MiB = 1024 * KiB MaxTotalBatchSize = 20 * MiB MaxBlocksBatchSize = 50000 MaxBlockSize = 2 * MiB )
Variables ¶
This section is empty.
Functions ¶
func ApplyFromFile ¶
func ApplyFromFile( ctx context.Context, params ImportParams, state State, nBlocks, startHeight uint64, ) error
ApplyFromFile reads blocks from blockchainPath, applying them from height startHeight and until nBlocks+1. Setting optimize to true speeds up the import, but it is only safe when importing blockchain from scratch when no rollbacks are possible at all.
func CheckBalances ¶
Types ¶
type BlocksImporter ¶ added in v0.11.0
type BlocksImporter struct {
// contains filtered or unexported fields
}
func NewBlocksImporter ¶ added in v0.11.0
func (*BlocksImporter) Close ¶ added in v0.11.0
func (imp *BlocksImporter) Close() error
func (*BlocksImporter) Import ¶ added in v0.11.0
func (imp *BlocksImporter) Import(ctx context.Context, number uint64) error
func (*BlocksImporter) SkipToHeight ¶ added in v0.11.0
type ImportParams ¶ added in v0.11.0
type SnapshotsImporter ¶ added in v0.11.0
type SnapshotsImporter struct {
// contains filtered or unexported fields
}
func NewSnapshotsImporter ¶ added in v0.11.0
func (*SnapshotsImporter) Close ¶ added in v0.11.0
func (imp *SnapshotsImporter) Close() error
func (*SnapshotsImporter) Import ¶ added in v0.11.0
func (imp *SnapshotsImporter) Import(ctx context.Context, number uint64) error
func (*SnapshotsImporter) SkipToHeight ¶ added in v0.11.0
type State ¶
type State interface {
AddBlocks(blocks [][]byte) error
AddBlocksWithSnapshots(blocks [][]byte, snapshots []*proto.BlockSnapshot) error
WavesAddressesNumber() (uint64, error)
WavesBalance(account proto.Recipient) (uint64, error)
AssetBalance(account proto.Recipient, assetID proto.AssetID) (uint64, error)
ShouldPersistAddressTransactions() (bool, error)
PersistAddressTransactions() error
}
Click to show internal directories.
Click to hide internal directories.