This project is a proof of concept (POC) for Bitcoin transactions using the BlockCypher API, with data storage in a PostgreSQL database using Docker Compose.
- Go 1.16 or higher
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/Chxpz/bitcoin-runes-poc.git cd bitcoin-runes-poc -
Set up environment variables in a
.envfile:DB_HOST=localhost DB_PORT=5432 DB_USER=postgres DB_PASSWORD=postgres DB_NAME=runes
-
Start the Docker Compose services:
docker-compose up -d
-
Install Go dependencies:
go get github.com/jackc/pgx/v4/pgxpool go get github.com/joho/godotenv
-
Run the application:
go run main.go
.
├── docker-compose.yml
├── .env
├── db.go
├── etch
│ ├── etch.go
├── mint
│ ├── mint.go
└── main.godocker-compose.yml: Docker Compose configuration for PostgreSQL..env: Environment variable configuration file.db.go: Code to initialize the database and create therunes_poctable.etch/etch.go: Code to create "etch" transactions.mint/mint.go: Code to send "mint" transactions.main.go: Main function that coordinates the creation and sending of transactions and saves the results in the database.
Access the PostgreSQL database:
docker exec -it runes_postgres psql -U postgres -d runesQuery the runes_poc table:
SELECT * FROM runes_poc;