This is a simple Ethereum transaction parser that can be used to extract information from Ethereum transactions.
go build -o tx-parser main.go
./tx-parser -config=config.json
There are 3 provided APIs:
POST /api/v1/address
- Subscribe to an addressGET /api/v1/transactions
- Get all transactions for an address since subscriptionGET /api/v1/transactions/current_block
- Get the current parsed block number
The configuration file is a JSON file that contains the following fields as shown below:
{
"rpc_url": "https://cloudflare-eth.com",
"port": 8080, // HTTP Port
"buffer_size": 1000, // Maximum number of transactions can be stored by the parser
"ticker_period": 10, // Time in seconds to check for new blocks
"start_block": 19552784 // Block number to start parsing from
}
Refer to TxParser.postman_collection.json for an example of how to use the APIs.
- Add retry mechanism for RPC calls
- Use a proper database to store transactions. My recommendation would be to use a time-series database like ClickHouse.