Skip to content

Commit

Permalink
Merge pull request #51 from XinFinOrg/cloud
Browse files Browse the repository at this point in the history
Bootstrap Script Added.
  • Loading branch information
AnilChinchawale committed Jan 6, 2020
2 parents c5ddf72 + 18c5bb2 commit e4fb9fa
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
INSTANCE_NAME=YOUR_NODE_NAME
INSTANCE_NAME=XF_MasterNode
CONTACT_DETAILS=YOUR_EMAIL_ADDRES
NODE_TYPE=full
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
xdcchain*
xdcchain*
NodeName
48 changes: 32 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@

## How to Setup XinFin-XDC Masternode (One click Installer)
## How to Setup XinFin Masternode

**Operating System**: Ubuntu 16.04 64-bit or higher (Scroll Down for Windows and MAC Operating System)
## Method 1 :- Setup XinFin Masternode One click Installer ##

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

### Network Ports
* Apple Mac
* Windows
* Linux - Ubuntu

Following network ports need to be open for the nodes to communicate
### Download [XinFin One Click Installer](https://xinfin.org/setup-masternode.php) (to setup Masternode) for Windows, Linux and mac OS ###

| Port | Type | Definition |
|:------:|:-----:|:---------- |
|8545| TCP | RPC |
|30303| TCP/UDP | XDC |
---------------------------------

## Method 2 :- Setup XinFin Masternode Bootstrap Script ##

### Download [XinFin One Click Installer](https://xinfin.org/setup-masternode.php) (to setup Masternode) for Windows, Linux and mac OS ###
Bootstrap Command XinFin Node Setup :-

# Masternode Tools and Public Community Channel #
```
sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/cloud/bootstrap.sh)" root
```

Community Forum update link: http://xinfin.net
Examples :-
```
$ sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/cloud/bootstrap.sh)" root
[sudo] password for user:
Please enter your XinFin MasterNode Name :- Demo_Server
Your Masternode Name is Demo_Server
Telegram Development Community: https://t.me/XinFinDevelopers
```

Slack Public Channel: https://xinfin-public.slack.com/messages/CELR2M831/


---------------------------------

## Setup XinFin Masternode Method 2 ##
## Method 3 :- Setup XinFin Masternode Docker ##

**Operating System**: Ubuntu 16.04 64-bit or higher (Scroll Down for Windows and MAC Operating System)
**Operating System**: Ubuntu 16.04 64-bit or higher

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

Expand Down Expand Up @@ -97,6 +104,15 @@ To stop the node or if you encounter any issues use::
sudo docker-compose -f apothem-network.yml down
```

## Masternode Tools and Public Community Channel #

Community Forum update link: http://xinfin.net

Telegram Development Community: https://t.me/XinFinDevelopers

Slack Public Channel Invitation : https://launchpass.com/xinfin-public


**Troubleshooting**

Public discussions on the technical issues, post articles and request for Enhancements and Technical Contributions.
Expand Down
65 changes: 65 additions & 0 deletions Setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash


function configureXinFinNode(){
read -p "Please enter your XinFin MasterNode Name :- " MasterNodeName
echo "Your Masternode Name is ${MasterNodeName}"

echo "Installing Git "

sudo apt-get update

sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
git \
software-properties-common -y

echo "Clone Xinfin Node"

git clone -b cloud https://github.com/xinfinorg/XinFin-Node && cd XinFin-Node
sed -i "s/INSTANCE_NAME=XF_MasterNode/INSTANCE_NAME=${MasterNodeName}_XF/g" .env


echo "Installing Docker"

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

sudo apt-get update

sudo apt-get install docker-ce -y

echo "Installing Docker-Compose"

curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose


chmod +x /usr/local/bin/docker-compose
sleep 5
echo "Docker Compose Installed successfully"

sudo docker-compose -f docker-services.yml up -d


}

function init(){

configureXinFinNode
}


function main(){

init

}

main

65 changes: 65 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash


function configureXinFinNode(){
read -p "Please enter your XinFin MasterNode Name :- " MasterNodeName
echo "Your Masternode Name is ${MasterNodeName}"

echo "Installing Git "

sudo apt-get update

sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
git \
software-properties-common -y

echo "Clone Xinfin Node"

git clone -b cloud https://github.com/xinfinorg/XinFin-Node && cd XinFin-Node
sed -i "s/INSTANCE_NAME=XF_MasterNode/INSTANCE_NAME=${MasterNodeName}_XF/g" .env


echo "Installing Docker"

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

sudo apt-get update

sudo apt-get install docker-ce -y

echo "Installing Docker-Compose"

curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose


chmod +x /usr/local/bin/docker-compose
sleep 5
echo "Docker Compose Installed successfully"

sudo docker-compose -f docker-services.yml up -d


}

function init(){

configureXinFinNode
}


function main(){

init

}

main

6 changes: 4 additions & 2 deletions install_docker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

function installDocker(){


echo "Installing Docker"

sudo apt-get update
Expand All @@ -22,8 +24,8 @@ function installDocker(){

sudo apt-get install docker-ce -y

curl -o /usr/local/bin/docker-compose -L \
"https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)"
curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose


chmod +x /usr/local/bin/docker-compose
sleep 5
Expand Down
2 changes: 1 addition & 1 deletion start-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ do
fi
done < "$input"
INSTANCE_IP=$(curl https://checkip.amazonaws.com)
netstats="${INSTANCE_NAME}(${INSTANCE_IP}):xinfin_xdpos_hybrid_network_stats@stats.xinfin.network:3000"
netstats="${INSTANCE_NAME}_${INSTANCE_IP}:xinfin_xdpos_hybrid_network_stats@stats.xinfin.network:3000"

echo "Starting nodes with $bootnodes ..."
XDC --ethstats ${netstats} --bootnodes ${bootnodes} --syncmode ${NODE_TYPE} --datadir /work/xdcchain --networkid 50 -port 30303 --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcport 8545 --rpcvhosts "*" --unlock "${wallet}" --password /work/.pwd --mine --gasprice "1" --targetgaslimit "420000000" --verbosity 2 --rpcapi web3,XDPoS 2>&1 >>/work/xdcchain/xdc.log | tee --append /work/xdcchain/xdc.log

0 comments on commit e4fb9fa

Please sign in to comment.