Overall, it is a restful api implementation of parser.
A multi-threaded monitoring program will be launched to continuously monitor the transactions on the latest blockchain related to the subscribed addresses.
Get the latest block from eth_getBlockByNumber
Add an address into storage. Will deny duplicated address.
Return all transactions releated to an adress after subscribed. Transactions before subscription are NOT INCLUDED.
Golang version == 1.22.1
make build
Your working path should contain config.json. For example:
{
"endpoint": "https://cloudflare-eth.com"
}
Then
./ethereum-parser
make test
To get current block
curl -X GET 'http://localhost:8080/currentBlock'
To subscribe an address
curl -X POST -d "address=0x1111e3ef0b6ae32e14a55e0e7cd9b8505177c2bf" http://localhost:8080/subscribe
To get transactions from an address
curl -X GET "http://localhost:8080/getTransactions?address=0x1111e3ef0b6ae32e14a55e0e7cd9b8505177c2bf"