Sentinel dVPN OpenVPN Node Hosting
October 25, 2018 ยท View on GitHub
This is a complete guide to enable a configure use the Sentinel dVPN OpenVPN Node on Linux with docker and share unused bandwidth to the Sentinel Network.
Setup Instructions
Here are the steps involved in getting a Sentinel dVPN OpenVPN Node up and running:
- Install docker
- Build/pull the Sentinel dVPN docker image
- Configure Node
Installing the latest version of docker in Ubuntu or Debian based releases
Below are the instructions on installing docker:
-
Install required dependencies to get docker installation script from get.docker.com
sudo apt install -y curlcurl -fsSL get.docker.com -o /tmp/get-docker.sh -
Run the downloaded script to setup & install docker
sudo sh /tmp/get-docker.sh -
Add current user to the docker group to give required access
sudo usermod -aG docker $USER
Running the Sentinel dVPN Node
You can set up and run VPN node in two ways:
- Quick Run - download docker image from Docker Hub
- DIY - build your own docker image from the Sentinel code repository
Method #1 [Download docker image from Docker Hub]
-
Navigate to the User's home directory
cd ~ -
Create a new folder to pull the docker image and run it
mkdir -p $HOME/.sentinel -
Pull the official Sentinel docker image from Docker Hub & configure the node
sudo docker run -it --privileged --mount type=bind,source=$HOME/.sentinel,target=/root/.sentinel -p 3000:3000 -p 1194:1194/udp sentinelofficial/sentinel-vpn-node
Method #2 [Build Your Own Docker Image]
Do-it-Yourself setup by building your own docker image
-
Navigate to the root folder or anywhere that you want to set up the project and download code from the repository
cd ~ -
Clone the Sentinel repository
git clone https://github.com/sentinel-official/sentinel.git -
Navigate to the folder with code to build the docker image
cd ~/sentinel/vpn-node-docker -
Build the docker image
sudo docker build --file Dockerfile.prod --tag sentinel-vpn-node --force-rm --no-cache . -
Navigate to the folder where the docker container was set up. In our case, it is the User's home directory.
mkdir -p $HOME/.sentinel -
Run the image and configure the node
sudo docker run -it --privileged --mount type=bind,source=$HOME/.sentinel,target=/root/.sentinel -p 3000:3000 -p 1194:1194/udp sentinel-vpn-node
Updating an existing Sentinel dVPN OpenVPN Node
-
Stop the running docker container
sudo docker stop $(sudo docker ps -aq -f ancestor=sentinelofficial/sentinel-vpn-node) -
Remove the older version of docker container
sudo docker rm -f $(sudo docker ps -aq -f ancestor=sentinelofficial/sentinel-vpn-node) -
Remove the older version of docker image
sudo docker rmi -f $(sudo docker images -aq -f reference=sentinelofficial/sentinel-vpn-node) -
Set the token value to an EMPTY STRING in the config file
Config file location: $HOME/.sentinel/config.data
Example: {"token": "", "enc_method": "AES-256-CBC", "account_addr": "0x656b756e6c6335302e676c343572357232786970", "price_per_gb": 125.0}
After completing the above steps please follow the instructions on Method #1 to get the node up and running again.
Helpful docker commands to interact with the Sentinel dVPN Node
-
list a running Sentinel dVPN Node:
sudo docker ps -
list both, running and stopped Sentinel dVPN Nodes:
sudo docker ps -a -
stop a particular Sentinel Node:
- run
sudo docker psand copy the Container ID. - run
sudo docker stop ContainerID
Note: stopping a dVPN Node does not remove the container
- run
-
remove a particular Sentinel dVPN Node:
sudo docker rm ContainerID_OR_ContainerNameNote: The Sentinel dVPN Node must be stopped to be removed. Alternatively, you can use the
-fflag to forcefully remove the Node if the node cannot be stopped. -
remove node using the force option
-f:sudo docker rm -f ContainerID_OR_ContainerName -
remove all stopped Sentinel dVPN Nodes:
sudo docker rm $(sudo docker ps -a -q) -
stop all the running dVPN Nodes and remove them:
sudo docker stop $(sudo docker ps -a -q) && sudo docker rm $(sudo docker ps -a -q)