Incentivized Testnet

Testnet is the mold that dictates the shape of our Mainnet.

Rolling Incentivized Testnet

As Dusk Network’s protocol evolves towards the next phase of Testnet, unique opportunities arise for those passionate (and savvy) enough to get involved in the process. The rolling Incentivized Testnet will be accompanied by a multitude of initiatives, each adding to the security of the network and opening the doors to compensation for participants but also educating the community on what is required to be a participant within the Dusk Network protocol. If you’re looking to spend your time strengthening the financial framework of the future while racking up rewards, keep reading to find out more about how to set-up your very own Dusk Network Testnet Node!






A step-by-step guide

Before we can run a node, we need to gather a couple of data points. We will need an address to send a starting amount of at least 1000 Dusk to and a provisioner key to give access to our staking contract. In the following steps we’ll explain how to go through the process of creating a wallet and gathering all the necessary information to run a node. This includes:

  1. Setting up your CLI Wallet
  2. Setting up your Node
  3. Staking your testnet DUSK

If you’re interested in participating, be sure to follow our blog and our official Twitter account, or get involved with other participants in our Dusk Network Discord channel. Our team is always available to answer questions in the dedicated ITN thread.

Setting up a Testnet Node

1WALLET

1NODE

3STAKE

In this step we’ll explain how to go through the process of creating a wallet and gathering all the necessary information to run a node.

Download the CLI Wallet from here for your respective operating system.

Unpack the tar.gz file and execute the rusk-wallet file.

Select the Create a new wallet option and fill in a password.

Note: If you’re running into issues on a local machine where you ran a testnet wallet before, delete your ~/.dusk/rusk-wallet folder.







You’re
now requested to back up your recovery phrase, please do so and do not share it with others.







Select the first address shown. The wallet will now show your balance (which will be 0 if you generated a new address) and display your Dusk testnet address. Copy this address somewhere for later use. 








Next, select the Export provisioner key-pair option. This option will export the public and private key pair used for the staking process. 


By default, it will be saved in the directory where the wallet CLI will store its data. This will be displayed.

Fill in a password to protect your provisioner key and navigate to the location where the keys are stored.



There should be two files now, a .key file and a .cpk file. Keep the .key file secret, do not share it with anyone. We will need this file later on for our node. Think of it like your consensus key, that you use to sign off on transactions.

The .cpk is a public key. We will need this one to give you access to testnet.

 

 






With these data points gathered, you’re ready to fill in the form for Node Decentralization I. You can find the form here.

We will ask you to send us:

- The Dusk testnet address, so we can send you 30K testnet Dusk to use for testnet staking.
- The .cpk file, so we can give you access to our current Testnet.
-Optionally, an Ethereum address to send your ERC20 Dusk rewards to, if you’re eligible for this round of ITN.

The team will try to send you testnet Dusk and give you access as soon as possible, this might take a while, please be patient. For questions, you’re invited to join our Discord and join our #nodes channel. In the meantime, let’s continue with setting up our node.

In this step we’ll be using Vultr, but the same can be replicated on DigitalOcean, AWS or any other cloud infrastructure provider. It is also possible to run the node on home infrastructure, this guide will not deal with those types of setups. We work under the assumption that you’ve already created an account for your respective service and topped it up with funds.

In this guide we’ll be using Vultr, but the same can be replicated on DigitalOcean, AWS or any other cloud infrastructure provider. It is also possible to run the node on home infrastructure, this guide will not deal with those types of setups.

We work under the assumption that you’ve already created an account for your respective service and topped it up with funds.

Firewall

The Dusk node makes use of the Kadcast protocol to communicate messages between nodes in the network. This bespoke protocol makes use of UDP and runs on a custom port. Due to the nature of how UDP works, Kadcast is not automatically port forwarded. Regardless of where the node is hosted, it is important that this is done.

Depending on the cloud provider, we will need to either add a firewall rule on the instance you’re running or add a firewall group. If you’re running a local setup, you will need to enable port forwarding in your router.


Vultr works with firewall rules. If you’re logged in, navigate to the firewall tab and click on the ‘+’ button.












Give
the firewall group a name and add it.














Add a new IPv4 rule, enabling the UDP protocol on port 9000 from anywhere. Click the ‘+’ to add it. Do the same for SSH on port 22 as well. We’ll use SSH and SFTP later to transfer our consensus key to our nod

















Next, we’ll deploy a new server instance. Navigate to the instances tab.

Click the Deploy Server button if you have no instances on Vultr. If you already have instances on Vultr, click on the ‘+’ button.










To increase
decentralization, we opted for the first round to be primarily run by cloud hosted nodes. Cloud providers allow you to pick many different countries to run a node in. To help us increase decentralization and geographical diversity, please pick one of the underrepresented regions. To get an idea of where the current nodes are run, see the charts page of our block explorer. We would also support our community to use other providers beyond the one shown in this guide.












The
cheapest Cloud Compute, General Purpose instance with Ubuntu 22.10 x64 should be enough to run a testnet node that only contributes to consensus. Select the option shown below.













At the bottom of the instance deploy page it’s possible to attach a firewall group to your instance. Select the group you set up before that gives access to Kadcast.




Click on Deploy Now to create your instance. This can take some time. On the instance overview, you should now see your instance being installed.








To reduce costs you can disabled Auto Backups. For ITN phase I, these should not be necessary.





Once
the deployment is done, the status of your instance should be Running.



If you click on the instance, you’ll get an overview showing all sorts of statistics and information about your instance. Take note of the icons on the top right:



First, restart the instance by clicking the circular arrow icon in the top right and wait until it’s done restarting. Next, click on the small icon at the top that allows you to access the command line of your server.
















A new window will appear, similar to this one: 


Use the information provided by Vultr to login to your server:






