Skip to main content

Connect to an existing Blockchain network using docker

This guide describes how to connect to an existing network using of Docker and Docker Compose. Before starting make sure to have docker and docker compose available on your machine.

Table of Contents

Trubudget Docker Images

Trubudget's docker images are published on docker-hub. It is recommended to use a specific version tag like v.1.20.0 instead of the main or latest tag.

Only use main or latest tag if a code change of these versions is needed.

Blockchain

A beta node is a Trubudget node which connects to an existing Trubudget network. To understand the connection process read the approval process documentation.

Environment Variables

To establish a connection to an existing Trubudget network following conditions must be met:

  1. For a description of all Environment variables, see environment variables. This table gives an overview how to set the env vars correctly, so the beta node can connect to the alpha node. Empty entries mean that setting that env var has no effect.
Env Var NameDescriptionAlpha APIAlpha BlockchainBeta APIBeta Blockchain
EXTERNAL_IPIP address with which the current node can be reached.Not relevantShould be set if nodes are not in the same network.Not relevantShould be set if nodes are not in the same network.
P2P_HOSTPrivate IP-address of the alpha blockchain for P2P communicationLeave EmptyLeave emptyLeave emptyMust be set
P2P_PORTPort used for P2P communications by nodesNot RelevantMust be set first in alpha to be used by beta blockchainNot relevantMust be set as the value set by the alpha blockchain
API_HOSTIP-address of the alpha APINot relevantNot relevantNot relevantMust be set so that network registration requests could be sent
API_PORTPort of the alpha apiMust be setNot relevantNot relevantMust be set for network registration
PORTPort for corresponding serviceMust be setMust be setMust be setMust be set
MULTICHAIN_RPC_HOSTIP-address used in RPC comms between api and blockchainMust be setNot relevantMust be setNot relevant
MULTICHAIN_RPC_PORTPort used in RPC comms between api and blockchainMust be set same port as in alpha nodeMust be set for alpha nodeMust be set same port as in beta nodeMust be set for beta node
MULTICHAIN_RPC_PASSWORDPassword used in RPC comms between api and blockchainMust be set same password as in alpha nodeMust be set for alpha nodeMust be set same password as in beta nodeMust be set for beta node (different password than alpha)
ORGANIZATIONOrganization name of alpha/beta nodesMust be set as alpha node organizationMust be set as alpha node organizationMust be set as beta node organization (different from alpha node organization)Must be set as beta node organization (different from alpha node organization)
ORGANIZATION_VAULT_SECRETOrganization vault secrets of alpha/beta nodes Must be set as alpha node organizationMust be set as alpha node organizationMust be set as beta node organization (different from alpha node organization)Must be set as beta node organization (different from alpha node organization)

Example setup

You can see an example multi-node setup via docker-compose under /docker-compose/multi-node. Check out the container env variable setup in docker-compose.yml to have a better idea how they are used differently in alpha and beta services.