l4baseline

command
v2.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

l4baseline converts a mainnet trie.db (BoltDB) into an IOSWSNAP baseline snapshot for L4 agent state sync.

The trie.db contains all IoTeX blockchain state in BoltDB buckets:

  • "Account": account states (protobuf-serialized), key = hash160(addr)
  • "Code": contract bytecode, key = codeHash
  • "Contract": Merkle Patricia Trie nodes for contract storage

The IOSWSNAP format is a gzip-compressed binary with SHA-256 integrity:

header: magic(8) + version(4) + height(8)
entries: [marker(1) + ns_len(1) + ns + key_len(4) + key + val_len(4) + val]*
end: marker(1, 0x00)
trailer: count(8) + sha256(32) + end_magic(8)

Usage:

# Inspect trie.db (stats only, fast)
go run ./ioswarm/cmd/l4baseline --source trie.db --stats

# Export full baseline snapshot
go run ./ioswarm/cmd/l4baseline --source trie.db --output baseline.snap.gz

# Export only Account bucket (skip Contract trie nodes to save space)
go run ./ioswarm/cmd/l4baseline --source trie.db --output baseline.snap.gz --namespaces Account,Code

Jump to

Keyboard shortcuts

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