Tool for inserting the entire state and storage tries into PG-IPFS
Go to file
2022-07-01 14:52:11 +05:30
.github/workflows Add command to take an in-place snapshot (#42) 2022-06-15 12:51:26 +05:30
cmd Add command to take an in-place snapshot (#42) 2022-06-15 12:51:26 +05:30
db/migrations remove diff unique constraint 2020-08-06 14:33:02 -05:00
environments Add command to take an in-place snapshot (#42) 2022-06-15 12:51:26 +05:30
fixture Add command to take an in-place snapshot (#42) 2022-06-15 12:51:26 +05:30
pkg config and env updates 2022-07-01 14:52:11 +05:30
test Add command to take an in-place snapshot (#42) 2022-06-15 12:51:26 +05:30
.gitignore Add command to take an in-place snapshot (#42) 2022-06-15 12:51:26 +05:30
docker-compose.yml Add command to take an in-place snapshot (#42) 2022-06-15 12:51:26 +05:30
go.mod Merge changes to fix iterator and update 2022-06-10 14:12:34 +05:30
go.sum Merge changes to fix iterator and update 2022-06-10 14:12:34 +05:30
LICENSE cobra init 2020-06-30 11:53:18 -05:00
main.go add some logs and guards, update module name, update readme 2022-03-30 18:57:30 -05:00
Makefile Add command to take an in-place snapshot (#42) 2022-06-15 12:51:26 +05:30
README.md Add command to take an in-place snapshot (#42) 2022-06-15 12:51:26 +05:30

ipld-eth-state-snapshot

Tool for extracting the entire Ethereum state at a particular block height from leveldb into Postgres-backed IPFS

Go Report Card

Usage

For state snapshot from LevelDB

./ipld-eth-state-snapshot stateSnapshot --config={path to toml config file}

For in-place snapshot in database

./ipld-eth-state-snapshot inPlaceStateSnapshot --config={path to toml config file}

Config

Config format:

[snapshot]
    mode = "file" # indicates output mode ("postgres" or "file")
    workers = 4 # degree of concurrency, the state trie is subdivided into sectiosn that are traversed and processed concurrently
    blockHeight = -1 # blockheight to perform the snapshot at (-1 indicates to use the latest blockheight found in leveldb)
    recoveryFile = "recovery_file" # specifies a file to output recovery information on error or premature closure

[leveldb]
    path = "/Users/user/Library/Ethereum/geth/chaindata" # path to geth leveldb
    ancient = "/Users/user/Library/Ethereum/geth/chaindata/ancient" # path to geth ancient database

[database]
    name     = "vulcanize_public" # postgres database name
    hostname = "localhost" # postgres host
    port     = 5432 # postgres port
    user     = "postgres" # postgres user
    password = "" # postgres password

[file]
    outputDir = "output_dir/" # when operating in 'file' output mode, this is the directory the files are written to

[log]
    level = "info" # log level (trace, debug, info, warn, error, fatal, panic) (default: info)
    file = "log_file" # file path for logging

[prom]
    metrics = true # enable prometheus metrics (default: false)
    http = true # enable prometheus http service (default: false)
    httpAddr = "0.0.0.0" # prometheus http host (default: 127.0.0.1)
    httpPort = 9101 # prometheus http port (default: 8086)
    dbStats = true # enable prometheus db stats (default: false)

# node info
[ethereum]
    clientName = "Geth" # $ETH_CLIENT_NAME
    nodeID = "arch1" # $ETH_NODE_ID
    networkID = "1" # $ETH_NETWORK_ID
    chainID = "1" # $ETH_CHAIN_ID
    genesisBlock = "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3" # $ETH_GENESIS_BLOCK

Tests