Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions website/docs/xdcchain/developers/node_operators/bootstrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Run XDC Nodes using Bootstrap Script
---

# Setup XDC Masternode using Bootstrap Script

## For Mainnet

**Bootstrap Command XinFin Node Setup:**

```
sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)" root
```

**Examples:**
After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter "mainnet".
```
$ sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)" root
[sudo] password for user:
Please enter your XinFin Network (mainnet/testnet/devnet) :- mainnet
```
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as "Demo_Server."
```
Your running network is mainnet
Please enter your XinFin MasterNode Name :- Demo_Server
Your Masternode Name is Demo_Server

```


## For Testnet
After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter "testnet".
```
sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)" root
Please enter your XinFin Network (mainnet/testnet/devnet) :- testnet
```
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as "test01"
```
Your running network is testnet
Please enter your XinFin MasterNode Name :- test01
Your Masternode Name is test01
```

## For Devnet
After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter "devnet".
```
sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)" root
Please enter your XinFin Network (mainnet/testnet/devnet) :- devnet
Your running network is devnet
```
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as "test01"
```
Please enter your XinFin MasterNode Name :- test01
Your Masternode Name is test01
Generate new private key and wallet address.
If you have your own key, you can change after this and restart the node
Type 'Y' or 'y' to continue:
```
176 changes: 176 additions & 0 deletions website/docs/xdcchain/developers/node_operators/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
---
title: Setup XDC Masternode using Docker
---

# Setup XDC Masternode using Docker

## Setting up XDC Network Masternode Docker version

The server or VPS used for the masternode should be directly facing the internet with a public IP and without NAT.


**Operating System**: Ubuntu 20.04 64-bit or higher

Should be facing internet directly with **public IP** & **without NAT**

**Tools**: Docker, Docker Compose(1.27.4+)

Setup (For Ubuntu 20.04 64-bit or higher Operating System)

Follow the written steps starting from step 1, or you can watch the video tutorials:

<iframe width="768" height="432" src="https://www.youtube.com/embed/1A20eVTJYvs" title="Deploying an XDC Network Masternode via Docker" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## Step 1: Clone repository
```bash
git clone https://github.com/XinFinOrg/XinFin-Node.git

```

## Step 2: Change directory
Then we change the directory to XinFin-Node
```bash
cd XinFin-Node
```

## Step 3: Install docker
We need to install Docker and Docker-Compose by running the following command:
```bash
sudo ./setup/install_docker.sh
```

## Step 4:
Create a new .env file and copy the env.example file that exist in the mainnet directory. We will ensure we are in the "mainnet" directory by typing these commands. Once in edit mode for the .env file, name your masternode and use an email address in the respective fields
```bash
cd mainnet
cp env.example .env
nano .env

```
**For Testnet**
```bash
cd testnet
cp env.example .env
nano .env
```

## Step 5: Start your Node
**For Mainnet run the following commands:**
```bash
cd mainnet
bash docker-up.sh
```
At this point you should be able to see your masternode on the list of nodes here or as shown below:

![node-sync](../../img/node_sync.png)

For Testnet run the following commands:
```bash
cd testnet
bash docker-up.sh
```
You should be able to see your node listed on the [Apothem Network] page. Select **"Switch to LiveNet"** to check **LiveNetwork** Stats and Select **"Switch to TestNet"** for **TestNetwork**.

Your coinbase address can be found in xdcchain/coinbase.txt file.

For troubleshooting purposes, you can stop the node by using the following command on either Mainnet or Testnet:
```bash
bash docker-down.sh
```

**Downloading a Network Snapshot (Mainnet or Apothem)**

The following steps are to expedite the syncing process of your node with the XDC Network. If you followed the steps above, your node will take 3-4 days to sync up with the network fully. You can reduce that time by downloading a network snapshot and bringing your node back up after the chain has been downloaded and unpacked.

<iframe width="768" height="432" src="https://www.youtube.com/embed/ZQF3f0Zd6-k" title="Downloading an XDC Network Snapshot to Expedite Node Syncing to" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

# Mainnet Snapshot

**Bring down your node:**
```bash
bash docker-down.sh
```
**Remove the old xdchain file from the server**
```bash
rm -rf xdcchain.tar
```
**Download the snapshot**
```bash
wget https://download.xinfin.network/xdcchain.tar
```
**Unpack the xdcchain.tar file**
```bash
tar -xvzf xdcchain.tar
```
**The unpacking will take some time, and it will look like this:**

![unpacking](../../img/unpacking.png)

**The following command will move the xdcchain/XDC to xdcchain/XDC_backup**
```bash
mv xdcchain/XDC xdcchain/XDC_backup
mv XDC xdcchain
```

**Then we are going to remove the old "nodekey" file**
```bash
rm -rf xdcchain/XDC/nodekey
```

**The last step is to run the bash upgrade.sh command**
```bash
bash upgrade.sh
```

This command will bring your node up and it will start syncing to the network. Once up and running, your node will be synced to the network in just a few minutes.

![node_upgrade](../../img/node_upgrade.png)

# Apothem Snapshot

**Bring down your node:**
```bash
bash docker-down.sh
```

**Remove the old xdchain file from the server**
```bash
rm -rf apothem.tar
```

**Download the snapshot**

Full Node snapshot:
```bash
wget http://downloads.apothem.network/xdcchain.tar
```

Archive Node snapshot:
```bash
wget http://downloads.apothem.network/xdcchain_archive.tar
```

**Unpack the apothem.tar file**
```bash
tar -xvzf apothem.tar
```

**Move the xdcchain-testnet**
```bash
mv XDC xdcchain-testnet
```

**Bring up the node**
```bash
bash docker-up.sh
```










20 changes: 20 additions & 0 deletions website/docs/xdcchain/developers/node_operators/dockerimg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Docker Image for the XDC Network
---

# Docker Image for the XDC Network

## What is a Docker Image?

A Docker image is a lightweight, stand-alone, executable package that includes everything needed to run an application, including code, runtime, libraries, and configurations. In the context of blockchain, Docker images simplify the deployment and management of nodes by enabling developers to encapsulate the entire blockchain environment into a single, replicable package.

## Purpose of the XDC Network's Docker Image
For the XDC Network, the Docker image provides a standardized and efficient way for developers to deploy, manage, and update their XDC nodes. The XDC Docker image streamlines the node deployment process, reducing configuration errors and minimizing setup time. It allows developers to run nodes in isolated containers, ensuring a consistent environment across different infrastructures.

## Key features of the XDC Docker image include:

1. Ease of Deployment: Developers can deploy XDC nodes with just a few simple commands, reducing the complexity of setup.
2. Portability: Docker images are portable, meaning they can run consistently across various platforms, including local machines, cloud environments, and virtualized infrastructure.
3. Version Control: The XDC Docker image includes versioning, allowing developers to choose specific versions for compatibility testing or deployment.
4. Improved Security: Isolated environments reduce security risks as each container runs independently from the host system.

Loading