https://github.com/onflow/flow-evm-gateway
EVM Gateway is a Flow node that enables access to the Flow EVM network using the standard EVM JSON-RPC APIs.
The gateway uses a combination of local indexes and Flow client to interact and index EVM data.
Database
EVM Gateway uses a PebbleDB, a LevelDB/RocksDB inspired key-value store focused on performance and internal usage by CockroachDB.
The database doesn’t require a standalone hosting, it’s written in Go and embedded in the codebase. There are only a few requirements for the database to be run, we need a dedicated folder where the database will store its data.
<aside> ⚠️ The database folder needs to be persistent between restarts or deployments.
</aside>
The database size growth is expected to be around 20GB per year, but that can change with time. The suggested disk space reserved for the node should be 100GB.
The database folder should be backed up regularly (suggested once per day). In case the database is lost a re-index is possible but it will take time for the node to resync from the beginning (that depends on how old the network is, so far observed index is ~50 blocks/second, meaning one day of data with 1 block / s should be ingested in half an hour).
Deployment
The database should be preserved when doing HCUs or sporks. The same node and database will be used to index over all sporks. It is possible to create a new instance of the EVM Gateway for each spork with an empty database, but then we need to ensure a proxy that forwards the requests to the correct node, based on the requested height. We suggest the first deployment method.
Deployment is ideally done using the Docker image on the kubernetes network.