If you’ve logged in successfully, you should see the following information.




For ease of use, we’ve created a script to set up your node as a service on your server. Copy the following command:

curl --proto '=https' --tlsv1.2 -sSf https://dusk-infra.ams3.digitaloceanspaces.com/rusk/itn-installer.sh | sh







Note: Vultr doesn’t properly report your server’s public IP address. If you’re using DigitalOcean, you won’t run into this issue. If you’re using Vultr, type in nano /opt/dusk/services/rusk.conf.user. A text editor should pop up showing you two values: KADCAST_PUBLIC_ADDRESS and KADCAST_LISTEN_ADDRESS. The public address and listen address should match the IP address of your instance. If it doesn’t edit it and save by hitting CTRL + X and pressing Y to confirm.
Your server has no problems sending data to others now, but it does have a local firewall installed that blocks UDP data from coming in. To give access to others, you’ll need to update the UFW (firewall) rules. Run the following command:

ufw allow 9000:9005/udp

Note: Others can run their node on ANY port. It therefore makes sense to allow all network traffic on UDP. For the sake of simplicity we’d prefer and recommend everyone to run their nodes on port 9000 for ITN.


Click on the Clipboard button in the side menu, paste in the command and click on the Paste button.















The
tool should now type the command into the terminal for you. Focus on it and press enter. The command should now show you that it’s creating the Dusk node service and added a couple of files.


















The next step is to update the consensus key with yours. The key we exported back in the wallet CLI step will need to be renamed from 5Y..xx.key to consensus.keys. We will transfer it from your computer to the /opt/dusk/conf folder on your server. You can do this through a variety of ways, SSH, SFTP, SCP, but for ease of use we’ll use FileZilla. Install it and run the software. You should now have access to an interface similar to this one:


At the top of the window, you should see Host, Username, Password and Port. For the host, fill in the IP address of your instance. You can find this, and the username and password, in the overview of your instance. Fill in the details and use port 22. Click on Quickconnect. If you set the firewall permissions correctly at the start, and if you filled in the correct details, you should be able to access your servers file system.











Navigate to the Wallet CLI configuration folder on your local computer and select your renamed consensus key. On your node, navigate to the /opt/dusk/conf folder. Right click on the consensus.keys file and select upload. FileZilla will now ask you to overwrite the file on your server. Click on Ok.

If everything went correctly, FileZilla will tell you the file transferred successfully. The next step is to update the password used to access your consensus key. Move back to your servers terminal and paste in the following commands where <your_password> is the password you set for your consensus keys earlier:

echo 'DUSK_CONSENSUS_KEYS_PASS=<your_password>' > /opt/dusk/services/dusk.conf

note: remove < > from the password.

Once you’ve uploaded your consensus keys and set the password, you can run the node. Run the following commands to boot up Rusk and the Dusk node:

service rusk start

service dusk start




You can check the status of your node by running service rusk status and service dusk status. If everything works as expected, it should report your services as active (running). To find out more details on the actively running nodes, you can find the logs in the /var/log folder. There will be dusk.log, dusk.err, rusk.log, rusk.err files that can be viewed to see what the node is up to.

The node should now start gathering the chain state and participate in consensus. After a reboot, the services should restart automatically. You can now move on to the last step, staking testnet Dusk.























Now that we’ve configured and set up our node, we can move on to the final step: stake our testnet Dusk. 

Open the wallet CLI again and Access your wallet. Select the address you used before.

Your balance should have an amount of at least 1002 testnet DUSK to cover the minimum amount to stake and to pay for the gas fee. If this is the case, select the Stake Dusk option.







You will be prompted to stake a given amount. Do not stake everything, else you won’t be able to unstake or execute any further transaction. Fill in a safe gas limit of 2000000000. The default gas price is good. Once you’re done, proceed with the transaction.






Your transaction will be generated, this will take a couple of seconds. Once it goes through successfully, you can view your transaction on the block explorer.












You can also observe your current stake and accumulated rewards in the wallet CLI by selecting the Check existing stake option.



If this guide was followed correctly, your node should be participating in consensus and accumulate rewards starting December 1st, 2022.

To check if your node is syncing properly, launch this command:

tail -100 /var/log/dusk.log | grep 'Accepted'

If everything is ok, you should see something similar to:

{"generator":"xxRf7HtmFrcNqF8QpEpXmNqEePC7ftcrAGyavJQUv5mQrZKmS1GBazS1fbrftFbj5t6A19F4FComuyLcS9dVkgu8bE7vzA4QTfEUWWjLU9As9FaazE8ewVEBkAe4f8SeGny","height":3607,"iteration":1,"level":"info","msg":"Accepted block from provisioner","time":"2022-11-17T15:28:11Z"} {"generator":"rm6jwcM9xQChnVeHYw6W8HP7kW3E8nejgs4XhmKoYspQnrZL5dDcQjVR5e2UmbyNNF4DJDRdZGdYLgJfZ3qQXuhSCL6UTDkcQ2QEf6RW3aCtfqQMKCFMNaBsfNrZuzrP23Z","height":3608,"iteration":1,"level":"info","msg":"Accepted block from provisioner","time":"2022-11-17T15:28:11Z"}


Still have questions on how to set up your own node? Don’t hesitate to join our Discord Channel and post in the dedicated #Node thread for help. The team is always there to help!

Thank you for participating in the first phase of the Dusk Network Incentivized Testnet!




About Dusk Network

Dusk Network is the privacy blockchain for financial applications. A new standard for compliance, control, and collaboration. Our mission is to enable enterprises of any size to collaborate at scale, meet compliance requirements and ensure that personal and transaction data remains confidential.

Shape the future

Dusk Network is open source. Your contributions help make technology better for everyone, developers and non-developers alike.

Join us on GitHub