Jump to content
Sign in to follow this  
buzzkillb

Playing with Docker and Wallet Daemon

Recommended Posts

Playing with using denariusd and tor in their own docker network. I am bypassing denariusd nativetor for some other reasons right now. denariusd:alpha is the test branch I am creating on docker hub using the latest denariusd wallet daemon.

~/.denarius/denarius.conf should be populated along with /etc/tor/torrc

docker-compose.yml

version: '3.2'

services:
  tor:
    image: buzzkillb/tor:alpine
    container_name: tor
    networks:
      - tor_network
    volumes:
      - /etc/tor/torrc:/etc/tor/torrc
    restart: always
  denariusd:
    image: buzzkillb/denariusd:alpha
    container_name: denariusd
    volumes:
      - ~/.denarius:/data
    command:
      -debug=0
    network_mode: service:tor
    depends_on:
      - tor
    restart: always
networks:
  tor_network:
    external: true

docker ps

CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS               NAMES
48e24fa60efd        buzzkillb/denariusd:alpha   "denariusd --datadir…"   8 seconds ago       Up 7 seconds                            denariusd
81119081a083        buzzkillb/tor:alpine        "/bin/sh -c '/usr/bi…"   19 seconds ago      Up 17 seconds       53/udp, 9050/tcp    tor

Connecting into the TOR nodes I have setup all over the place, something like this should appear in the denariusd logs.

docker logs denariusd -f

SetBestChain: new best=8499db50db63985aa0ad  height=2235381  trust=14348364472433105438  blocktrust=1048577  date=08/03/19 15:48:36
SOCKS5 connected hrzdbqp4vjbohsvg.onion
send version message: version 33500, blocks=2235381, us=tyfj5y64rlocawsb.onion:33369, them=hrzdbqp4vjbohsvg.onion:33369, peer=hrzdbqp4vjbohsvg.onion:33369
SetBestChain: new best=000000000019e5f675cb  height=2235382  trust=14348373734367204915  blocktrust=9261934099477  date=08/03/19 15:48:44
SOCKS5 connecting 6nw6dekrzc2s5i2w.onion

Once I get this working like I want, I will throw in a VPN connection.


Join Denarius Discord - https://discord.gg/JQEmXwb

Share this post


Link to post
Share on other sites

Getting closer to my goal. So the Master daemon will stay behind the PIA VPN and can also connect into tor. The slave wallets can then connect into the master daemon only using connect=ipofthepiacontainer.

docker inspect pia will give this near the end of the command.
connect=172.18.0.1 in the slave denarius.conf
tor=127.0.0.1:9050 in any denarius.conf you want to connect into tor.

image.png.7b16ad1d4ef48e9b26a740df51878316.png

docker-compose.yml

version: '3.2'

services:

  dozzle:
    container_name: dozzle
    image: amir20/dozzle:latest
    environment:
      - DOZZLE_TAILSIZE=100
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - 8888:8080

  pia:
    image: colinhebert/pia-openvpn
    container_name: pia
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    dns:
      - 209.222.18.218
      - 209.222.18.222
    environment:
      - REGION=Brazil
      - USERNAME=YOURUSERNAME
      - PASSWORD=YOURPASSWORD
    networks:
      - masternodes_default
    ports:
      - target: 33369
        published: 33369
        protocol: tcp
        mode: host
    restart: always

  TOR:
    image: buzzkillb/tor:alpine
    container_name: TOR
    network_mode: service:pia
    depends_on:
      - pia

  masterdenarius:
    image: buzzkillb/denariusd:alpha
    container_name: MASTERDENARIUS
    volumes:
      - ~/D/MASTER:/data
    command:
      -debug=0
    network_mode: service:pia
    depends_on:
      - pia

  slave1:
    image: buzzkillb/denariusd:alpha
    container_name: SLAVE1
    volumes:
      - ~/D/SLAVE1:/data
    command:
      -debug=0

  slave2:
    image: buzzkillb/denariusd:alpha
    container_name: SLAVE2
    volumes:
      - ~/D/SLAVE2:/data
    command:
      -debug=0

networks:
  masternodes_default:
    external: true

Some commands

docker exec MASTERDENARIUS denariusd -datadir=/data getinfo
docker exec SLAVE1 denariusd -datadir=/data getinfo

docker exec MASTERDENARIUS denariusd -datadir=/data getpeerinfo
docker exec SLAVE1 denariusd -datadir=/data fortunastake status

 


Join Denarius Discord - https://discord.gg/JQEmXwb

Share this post


Link to post
Share on other sites

Playing with docker version control as one of the testing wallets played funny on me. This is the digest ID for that particular wallet. Not sure how to get this unless someone was to have already pulled each build created from docker hub. The digest id comes from docker images digest command.

denariusd v3.3.9.2
buzzkillb/[email protected]:18df79057b06eff2b0d332e8be105b7ec15be19b24ea9d9094f08633523f60a7


Join Denarius Discord - https://discord.gg/JQEmXwb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...