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
Click to show internal directories.
Click to hide internal directories.