XDC Test Network (Docker)
Follow these steps to create an XDC private network using Docker.
Prerequisites
Install Docker https://docs.docker.com/engine/install/ubuntu/
Git clone https://github.com/XinFinOrg/XDPoSChain.git
Add XDCPay or Metamask browser extension wallets
Steps
Go to the clone directory
Build the image of docker file (xdc-poschain is the name of the image)
Open your Docker account at https://hub.docker.com/
Create new repository in Docker - (xdposchain)
Name the repository and this name should be public. Go to the Ubuntu terminal and log in to your Docker account
Docker push <docker-username>/<repository-name>:<tagname>
If you need to check the Docker images
Create a Docker container
example: -docker run -d -p 8534-8550:8534-8550 -p 30303-30320:30303-30320<docker-username>/<Repository-name>:<tagname> /bin/bash sleep infinity
Check the Docker container
Access the latest Docker container
Docker exec command runs a new command in a running container
To stop running Docker container (Do not stop it now)
Create a Genesis File
Use any editor like vi or nano. If you need to install nano use the below command
Run the following command to access and edit the Genesis.json file
The Genesis File contains all the information about the blockchain Network
Note - Add your Metamask Testnet Account address in Genesis.json
Initiate data directory and start the node
The node is now running on port 8541. You can add a specific port using <rpcport 8541>
Open a new terminal and open the same container
To check that the RPC address is working properly. Curl is needed for this command. If Curl is installed, use this command to install it, otherwise skip to the curl command line.
For AWS machines, you need the AWS server public IP.
Example: http://<Server Public IP>:8541/
Adding a custom Network to XDCPay or Metamask
Name - XDC TestNetwork (any)
RPC URL http://<Server Public IP>:8541/
Chain ID - 15 (Used in Genesis.json file)
Currency Symbol - XDC
Click "Save"
Fund the account with testnet XDC
Last updated