Bitcoin Node / DONE

bitcoincore, bitcoind

Minimum server requirements:

Disk: At least 1 TB SSD (NVMe).

Processor: Minimum 6 cores.

Memory: 8 GB.

Software: It is necessary to have Docker installed.

Creating an environment:

mkdir -p /nodes/btc
cd /nodes/btc

Create a bitcoind data directory:

mkdir bitcoin_data

Create a bitcoind configuration:

nano bitcoind.conf
bitcoind.conf
[main]
rpcallowip=0.0.0.0/0 # !ALLOWED IP!
rpcbind=0.0.0.0
rpcport=8332
rpcuser=YOUR_USER_NAME
rpcpassword=YOUR_PASSWORD
server=1
#txindex=1
prune=2048 #2GB
datadir=/data/.bitcoin
keypool=2000

Create docker-compose.yml

nano docker-compose.yml
docker-compose.yml
x-logging:
  &default-logging
  driver: "json-file"
  options:
    max-file: "1"
    max-size: "500m"

services:
  bitcoin:
    image: rg.boxexchanger.net/boxexchanger-utils/docker-bitcoind:main
    container_name: bitcoind
    volumes:
      - ./bitcoin_data:/data/.bitcoin
      - ./bitcoind.conf:/data/bitcoind.conf
    logging: *default-logging
    restart: unless-stopped
    stop_grace_period: 15m30s
    ports:
      - "8333:8333"
      - "127.0.0.1:8332:8332"

Running bitcoind in docker:

docker compose up -d

Opening the access port

Create a proxy from port

- localhost:8332 to port 8233 for bitcoind rpc

Setting up a proxy on caddy

УсInstalling caddy https://caddyserver.com/docs/install

Documentation prepared for Debian, Ubuntu operating system

apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' |  tee /etc/apt/sources.list.d/caddy-stable.list
apt update
apt install caddy

configuring caddy for proxy

8332 to port 8233 for external network

nano /etc/caddy/Caddyfile
/etc/caddy/Caddyfile

:8233 {
  handle_path /* {
    reverse_proxy 127.0.0.1:8332
  }
  respond 404
}

launch caddy

systemctl enable --now caddy

or restart if necessary

systemctl restart caddy

Opening a port for RPC: To access RPC, you must open port 8233 in the firewall settings for the IP address of the server from which the connection will originate.

Accesses

RPC: http://ip.host:8233/

Last updated