How To Run a Full Node on the Witnet Testnet

Miners gonna mine!

Adán Sánchez de Pedro
The Witnet Oracle Blog
4 min readMar 20, 2019

--

The Witnet testnet is open for anyone to join and test it by running their own full node. Running a node on the Witnet mainnet is not possible before the mainnet is released. Check out the community roadmap and save the dates!

You do not need to run a Witnet node to use Witnet from your Ethereum smart contracts. If you are a smart contracts developer, what you probably want is to connect your Ethereum contracts to external APIs using Witnet.

Running a Witnet node is as easy as it gets, thanks to Docker

The most convenient method for running a Witnet node is through the witnet/witnet-rust Docker image.

This docker image downloads and runs a witnet-rust node in the latest testnet in just a matter on seconds.

Starting a node is as easy as it gets:

docker run -d \
--volume ~/.witnet:/.witnet \
--name witnet_node \
--publish 21337:21337 \
witnet/witnet-rust

How to execute CLI commands on the running node

Then, you can run CLI commands on the running node with this simple one-liner. In this example, it will show many “nanowits” your node has mined so far:

docker exec witnet_node ./witnet node getBalance

The node operators docs contain a quick cheatsheet listing all the supported CLI commands.

Open your ports!

The best way to contribute to the growth and sustainability of the Witnet network is opening up the listening port of your node to the open Internet, so that other nodes in the network can download block chain data from yours and your transactions can be broadcast more quickly.

For this feature to be effective, you will also need your IP address to be static and public. If you are operating a node in your home network, you can request your ISP to assign you a static IP address and disable CGN on it.

Depending on your setup, this will normally imply changing the settings on your router or firewall so as to forward all incoming connections to port 21337 from your external IP into the IP of the device or interface where the node is running.

To check if the port is correctly opened, you can telnet your external IP with telnet "IP" 21337 from the Internet. You should see an incoming connection on the logs for which the handshake timeouts.

Join the node operators community!

The Witnet node operators community is really active and they are always happy to help onboard newcomers. Make sure to join us on Discord and Telegram!

What are the hardware requirements?

Witnet mining uses a probabilistic BFT-alike consensus algorithm — long story short: no Proof-of-Work is needed. In addition, witnet-rust is written in Rust, one of the most performant and secure programming languages. When compiled, the resulting binary is tailored to each specific platform, which guarantees near-zero overhead.

The hardware requirements for running a full node are thus incredibly low. Obviously, the more resources you spare when provisioning your machine, the better it will perform and the better it will stand the test of time.

This is a quick checklist on what to look for:

What about Witnet data requests?

As soon as your node is synced, it’ll be able to start resolving data requests from others. You can learn how to produce Witnet requests by following the tutorial on how to create a Bitcoin price feed using Ethereum and Witnet. In addition we will be soon releasing a user-friendly editor in the Sheikah desktop app that will enable to compose data requests and RADON scripts visually.

Want to know more about Witnet?

--

--

Adán Sánchez de Pedro
The Witnet Oracle Blog

@Witnet_io board member, CTO at @StamperyCo, founder of @LoquiIM. Microelectronics aficionado. I write code, give talks, make music, brew beer and laugh a lot.