Welcome to the MASA Node Docker setup guide. This document will walk you through the process of setting up and running your own MASA node in a Docker environment. Follow these steps to get up and running quickly.
Before you begin, ensure you have the following installed on your system:
- Docker: You'll need Docker to build and run containers. Download and install Docker for your operating system from Docker's official website.
- Docker Compose: This project uses Docker Compose to manage multi-container Docker applications. Docker Desktop for Windows and Mac includes Docker Compose. On Linux, you may need to install it separately following the instructions here.
- Git
Start by cloning the masa-node repository to your local machine. Open a terminal and run:
git clone [email protected]:masa-finance/masa-oracle.git
cd masa-oracle
Create a .env
file in the root of your project directory. This file will store environment variables required by the MASA node, such as BOOTNODES
and RPC_URL
. You can obtain these values from the project maintainers or documentation.
Example .env
file content:
BOOTNODES=/ip4/35.223.224.220/udp/4001/quic-v1/p2p/16Uiu2HAmPxXXjR1XJEwckh6q1UStheMmGaGe8fyXdeRs3SejadSa
RPC_URL=https://ethereum-sepolia.publicnode.com
ENV=test
TWITTER_USERNAME="your_username"
TWITTER_PASSWORD="your_password"
TWITTER_2FA_CODE="your_2fa_code"
TWITTER_SCRAPER=True
*be sure to use ENV=test to join the masa oracle testnet
With Docker and Docker Compose installed and your .env
file configured, build the Docker image using the following command:
docker-compose build
This command builds the Docker image based on the instructions in the provided Dockerfile
and docker-compose.yaml
.
To start the MASA node, use Docker Compose:
docker-compose up -d
This command starts the MASA node in a detached mode, allowing it to run in the background.
After starting the node, you can verify it's running correctly by checking the logs:
docker-compose logs -f masa-node
This command displays the logs of the MASA node container. Look for any error messages or confirmations that the node is running properly.
The MASA node generates keys that are stored in the .masa-keys/
directory in your project directory.
This directory is mapped from /home/masa/.masa/
inside the Docker container, ensuring that your keys are safely stored on your host machine.
The public key of your new node is shown in the output at the beginning of the logs when it starts up:
docker-compose logs -f masa-node
You can obtain sepolia ETH from a faucet such as:
Like so:
You can obtain test (sepolia) MASA from our faucet:
Like so:
Once the transactions settle, you can stake your node
docker-compose run --build --rm masa-node /usr/bin/masa-node --stake 1000
Stop your running daemonized node:
docker compose down
Start it up again with the -d flag: (If you have changed settings you may wish to --force-recreate
)
docker compose up --build --force-recreate -d
To update your node, pull the latest changes from the Git repository (if applicable), then rebuild and restart your Docker containers:
git pull
docker-compose build
docker-compose down
docker-compose up -d