How to host a Virtual Node

Run a virtual node on your computer, or on a cloud instance such as AWS. Here are the instructions.

Block rewards are paid out in PRV and transacted currencies, such as pBTC, pETH, pBNB and more.

Step 1: Set up your server

You can run Incognito on a low-cost server. If you don’t have a server yet, it’s really simple and takes just a couple of minutes. You can set up an account with a VPS provider or a cloud service provider like DigitalOcean, Google Cloud, AWS or Vultr, Linode. It is highly recommended to set up your server with DigitalOcean Instance.

Useful instructions:

The minimum server requirements are 4GB RAM, 4 CPUs, and 100GB SSD. For example, if you use Google Cloud Instance, the Machine type should be “n1-highcpu-4”.

Save YOUR SERVER EXTERNAL IP ADDRESS. You’ll need it in Step 5.

Step 2: Create your account

Download the Incognito App

Android
iOs

Open the app and it will automatically generate a wallet for you.

Tap on Settings (Gear icon).

03

09

Copy YOUR INCOGNITO ADDRESS and your VALIDATOR KEY (keep them safe!). You’ll need them in STEP 3 and 4.

24

Step 3: Run Incognito

In your terminal:

Run this command line below. Replace validator_key with your VALIDATOR KEY (from Step 1).

curl https://node.incognito.org/run.sh > run.sh && sed -i s/xxx/validator_key/ run.sh && sudo bash run.sh

If you see the following errors, just ignore them. You’re doing good.

Error: No such container: inc_miner
Error: No such container: inc_kovan
Error response from daemon: network with name inc_net already exists

For the curious, because Incognito is integrated with Ethereum (so you can send ETH and ERC20 tokens privately), its error messages show up here. There’s nothing much we can do about it. Move on.

Advanced set up: customize the port of your Node

The default rpc port is 9334 and node port is 9433. To change it, please follow these steps:

  1. In your terminal:
  • Open the file run.sh by this command:

nano run.sh

  • Add the following param in docker command (replace node_port, rpc_port correspond to the port you want)

docker run … -p <node_port>:<node_port> -p <rpc_port>:<rpc_port> …

  • Then run the following command

(replace rpc_port, node_port with yours):rpc_port=9334 node_port=9433 ./run.sh

  1. On the app:

Separate the IP of your Virtual Node and the customized port by a colon before adding the Node.
For example: 123.456.7.8:9335

42

Step 4: Get Privacy Token (PRV) to stake

Privacy (PRV) is the native coin of the Incognito Network. To become a validator, you’ll need to stake the minimum 1,750 PRV. You can purchase PRV on the Incognito pDEX using BTC or ETH (more currencies coming soon).

How to buy PRV: pDex Instruction

Step 5: Monitor your node

You can easily monitor your Incognito nodes right from your phone.

55

Tap “Add a Virtual Node”

Enter your Node’s IP address, then click “Add”

42

Step 6: Stake

Almost there! Now, that you’ve got PRV, all you have to do is stake. Remember, you need to stake at least 1,750 PRV to begin earning rewards.

Tap on the Node you want to stake

Tap “Run” to start staking

00

Select fee & speed as you want, then tap “Stake”

15

28

37

Congrats! You’re officially part of the network. Welcome to Incognito :slight_smile:

IMPORTANT NOTE: Please keep your PRIVATE KEY as SAFE because anyone who has it can access your funds. You may need it once you re-install the mobile app.

54

2 Likes

How much effective is SSD on joining committee, earning PRV etc.? I use HDD nearly for two months and I earned well for the first month but I earned nothing within the second month.

HI:)
I create a new server vNode…
Why a mistake?photo_2020-02-09_01-40-21photo_2020-02-09_02-08-48

I think this tutorial has more details on running multiple nodes on the same machine. Advanced setup shows how to change port but after I examine run.sh, I’ve seen some other ports which are probably used by eth_mainnet docker. Without changing those ports, will my nodes in different folders work?

I can’t see your complete command, but you seem to have some weird characters right after the validator key. Could you check?

I don’t have to tell you SSD is faster than HDD.
The speed difference becomes more important when more data is involved.

If communication with your node takes too long, your node could be considered unstable and skipped for being selected to earn. The more stable your Node is, the less likely it is skipped.

