Ethereum VM state database
Stand-alone C++20 executable used to run EVM state database.
Basically acts as a command wrapper around evm-cpp-utils
state.
make all
NOTE: Dependencies must be compiled & linked into compilation aswell.
evm-state-db comes with various commandline functions, including :
Get - get a value at (contract address, key) pair in state
./bin/evm-state-db get --snapshotFile ./path/to/snapshot.json --contractAddress 4200000000000000000000000000000000000000 --key 42
Set - set a value at (contract address, key) pair in state ( and saves changes )
./bin/evm-state-db set --snapshotFile ./path/to/snapshot.json --contractAddress 4200000000000000000000000000000000000000 --key 42 --value 512
Run - runs an RPC server giving access to EVM state db ( for gets and sets ) ( TODO: not yet implemented )
./bin/evm-state-db run --snapshotFile ./path/to/snapshot.json --rpcPort 8999
# Get request
curl -X POST -H "Content-Type: application/json" --data '--contractAddress 4200000000000000000000000000000000000000 --key 42' http://localhost:8999
# Set request
curl -X POST -H "Content-Type: application/json" --data '--contractAddress 4200000000000000000000000000000000000000 --key 42 --value 512' http://localhost:8999
Note : Use -h
flag on each sub-command to see more options
- intx : 256-bit (32-byte) unsigned integers
- ethash : Ethereum hash functions
- evm-cpp-utils : EVM state types + utils
This repo contains various tests under ./test/
to make sure things are working.
To run use :
make get-test
make set-test
# RPC test
make run-rpc-local
# In a seperate terminal
make get-rpc-test
make set-rpc-test
make get-rpc-test
# Ctrl-C to stop RPC & snapshot state
Check the diff in ./test/snapshot.json
to see if things processed properly.
Brandon Roberts @b-j-roberts