Simple ColdFusion client for interacting with the BitGo platform, along with a Docker setup for running the BitGo Express service locally.
- Set up a BitGo account in the testnet or production environment.
- Create a long-lived access token.
Create .env files for the Docker containers:
# In the docker/ folder
cp .env.example .env.dev
cp .env.example .env.prodEdit the .env files:
# https://github.com/BitGo/BitGoJS/blob/master/modules/express/.env.example
BITGO_PORT=3080
BITGO_ENV=devCreate .env files for development and production:
# In the coldfusion/ folder
cp .env.example .env.dev
cp .env.example .env.prodEdit the environment files with your configuration:
BITGO_EXPRESS_HOST=127.0.0.1
BITGO_EXPRESS_PORT=3080
BITGO_ACCESS_TOKEN=your_bitgo_access_token
BITGO_PASSPHRASE=your_bitgo_wallet_or_account_passphraseNote
When you create the access token and the wallet, use the wallet passphrase to transact. Othwerwise, when you create the access token but someone else creates the wallet, use your BitGo-login passphrase to transact.
For local development, set the request.ENVIRONMENT to dev in application.cfc. In production, set it to prod.
# From the docker/ folder
cd docker
# Create and start the development container
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
# or
npm run up:dev
# Create and start the production container (uses docker-compose.override.yml)
docker compose up -d
# or
npm run up
# Resume previously stopped container
docker compose start bitgo-express
# or
npm start
# Ensure the BitGo Express server is running
curl localhost:3080/api/v2/pingexpress
> {"status":"express server is ok!"}
# Check connection to bitgo.com
curl localhost:3080/api/v2/ping
> {"status":"service is ok!","environment":"BitGo Testnet","configEnv":"testnet"}
# Track dev logs of requests sent to BitGo
docker logs --tail 100 --follow --timestamps bitgo-express-dev
# or
npm run log:devTip
To update BitGo, pull the latest image from Docker Hub:
# From the docker/ folder
cd docker
# Update
npm run stop
docker rm bitgo-express-[prod|dev]
docker rmi bitgo/express
npm run up[:dev]
# Verify
docker exec -it bitgo-express-[prod|dev] /bin/bash
cat /var/bitgo-express/package.json | grep '"bitgo":'
> "bitgo": "^50.15.0"
# See change Log at https://github.com/BitGo/BitGoJS/blob/master/modules/bitgo/CHANGELOG.md# From the coldfusion/ folder
cd coldfusion
# Start the ColdFusion server via CommandBox
box config set modules.commandbox-dotenv.checkEnvPreServerStart=false && box server start
# or
npm startThe ColdFusion client will open in the browser at http://localhost:8080/usage.cfm (this can be changed in server.json).
The usage.cfm file serves as an integration test and provides examples of how to:
- List the wallets for a specific coin, i.e.
tBTC - Create a new address on the first wallet
- Send coins to this new address
- Get the details of this transfer/transaction
cd coldfusion
box cflint reportLevel=ERROR
# or
npm run lint
box cfformat run --cfm --overwrite
# or
npm run format- Connection Issues - Verify that the BitGo Express server is running and accessible at the configured host/port
- Authentication Errors - Check that your BitGo access token is correct and has the necessary permissions
- Wallet/Account Passphrase - Ensure the wallet or account passphrase is correct when sending transactions
- Environment Variables - Make sure all required environment variables are set