To ensure smooth setup and operation of the BlockDAG node, the following software must be installed and configured on your system:
Docker Installation: Docker should be installed on your system. If it is not installed, follow the steps in the official Docker documentation to install Docker.
Git : Git is required for version control and managing repositories. You can install Git by following these steps:
sudo apt update
sudo apt install git
sudo brew install git
Wget Wget is used to transfer data from or to a server and is often required for HTTP requests. To install Wget, use the following commands based on your operating system:
sudo apt update
sudo apt install wget
sudo brew install wget
System Update and Required Package Installation for Linux: Run the following commands to update your package list and install expect
(a tool often used for automating interactive tasks in the terminal):
sudo apt update
sudo apt install expect
Once these prerequisites are installed, follow the steps below to run a full BlockDAG node.
First, clone the BlockDAG scripts repository from GitHub using the following command:
git clone https://github.com/BlockdagNetworkLabs/blockdag-scripts
If you are a linux distribution user then use the following command:
cd blockdag-scripts/linux
If you are a mac OS user then use the following command:
cd blockdag-scripts/mac
To create a new wallet, run the following command:
./wallet.sh
To create a wallet with existing wallet generation seed, run the following command:
./wallet.sh YOUR_WALLET_SEED
NOTE:
- The wallet seed is unique to each wallet. If the seed is lost, the wallet and its contents are permanently lost. Store it somewhere safely.
- The generated wallet seed will be stored in the
wallet.txt
file. Keep this file secure somewhere, as it contains wallet seed information needed to recover your wallet.
To run a full BlockDAG node in a testnet environment with mining enabled, follow these commands:
./blockdag.sh
Note:
- This script will generate a new wallet if one does not already exist.
- If the above command does not execute as expected, try running it with
sudo
to ensure elevated permissions.Note: Ignore if you see the following warning in MAC
!blockdag-testnet-network The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s
sudo ./blockdag.sh
if you have a wallet created, and have the public address then run the following command:
./node.sh YOUR_PUBLIC_ADDRESS
Note: You can find your public address at the end of the
wallet.txt
file, if it was created using thewallet.sh
script.
Once the node is running, you can check the logs to monitor its status. Follow these steps:
Check the Docker Status: Run the following command to list all running Docker containers and verify whether your BlockDAG node is running:
docker ps
This command will display a list of all active Docker containers, including their names and IDs. If your BlockDAG node is listed, it indicates that the node is running. Use the container ID to manage the node.
View Node Logs: Use the following command to view the logs of your BlockDAG node:
docker logs -f blockdag-testnet-network
Note: The
-f
flag in thedocker logs
command will follow the logs, allowing you to see real-time output. If the commands do not work as expected, try usingsudo
for elevated permissions:
To properly manage and maintain the BlockDAG node, follow the steps below to stop the node and clean up any residual data and logs.
To stop a running BlockDAG node, execute the following command in your terminal:
docker stop blockdag-testnet-network
This will stop the node, ensuring all current processes are terminated.
Once the node has been stopped, it's important to clean up any leftover data and logs to maintain optimal performance and disk space. To do this, run the following command:
docker run blockdagnetwork/bdag:latest ./bdag --cleanup
This command will:
blockdag.sh
ScriptThe blockdag.sh
script is responsible for the following key tasks:
Note: Ensure that the wallet generated by this script is securely stored, as it will be used for mining operations.
clean.sh
ScriptThe clean.sh
script is designed to:
Note: Ensure you have backed up any important wallet details before running this script, as the deletion process is irreversible.
download_wallet.sh
ScriptThe download_wallet.sh
script is designed to:
generate_wallet.sh
ScriptThe generate_wallet.sh
script serves the following purposes:
Note: The wallet's private key and seed phrase should be securely stored, as they are required for accessing and managing the wallet.
install_docker.sh
(Ubuntu)This script:
Note: This script is only compatible with
Ubuntu 20.04
or higher.
node.sh
ScriptThe node.sh
script is responsible for the following tasks:
miner address
as a parameter, allowing the node to be started with the specified miner's address for participation in the BlockDAG network.Note: The miner address is crucial for identifying and linking the node to the wallet used for mining operations. Ensure that the correct address is provided during setup.
wallet.sh
ScriptThe wallet.sh
script provides the following functionalities:
wallet.txt
file.Note: The generated seed phrase and wallet details are sensitive information and are stored in
wallet.txt
. The wallet's private key and seed phrase should be securely stored, as they are required for accessing and managing the wallet.
Each of these scripts plays a crucial role in managing your BlockDAG node and wallet operations. Make sure to run them with the appropriate permissions (e.g., using sudo
if needed) and ensure Docker is correctly installed and running before interacting with the node.
To restart the blockdag network without cleanup run the following commands
first choose the operating system linux/mac
for linux :
cd linux
./restart.sh
for mac :
cd mac
./restart.sh
To restart the blockdag network with cleanup run the following commands
first choose the operating system linux/mac
for linux :
cd linux
./restartWithCleanup.sh
for mac :
cd mac
./restartWithCleanup.sh
Note:
- Both restart scripts update the latest Docker image.
- The restart.sh script restarts the network from where it was previously stopped, preserving the current state.
- The restartWithCleanup.sh script removes the old database and begins syncing the node from the genesis block, while retaining the wallet and balance.