This repository contains the Docker configuration to follow the Elements Project Tutorial.
tutorial/
├── docker-compose.yml # Container configuration
├── bitcoindir/
│ └── bitcoin.conf # Bitcoin Core configuration
├── elementsdir1/
│ └── elements.conf # Elements Node 1 configuration
├── elementsdir2/
│ └── elements.conf # Elements Node 2 configuration
├── elements-aliases.sh # Script with functions/aliases
└── README.md # This file
- Docker
- Docker Compose
docker compose up -dThere are two ways to use the tutorial commands:
Load the aliases script in your terminal:
source elements-aliases.shNow you can use the same commands as the tutorial:
# Bitcoin
b-cli getblockcount
b-cli generate 101
# Elements Node 1
e1-cli getblockcount
e1-cli getnewaddress
# Elements Node 2
e2-cli getblockcount
e2-cli getpeerinfoIf you prefer not to use aliases:
# Bitcoin
docker exec tutorial_bitcoind bitcoin-cli -regtest -rpcuser=user3 -rpcpassword=password3 getblockcount
# Elements Node 1
docker exec tutorial_elementsd1 elements-cli -chain=elementsregtest -rpcuser=user1 -rpcpassword=password1 getblockcount
# Elements Node 2
docker exec tutorial_elementsd2 elements-cli -chain=elementsregtest -rpcuser=user2 -rpcpassword=password2 getblockcountWhen you load elements-aliases.sh with source, you get access to these commands:
b-cli <command> # Execute bitcoin-cli commands
e1-cli <command> # Execute elements-cli commands on node 1
e2-cli <command> # Execute elements-cli commands on node 2# Start individual nodes (equivalent to tutorial's *-dae commands)
b-dae # Start bitcoind
e1-dae # Start elementsd1
e2-dae # Start elementsd2
# Stop individual nodes
b-stop # Stop bitcoind
e1-stop # Stop elementsd1
e2-stop # Stop elementsd2
# General management
elements-up # Start all containers
elements-down # Stop and remove all containers
elements-status # View container status# Individual logs (follow mode)
b-logs # View bitcoind logs
e1-logs # View elementsd1 logs
e2-logs # View elementsd2 logs
# All logs
elements-logs # View all container logs- RPC: localhost:18888
- P2P: localhost:18889
- User: user3
- Password: password3
- RPC: localhost:18884
- P2P: localhost:18886
- User: user1
- Password: password1
- RPC: localhost:18885
- P2P: localhost:18887
- User: user2
- Password: password2
Now you can follow the official tutorial at: https://elementsproject.org/elements-code-tutorial/working-environment
All tutorial commands will work the same way, just use the configured aliases!
docker compose downTo also remove volumes (persistent data):
docker compose down -v