Parallelizable statediffing process that extracts from an offline levelDB
Go to file
2021-11-22 13:55:29 -06:00
.github/workflows github actions integration 2020-11-09 12:15:50 -06:00
cmd fix cli 2021-11-22 13:55:29 -06:00
environments update to new version of go-ethereum; minor README update 2021-11-20 14:49:36 -06:00
monitoring Add grafana dashboard. 2021-11-01 19:39:00 +05:30
pkg update to use new version of indexer; support file writing mode 2021-11-18 18:47:28 -06:00
.gitignore go mod 2020-08-19 01:13:48 -05:00
docker-compose.yml bump Go version to 1.16 2021-11-08 19:05:35 -06:00
Dockerfile bump Go version to 1.16 2021-11-08 19:05:35 -06:00
go.mod update to new version of go-ethereum; minor README update 2021-11-20 14:49:36 -06:00
go.sum update to new version of go-ethereum; minor README update 2021-11-20 14:49:36 -06:00
LICENSE cobra init 2020-08-18 23:27:37 -05:00
main.go cobra init 2020-08-18 23:27:37 -05:00
Makefile Makefile 2020-11-09 12:19:31 -06:00
README.md update to new version of go-ethereum; minor README update 2021-11-20 14:49:36 -06:00
startup_script.sh make startup_script.sh executable 2021-10-27 20:46:25 -04:00

eth-statediff-service

Go Report Card

standalone statediffing service ontop of leveldb

Purpose:

Stand up a statediffing service directly on top of a go-ethereum leveldb instance. This service can serve historical state data over the same rpc interface as statediffing geth without needing to run a full node

Usage

serve

To serve state diffs over RPC:

eth-statediff-service serve --config=<config path>

Available RPC methods are:

  • statediff_stateTrieAt()
  • statediff_streamCodeAndCodeHash()
  • statediff_stateDiffAt()
  • statediff_writeStateDiffAt()
  • statediff_writeStateDiffsInRange()

e.g. curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"statediff_writeStateDiffsInRange","params":['"$BEGIN"', '"$END"', {"intermediateStateNodes":true,"intermediateStorageNodes":true,"includeBlock":true,"includeReceipts":true,"includeTD":true,"includeCode":true}],"id":1}' "$HOST":"$PORT"

The process can be configured locally with sets of ranges to process as a "prerun" to processing directed by the server endpoints. This is done by turning "prerun" on in the config (statediff.prerun = true) and defining ranged and params in the prerun section of the config as shown below.

Configuration

An example config file:

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

[server]
    ipcPath = ".ipc"
    httpPath = "127.0.0.1:8545"

[statediff]
    prerun = true
    serviceWorkers = 1
    workerQueueSize = 1024
    trieWorkers = 4

[prerun]
    only = false
    ranges = [
        [0, 1000]
    ]
    [prerun.params]
        intermediateStateNodes = true
        intermediateStorageNodes = true
        includeBlock = true
        includeReceipts = true
        includeTD = true
        includeCode = true
        watchedAddresses = []
        watchedStorageKeys = []

[log]
    file = ""
    level = "info"

[eth]
    chainID = 1

[database]
    name     = "vulcanize_test"
    hostname = "localhost"
    port     = 5432
    user     = "vulcanize"
    password = "..."
    type = "postgres"
    driver = "sqlx"
    dumpDestination = ""
    filePath = ""

[cache]
    database = 1024
    trie = 1024

[prom]
    dbStats = false
    metrics = true
    http = true
    httpAddr = "localhost"
    httpPort = "8889"

[ethereum]
    nodeID = ""
    clientName = "eth-statediff-service"
    genesisBlock = "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"
    networkID = 1
    chainID = 1