Skip to content

Latest commit

 

History

History
 
 

infrastructure

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Infrastructure Deployment

  1. Update parameter files
  2. Temp: Update JWT secret
  3. Do deployment: az deployment group create -g rg-dfx-api-{env} -f infrastructure/bicep/dfx-api.bicep -p infrastructure/bicep/parameters/{env}.json
  4. Loc: remove unused resources (API app service + plan, app insights)

VM

  1. Connect to VM: ssh {user}@vm-{user}-{type}-{env}.westeurope.cloudapp.azure.com

Docker Setup (dockerd)

  1. Copy script infrastructure/scripts/setupDocker.sh to virtual machine ~/setupDocker.sh
  2. Execute script: sudo ./setupDocker.sh
  3. Copy script infrastructure/scripts/setupEnv.sh to virtual machine ~/setupEnv.sh
  4. Execute script: ./setupEnv.sh
  5. Copy script infrastructure/config/docker/docker-compose.sh to virtual machine ~/docker-compose.sh
  6. Copy file infrastructure/config/docker/docker-compose-bitcoin.yml to virtual machine ~/docker-compose-bitcoin.yml
  7. Copy file infrastructure/config/docker/docker-compose-monero.yml to virtual machine ~/docker-compose-monero.yml
  8. Copy file infrastructure/config/docker/docker-compose-frankencoin.yml to virtual machine ~/docker-compose-frankencoin.yml
  9. Execute Docker Compose (see below) after all other setup steps are done:
    1. Bitcoin Node Setup
    2. Lightning Node Setup
    3. LNbits Setup
    4. ThunderHub Setup
    5. NGINX Setup

Bitcoin Node Setup (bitcoind)

  1. Copy content of config file infrastructure/config/btc/bitcoin.conf to virtual machine ~/volumes/bitcoin/bitcoin.conf
  2. bitcoin.conf: Replace [RPC_AUTH] and [WALLET]
  3. Actions after first startup via Docker Compose (see below)

Lightning Node Setup (lnd)

  1. Copy content of config file infrastructure/config/lightning/lnd/lnd.conf to virtual machine ~/volumes/lightning/lnd.conf
  2. lnd.conf: Replace [PRIVATE_IP], [ENVIRONMENT], [ALIAS], [PEER], [RPC_USER] and [RPC_PASSWORD]
  3. Adapt addpeer values for the current environment (peer info can be found here: https://mempool.space/de/lightning)
  4. Copy content of config file infrastructure/config/lightning/lnd/pwd.txt to virtual machine ~/volumes/lightning/pwd.txt
  5. pwd.txt: Replace [PASSWORD] with empty text for the very first startup
  6. Actions after first startup via Docker Compose (see below)

LNbits Setup

  1. Copy content of config file infrastructure/config/lightning/lnbits/lnbits.env to virtual machine ~/volumes/lnbits/.env
  2. .env: Replace [ADMIN_USERS] with empty text for the very first startup
  3. Actions after first startup via Docker Compose (see below)

ThunderHub Setup

  1. Copy content of config file infrastructure/config/lightning/thunderhub/thunderhub.env to virtual machine ~/volumes/thunderhub/.env
  2. Copy content of config file infrastructure/config/lightning/thunderhub/accounts.yml to virtual machine ~/volumes/thunderhub/accounts.yml
  3. accounts.yml: Replace [NAME] and [PASSWORD]

NGINX Setup

  1. Copy content of config file infrastructure/config/nginx/default.conf to virtual machine ~/volumes/nginx/default.conf

Docker Compose

The complete Bitcoin Blockchain data is loaded after the very first startup of the bitcoin node. Therefore it is recommended to copy already available blockchain data to the ~/volumes/bitcoin/... directory.

The complete Lightning data is synchonized after the very first startup of the lightning node. This may take some time.

After Docker Compose is successfully executed for the very first time, the following actions must be performed manually:

Bitcoin: Setup after first startup

  1. Create a Bitcoin Wallet (if needed)
  2. Create a Bitcoin Address (if needed)
  3. Send funds to the Bitcoin Address (if needed)

Lightning: Setup after first startup

  1. Create a Lightning Wallet with a secure password
  2. Set the password in the ~/volumes/lightning/pwd.txt file
  3. Create a Bitcoin Address (needed to open a channel)
  4. Send funds to the Bitcoin Address (needed to open a channel)
  5. Open the channels

LNbits: Setup after first startup

  1. Open a Browser and connect to LNbits at: https://vm-{user}-{type}-{env}.westeurope.cloudapp.azure.com
  2. Find the User Id in the URL
  3. Set the value of the LNBITS_ADMIN_USERS in the config file ~/volumes/lnbits/.env to the User Id

Infrastructure Update

Backup

  1. Run Script runBackup.sh before the update. This will backup all dynamic Bitcoin, Lightning, LNbits, ThunderHub, Monero and Frankencoin data created from the different docker images - except the large blockchain data.

Update

Detailed Update Information can be found at: https://docs.google.com/document/d/1WtpatYIxTcd-9E029Zu_4gLhd3H5MAfhytX3x-kUkwM

Docker Setup (dockerd)

  1. Copy script infrastructure/scripts/setupDocker.sh to virtual machine ~/setupDocker.sh
  2. Execute script: sudo ./setupDocker.sh
  3. Copy script infrastructure/scripts/setupEnv.sh to virtual machine ~/setupEnv.sh
  4. Execute script: ./setupEnv.sh

Monero (RPC)

Initial: Create a new wallet

  1. Login to VM

  2. Modify docker compose file section monero-rpc command

    • '--wallet-dir=/home/monero/.bitmonero/wallet'
    • '--rpc-bind-port=18082'
    • '--untrusted-daemon'
    • '--disable-rpc-login'
  3. Run docker compose docker compose -f docker-compose-monero.yml up -d

  4. After first startup create a new wallet: curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"[WALLET_NAME]","password":"[WALLET_PASSWORD]","language":"English"}}' -H 'Content-Type: application/json'

  5. Stop docker image

Initial: Create a new self signed certificate

  1. Copy content of config file (infrastructure/config/openssl/openssl.conf) to virtual machine (volumes/bitmonero) and replace the missing settings (in square brackets)

  2. Go to directory volumes/bitmonero

  3. Create certificate openssl req -config openssl.conf -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem

  4. Modify docker compose file section monero-rpc command

    • '--wallet-file=/home/monero/.bitmonero/wallet/[WALLET_NAME]'
    • '--password=[WALLET_PASSWORD]'
    • '--rpc-bind-port=18082'
    • '--untrusted-daemon'
    • '--disable-rpc-login'
    • '--rpc-ssl=enabled'
    • '--rpc-ssl-private-key=/home/monero/.bitmonero/key.pem'
    • '--rpc-ssl-certificate=/home/monero/.bitmonero/cert.pem'
  5. Run docker compose docker compose -f docker-compose-monero.yml up -d

Frankencoin (Ponder)

  1. Login to VM
  2. Run docker compose docker compose -f docker-compose-frankencoin.yml up -d

Docker compose to start or stop all container

Start all container

  1. Execute script: sudo ./docker-compose.sh - all bitcoin/lightning, monero and frankencoin containers are started

    • bitcoin-lightning-bitcoind-1
    • bitcoin-lightning-lnd-1
    • bitcoin-lightning-lnbits-1
    • bitcoin-lightning-thunderhub-1
    • bitcoin-lightning-nginx-1
    • monero-monerod-1
    • monero-monero-rpc-1
    • frankencoin-mainnet-ponder-1

Stop all container

  1. Execute command docker compose stop