Home

Run Dijets Node Manually

The quickest way to learn about Dijets is to run a node and interact with the network.

In this tutorial, we will:

  • Install and run a Dijets node
  • Connect to Dijets Network

This tutorial is primarily geared towards developers and people interested in how the Dijets Platform works. If you're just interested in setting up a node for staking, you may use the DijetsNodeGo installer script. Installer automates the installation process and sets it up as a system service, which is recommended for unattended operation. You may also try things out by following this tutorial first, and then later set up the node using the installer as a permanent solution.

Requirements#

Computer Hardware and OS#

Dijets is an incredibly lightweight protocol, so nodes can run on commodity hardware. Note that as network usage increases, hardware requirements may change.

  1. RAM: 16 GiB
  2. Storage: 250-500 GiB
  3. CPU: Equivalent of 8 AWS vCPU
  4. Operating System: Ubuntu 20.04 or MacOS >= 12

Networking#

To run successfully, a Dijets Node needs to accept connections from the Internet on the network port 9651. Before you proceed with the installation, you need to determine the networking environment your node will run in.

Running on a Cloud Provider

If your node is running on a cloud provider computer instance, it will have a static IP. Find out what that static IP is, or set it up if you didn't already.

Running on a Home Connection

If you're running a node on a computer that is on a residential internet connection, you have a dynamic IP; that is, your IP will change periodically. You will need to set up inbound port forwarding of port 9651 from the internet to the computer the node is installed on.

Running a Dijets Node#

Let’s install DijetsNodeGo, the Golang implementation of a Dijets node, and connect to the Dijets primary network.

Download DijetsNodeGo#

The node is a binary program. You can either download the source code and then build the binary program, or you can download the pre-built binary. You don’t need to do both.

Building the node from source is recommended if you're a developer looking to experiment and build on Dijets.

Source Code

First install Go 1.18.1 or later. Follow the instructions here. You can verify by running go version.

Set $GOPATH environment variable properly for Go to look for Go Workspaces. Please read this for details. You can verify by running echo $GOPATH.

Download the DijetsNodeGo repository into your $GOPATH:


_10
cd $GOPATH


_10
mkdir -p src/github.com/Dijets-Inc


_10
cd src/github.com/Dijets-Inc


_10
git clone git@github.com:Dijets-Inc/dijetsnodego.git


_10
cd dijetsnodego

Build DijetsNodeGo:


_10
./scripts/build.sh

The binary, named dijetsnodego, is in dijetsnodego/build. If you've followed the instructions so far, this will be within your $GOPATH at: $GOPATH/src/github.com/Dijets-Inc/dijetsnodego/build.

To begin running DijetsNodeGo, run the following (hit Ctrl+C to stop your node):


_10
./build/dijetsnodego

Dijets Node Binary


_10
Download: dijetsnodego-macos-<VERSION>.zip
_10
Unzip: unzip dijetsnodego-macos-<VERSION>.zip
_10
The resulting folder, dijetsnodego-<VERSION>, contains the Dijets Node binaries.

Start a Node, and Connect to Dijets Mainnet#

If you built Dijets node binary from source, run:


_10
./build/dijetsnodego

By default this node will connect to Dijets Mainnet.

When the node starts, it has to catch up with the rest of the network in a process called bootstrapping. Your node will have successfully finished bootstrapping when it prints logs as follows:


_10
[01-02|10:20:15.195] INFO <Utility Chain> cacid/transitive.go:392 consensus starting {"lastAcceptedBlock": "2ksGoFVpnDCbFKX4jRpJwH8EFws33Q2yC1HhWgAiy3tGrpDSxc"}
_10
[01-02|10:20:16.102] INFO <Method Chain> cacid/transitive.go:392 consensus starting {"lastAcceptedBlock": "2nhvXBcLAzeloCPEMv6aHGvZ30oa1SBp1reEm7gNxvFjnfKADV"}
_10
[01-02|10:20:21.303] INFO <Value Chain> dijets/transitive.go:334 consensus starting {"lenFrontier": 1}

Run the following command in a separate terminal to check if a given chain has finished the bootstrapping process:


_10
curl -X POST --data '{
_10
"jsonrpc":"2.0",
_10
"id" :1,
_10
"method" :"info.isBootstrapped",
_10
"params": {
_10
"chain":"Value"
_10
}
_10
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info

If this returns true, the chain is bootstrapped; otherwise, it returns false. If you make other API calls to a chain that is not done bootstrapping, it will return API call rejected because chain is not done bootstrapping. If you are still experiencing issues please contact us on Qowalts

Your node is running and connected now. If you want to use your node as a validator on the mainnet and earn rewards for helping secure the network.

You can use Ctrl + C to kill the node.

To be able to make API calls to your node from other machines, when starting up the node include argument --http-host= (for example ./build/dijetsnodego --http-host=)

Connect to Dijets Testnet

To connect to the Dijets Testnet instead of the Mainnet, use argument --network-id=dijets-testnet. You can get funds on Dijets Testnet from Dijets Faucet.

What Next?#

A fully bootstrapped Node on Dijets network is capable of performing consensus on its own. However, the rest of the network will not query your node for sampling purposes when trying to reach consensus. Only the validator nodes are queried for sampling during consensus.

Now that you have successfully launched your Node, you can learn how to add it as a Validator on Dijets Network. Check out Add a Validator for a step-by-step guide on how to become a Validator.