This project is a lightweight Ethereum blockchain transaction parser that allows users to:
- Retrieve the current Ethereum block number
- Subscribe to specific Ethereum addresses
- Fetch transactions for subscribed addresses
|-Trustwallet.postman_collection.json
|-main.go
|-README.md
|-go.mod
|-parser
| |-types.go
| |-ethereum
| | |-ethereum_parser_test.go
| | |-ethereum_parser.go
| |-parser.go
|-main_test.go
- Clone the repository
git clone https://github.com/yourusername/trustwallet.git
cd trustwallet- Install dependencies
go mod tidy- Run the application
go run main.go- Endpoint:
/current_block - Method: GET
- Description: Retrieves the latest Ethereum block number
- Response:
{ "current_block": 12345678 }
- Endpoint:
/subscribe - Method: POST
- Description: Add an Ethereum address to the observer list
- Request Body:
{ "address": "0x46340b20830761efd32832a74d7169b29feb9758" } - Response:
{ "message": "Address subscribed successfully" }
- Endpoint:
/transactions - Method: GET
- Description: Fetch transactions for a subscribed address
- Query Parameter:
address - Response:
{ "transactions": [ { "from": "0x...", "to": "0x...", "value": "..." } ] }
- RPC Endpoint: Configured in
ethereum_parser.go- Currently using:
https://ethereum-rpc.publicnode.com
- Currently using:
Run tests using:
go test ./...A Postman collection is included (Trustwallet.postman_collection.json) for easy API testing and documentation.
- Implement connection pooling for RPC requests
- Add caching mechanisms
- Consider rate limiting and error handling for RPC interactions