A terminal(TUI) Ethereum transaction explorer built with Go and the Bubble Tea TUI framework. Fetch, display and explore details for any Ethereum transaction hash using the Etherscan API V2 all in your terminal.
Built with bubbletea, bubbles, and lipgloss.
See examples
- Go 1.26 or later.
- An Etherscan API Key.
Create .env file in project root:
cp .env.example .envAdd your Etherscan API key to the .env file:
ETHERSCAN_API_KEY=your_etherscan_api_key_here
Install dependencies:
go mod tidy && go mod verifygo build -o ethereum-explorer ./cmd/ethereum-explorerRun the binary:
./ethereum-explorergo run ./cmd/ethereum-explorerEnsure the code passes linting:
make lintOr directly:
golangci-lint run ./...Run all unit tests:
make testOr directly:
go test ./... -vRun end-to-end tests:
make test-e2eSkip cache
go test -count=1 ./... -vRun tests for a specific package (e.g., etherscan):
go test ./internal/etherscan/...cmd/ethereum-explorer/: Application entry point.internal/etherscan/: Client for interacting with the Etherscan API V2.client.go: Main client and API request logic.types.go: Struct definitions for Etherscan responses and the internalTransactiontype.json.go: JSON unmarshaling and response extraction helpers.retry.go: HTTP request implementation with exponential backoff.format.go: Formatting utilities for ETH values, gas prices, and transaction types.convert.go: Conversion helpers (hex-to-decimal, confirmations calculation, etc.).
internal/model/: Main Bubble Tea application model and state management.model.go: TUI state, initialization, and sub-component orchestration.update.go: Message handling and state transitions.view.go: Main UI rendering logic delegating to components.
internal/tui/: TUI-specific components and styling following the MVU pattern.components/: Reusable UI elements (header, footer, input, loader, transaction, errorview).context/: SharedProgramContextfor global state like terminal dimensions and theme.theme/: Centralized styles and adaptive color definitions using Lipgloss.
internal/config/: Configuration and environment variable management..env: Local environment variables (ignored by git).main.go: Deprecated entry point.