That said, the increasing number of Nodes online also has an impact on the chance of being selected.

curl https://node.incognito.org/run.sh > run.sh && sed -i “s/xxx/validator_key/” run.sh && sudo bash run.sh
Thanks!

I had to reinstall a vnode. When I run the curl command with validator key, I immediately get this error:

run.sh: line 1: syntax error near unexpected token ‘new line’
run.sh: line 1: ‘’

I cannot get around this error. Any ideas?

Should we run this new command on an existing vnode that has the old command? I can see the inc_logshipper is missing.

I hope my question isn’t lost in the crowd :slight_smile:

This: How to host a Virtual Node

Hi JG20, we just updated the command. From now, please use this: curl https://node.incognito.org/run.sh > run.sh && sed -i “s/xxx/validator_key/” run.sh && sudo bash run.sh

2 Likes

Hi JG20, if your current vNode is running normally. There is no need to run this new command. The inc_logshipper is removed to save up some spaces.

I think this tutorial has more details on running multiple nodes on the same machine. Advanced setup shows how to change port but after I examine run.sh, I’ve seen some other ports which are probably used by eth_mainnet docker. Without changing those ports, will my nodes in different folders work?

Hi abduraman

You need at least one eth_mainnet docker container running on one virtual machine. An eth_mainnet docker container can be used to serve multiple incognito_mainnet containers on the same virtual machine.
I suggest that you should NOT change the eth_mainnet port.

For Example:

root@khanhlh:~# docker ps
CONTAINER ID        IMAGE                                         COMMAND                  CREATED             STATUS              PORTS                                                                                                                               NAMES
cc190c872a42        incognitochain/incognito-mainnet:20200205_1   "/bin/sh run_incogni…"   About an hour ago   Up About an hour    0.0.0.0:9334->9334/tcp, 0.0.0.0:9433->9433/tcp                                                                                      inc_mainnet_1
4ab8ef0133c6        incognitochain/incognito-mainnet:20200205_1   "/bin/sh run_incogni…"   About an hour ago   Up About an hour    0.0.0.0:9335->9334/tcp, 0.0.0.0:9434->9433/tcp                                                                                      inc_mainnet_2
9b0f9bc25b47        parity/parity:stable                          "/bin/parity --light…"   About an hour ago   Up About an hour    5001/tcp, 8080/tcp, 8082-8083/tcp, 8180/tcp, 0.0.0.0:8545->8545/tcp, 8546/tcp, 0.0.0.0:30303->30303/tcp, 0.0.0.0:30303->30303/udp   eth_mainnet

You can see that i use one eth_mainnet to serve both inc_mainnet_1 and inc_mainnet_2

1 Like

In that case, just changing the ports of inc_mainnet in run.sh is not enough for the case of “multiple nodes in the same machine”, is it? I should remove “docker run” lines for log_shipper and eth_mainnet. Or no need for this? The best, could you send your run.sh? :slight_smile: @khanhj

Hi Abduraman, I think @khanhj is the one who can give you a correct answer. Would you please share your words, @khanhj?

1 Like

I tagged his username. Is it OK?

Hi @abduraman,

In that case, just changing the ports of inc_mainnet in run.sh is not enough for the case of “multiple nodes in the same machine”, is it? I should remove “docker run” lines for log_shipper and eth_mainnet. Or no need for this? The best, could you send your run.sh?

Let’s keep your 1st run.sh file as default, we are going to edit the 2nd one.

  1. Rename the 2nd run.sh to run_2.sh
  2. Edit the run_2.sh
validator_key=YourValidatorKey
data_dir="data_2"
#eth_data_dir="eth-mainnet-data"
#eth_data_dir_geth="eth-mainnet-data-geth"
#logshipper_data_dir="logshipper-mainnet-data"

node_port="9434"
rpc_port="9335"

#if [ ! -d "$PWD/${eth_data_dir}" ]
#then
#  mkdir $PWD/${eth_data_dir}
#  chmod -R 777 $PWD/${eth_data_dir}
#fi

docker rm -f inc_mainnet_2
#docker rm -f eth_mainnet
#docker run -ti --restart=always --net inc_net -d -p 8545:8545  -p 30303:30303 -p 30303:30303/udp -v $PWD/${eth_data_dir}:/home/parity/.local/share/io.parity.ethereum/ --name eth_mainnet  parity/parity:stable --light --jsonrpc-interface all --jsonrpc-hosts all  --jsonrpc-apis all --mode last --base-path=/home/parity/.local/share/io.parity.ethereum/

