Skip to content

Project inspired by an interview assignment I once completed. Primary aim was to learn go through a holistic project.

Notifications You must be signed in to change notification settings

maindotmarcell/blockchain-fees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain Fee Estimator

This is a simple tool to estimate the fee for a transaction on a blockchain. It currently supports Bitcoin, BSC, Ethereum and Solana.

Usage

Using make:

make run

Using go:

go run cmd/fee_tracker/main.go

Using docker compose:

docker compose up

Integrating new blockchains

To integrate a new blockchain, you need to implement the Blockchain interface in the internal/blockchain/interfaces.go file. This will require you to implement a service that can estimate the network fee for a transaction (based on the Service interface), and an API client that can fetch the fee data from the blockchain's API (based on the APIClient interface).

See the bitcoin package for an example.

Architecture Flowchart

flowchart TD
    A(app) -->|Go routine 1| B(bitcoin/bitcoin)
    B -->|"GetFees()"| C(bitcoin/service)
    C -->|"EstimateNetworkFee()"| D(bitcoin/api_client)
    D -->|"FetchFee()"| E[bitcoin fee estimator api]

    A -->|Go routine 2| F(ethereum/ethereum)
    F -->|"GetFees()"| G(ethereum/service)
    G -->|"EstimateNetworkFee()"| H(ethereum/api_client)
    H -->|"FetchFee()"| I[ethereum public node api]
Loading

About

Project inspired by an interview assignment I once completed. Primary aim was to learn go through a holistic project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published