This project is an Ethereum transaction notification system that monitors blockchain transactions for subscribed addresses and provides a notification mechanism. It includes a parser, storage, and configuration management.
- Monitors the Ethereum blockchain for transactions.
- Allows subscribing and unsubscribing to specific Ethereum addresses.
- Stores transaction data in an in-memory storage system.
- Exposes HTTP endpoints for interaction.
- Configurable via
.env
file.
project-root/
├── config/ # Configuration management
│ └── config.go
├── internal/ # Core application logic
│ ├── app/ # Application initialization
│ ├── ethereum/ # Ethereum JSON-RPC client
│ ├── parser/ # Blockchain parser implementation
│ └── storage/ # In-memory storage system
├── test/ # Test files
│ ├── integration/ # Integration tests
│ └── unit/ # Unit tests
├── .env # Environment variables
├── go.mod # Go module file
├── main.go # Application entry point
└── README.md # Project documentation
- Go 1.18+
- Geth (Go Ethereum) or another Ethereum node for testing
-
Clone the repository:
git clone https://github.com/yourusername/yourproject.git cd yourproject
-
Create a
.env
file in the project root:ETHEREUM_RPC_URL=http://127.0.0.1:8545
-
Install dependencies:
go mod tidy
-
Run the Ethereum node locally (example with Geth):
geth --dev --http --http.api personal,eth,net,web3 --http.addr 127.0.0.1 --datadir ./eth_data
Start the application:
go run cmd/parser/main.go
-
Get Current Block
- GET
/block/current
- Returns the current block being monitored.
- GET
-
Subscribe to an Address
- POST
/subscribe
- Body:
{ "address": "<ethereum_address>" }
- POST
-
Unsubscribe from an Address
- POST
/unsubscribe
- Body:
{ "address": "<ethereum_address>" }
- POST
-
Get Transactions for an Address
- GET
/transactions?address=<ethereum_address>
- GET
go test ./...
go test ./test/unit/...
go test ./test/integration/...