docker run --restart=always --net inc_net -p $node_port:$node_port -p $rpc_port:$rpc_port -e NODE_PORT=$node_port -e RPC_PORT=$rpc_port -e BOOTNODE_IP=$bootnode -e GETH_NAME=eth_mainnet -e MININGKEY=${validator_key} -e TESTNET=false -v $PWD/${data_dir}:/data -d --name inc_mainnet_2 incognitochain/incognito-mainnet:${latest_tag}

ps aux | grep '[r]un_2.sh' | awk '{ print $2}' | grep -v "^$$\$" | xargs kill -9
  1. run the run_2.sh as normal: sudo bash run_2.sh

You can get my sample run_2.sh here:

Important: In order to run 2 nodes on a server, your server specs should meet the following requirement:

  • 8 CPUs
  • 4 GBs of RAM
  • 500 GBs of SSD
3 Likes

I got 3 errors:

1- Error: No such container: inc_mainnet2
2- Error response from daemon: network with name inc_net already exists
3- docker: Error response from daemon: Conflict. The container name “/inc_logshipper” is already in use by container “fee43127e869d6f0b5acd2a660d46836463710b281f7b88e0cd28959b813857d”. You have to remove (or rename) that container to be able to reuse that name.

I ignore all of them :slight_smile: Is it OK? 1 and 2 are the ones you specified before. To prevent 3, we should have commented out the following lines:

if [ $is_shipping_logs -eq 1 ]
  then
    if [ ! -d "$PWD/${logshipper_data_dir}" ]
    then
      mkdir $PWD/${logshipper_data_dir}
      chmod -R 777 $PWD/${logshipper_data_dir}
    fi
    docker image rm -f incognitochain/logshipper:1.0.0
    docker run --restart=always -d --name inc_logshipper -e RAW_LOG_PATHS=/tmp/*.txt -e JSON_LOG_PATHS=/tmp/*.json -e LOGSTASH_ADDRESSES=34.94.14.147:5000 --mount type=bind,source=$PWD/${data_dir},target=/tmp --mount type=bind,source=$PWD/${logshipper_data_dir},target=/usr/share/filebeat/data incognitochain/logshipper:1.0.0
  fi

OR

set

is_shipping_logs=0

I checked your sample run.sh. It is correct. No problem there.

Hey @abduraman,

Seem like it worked on your machine, in detail:

  1. on the first time you run sudo bash run_2.sh, it will try to remove the container inc_mainnet_2, since it not existed before, the error shown. => can you show me the output of sudo docker ps ?

  2. inc_net already created when you run sudo bash run.sh (the 1st run.sh) => ignore this error

  3. the inc_logshipper is used for analytic, but the team no longer need it => ignore this error

Hey @khanhj ,

CONTAINER ID        IMAGE                                         COMMAND                  CREATED             STATUS              PORTS                                                                                                                               NAMES
3cbb737605ec        incognitochain/incognito-mainnet:20200205_1   "/bin/sh run_incogni…"   20 minutes ago      Up 20 minutes       0.0.0.0:9335->9335/tcp, 0.0.0.0:9434->9434/tcp                                                                                      inc_mainnet2
fee43127e869        incognitochain/logshipper:1.0.0               "/usr/local/bin/dock…"   6 weeks ago         Up 10 days                                                                                                                                              inc_logshipper
f788fcd2742b        incognitochain/incognito-mainnet:20191227_1   "/bin/sh run_incogni…"   6 weeks ago         Up 10 days          0.0.0.0:9334->9334/tcp, 0.0.0.0:9433->9433/tcp                                                                                      inc_mainnet
994da074e85c        parity/parity:stable                          "/bin/parity --light…"   6 weeks ago         Up 10 days          5001/tcp, 8080/tcp, 8082-8083/tcp, 8180/tcp, 0.0.0.0:8545->8545/tcp, 8546/tcp, 0.0.0.0:30303->30303/tcp, 0.0.0.0:30303->30303/udp   eth_mainnet

I think no problem since I tap “Stake” button and it seems working.