How to host a Virtual Node

Did you know that you can run a virtual Node on your computer, or on a cloud instance? Below, you’ll find the instructions to hosting a vNode so you can join the Incognito Network and start earning crypto!

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, AWS, Vultr, Heroku, Microsoft Azure, or Linode.

Always check the TOS of the host for rules on “mining” cryptocurrency using their servers before you signup for one of their plans. Not every host allows you to run mining scripts.

Useful instructions:

The minimum server requirements are:

  • 4GB RAM

  • 4 CPUs

  • 50GB SSD

Remember: 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 Keychain

Tap the “Key” icon to get the details of your account.

Copy and save your VALIDATOR KEY somewhere. You’ll need it in STEP 3.

Before proceeding, copy and save your PRIVATE KEY safe and securely as well. You do not need the private key for running the Node, but it is the most important key of your node account. Without the private key of your node account, you will not be able to recover that account and regain access to your funds in case of a crash or other loss of your account.

Step 3: Run Incognito

In your terminal:

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

curl -LO https://node.incognito.org/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: eth_mainnet
Error: No such container: inc_mainnet
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…:slight_smile:

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 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

Tap “Assets” to manage your funds

Step 5: Monitor your node

You can easily monitor your Incognito nodes right from your phone. At the Nodes screen, tap Power

Tap “+” to start adding a new Node

Choose “Virtual Node

Enter your Node’s IP address (from Step 1), then click “Add”

The app locates your associated account accordingly.

Step 6: Stake

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

Tap “Stake”.

Review your information. Then tap “Stake 1750 PRV”.

Wait 2-5 minutes, then restart the app.

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

IMPORTANT NOTE: Please KEEP YOUR PRIVATE KEY SAFE because anyone who has it can access your funds. You’ll also need it if you have to re-install the mobile app.

See also: https://incognito.org/t/how-to-back-up-your-private-key/235

37 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.

3 Likes

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

8 Likes

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?

2 Likes

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

4 Likes

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.

1 Like

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

8 Likes

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?

3 Likes

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

3 Likes

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

This: How to host a Virtual Node

2 Likes

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

4 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.

3 Likes

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:

[email protected]:~# 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

7 Likes

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

2 Likes

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

3 Likes

I tagged his username. Is it OK?

2 Likes

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
11 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.

2 Likes

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

2 Likes

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.

2 Likes