Gravity node: one-click deployment

Gravity Protocol
Gravity Protocol
Published in
6 min readSep 4, 2020

--

UPD: As part of the series of announcements about Gravity Dev Net launch, we have updated this article to walk you through the modified process of deploying a node on the Gravity network.

In the first two articles, we presented SuSy, a cross-chain gateway for tokens, and a framework for integration tests that can enable quick target chain integration into the Gravity network. This final article in the series describes images for launching a node on a one-click-deployment cloud platform or on any custom cloud provider.

For any open-entry decentralized network, it is crucial to implement an easy enrollment process expanding at a sufficient pace, while at the same time maintaining checks and balances to ensure the system’s overall stability. The Gravity team has developed a smooth one-click node hosting scheme at Linode to warrant the safety of your private keys and set you up as a Gravity service provider in no time.

What is the Gravity Network?

The Gravity network, an ultimate inter-chain solution, provides maintainers with a novel monetizing infrastructure as a more lucrative alternative to mining. Suppliers of Gravity services can earn by putting their server capacities to use and automatically handling data-related tasks assigned to nodes. For their work, they will be rewarded in native tokens of Gravity target-chains.

The Gravity network operation enables consumers to receive required information, for which they pay by keeping a steady amount of tokens on the nodes’ supplier accounts.

A Gravity node is an essential component of the Gravity decentralized network. In a nutshell, it is a middleware that operates accounts in target blockchains and in the internal ledger. Every node is created of the same modules, such as information extractors, a task scheduler and various connectors to target blockchains. Unlike monolithic blockchain nodes in Ethereum or Waves, Gravity nodes are made of different modules, supporting various kinds of information sources out of the box.

A quick intro into node structure

Although a Gravity node can be deployed in a couple of clicks, it is useful to peruse its inner structure and principles of operation to know, specifically, what a Gravity extractor is. If you’d like to see how node deployment would work right away, skip to the next section.

As stated in the Gravity white paper, Gravity nodes are non-isomorphic, meaning that providers can freely choose to work in one or several target chains, or to implement extractors not for all possible data feeds, but only for a relevant subset. The main components of a Gravity node are the core, responsible for all business logic implementing the protocol, and so-called data feed extractors.

Each node has a public key in each of the supported target blockchains and in the internal ledger. The key logic of the Gravity node for reputation calculations, consensus operations, aggregation and coordination of the rest of the components is implemented in the core module. Extractors are services that request and process data feeds from external sources. One extractor corresponds to one data feed supported by the node but can use and combine multiple data sources.

Gravity nodes communicate with each other through the account communicator module by sending transactions in the internal distributed ledger. The internal ledger is also used to read logs of messages from other nodes.

Data feeds supported by a Gravity node can be described as a boilerplate source code or as an implementation in the form of a data extractor. Each extractor collects data in accordance with the specification for the required data. The specification defines:
● where to obtain data from (recommended sources or mandatory sources)
● how to process data points received from different sources (e.g. aggregate them as median,
average or mode over a certain period of time)
● the format in which data will be delivered to customers in target blockchains.

Extractor services are managed and run independently on the servers of Gravity node operators. Along with standard implementations of extractors, each operator of a Gravity node can develop and use custom implementations of extractors according to the described specification. The development of the specification, documentation or implementation of extractors are managed as part of the open-source development flow by Gravity developers.

To allow for testing of a Gravity node before a full devnet release, we provide easy and safe deployment options with Linode, an established cloud hosting and VPS provider. Below is a one-click deployment manual of a Gravity price extractor using the Linode hosting service.

Gravity node one-click deployment on Linode

To deploy a Gravity node, sign up to Linode first. Please, note that you may be asked to provide billing information and may need to wait for your account to be reviewed and approved by the Linode staff.

Deployment options

1. Gravity node Stackscript

Link to Stackscript: Gravity Node Stackscript

To simplify the setup of a new machine, Linode provides StackScripts — scripts that enable initial server configuration on the first boot-up. After successful registration on Linode, you will be able to navigate Stackscripts made by the community. Find and select the “Gravity node” Stackscript from the list and click “Deploy new Linode”. Make sure that the author of the Stackscript is “riotpurpp”.

Expand the “Details” section of the selected Stackscript and follow the steps described there: choose a suitable instance image for the template (supported images are included in the Stackscript description), select a server region and a root password. The server boot-up process usually takes five to seven minutes.

2. Manual deployment

In order to run Gravity Node manually, consider looking through the docs:

Gravity Node deployment manual

Manual deployment will let you configure all available options while starting the node. Most of them have default values.

Configuring Gravity Node

After the server’s successful boot-up, access its IP address in your web browser on port 8111 to proceed with the key generation steps and password setup.

On the web page, you will be asked to type in a password to access the Gravity node.

Note: the Gravity node can only be accessed by the owner of private keys automatically generated during the configuration process. No one else in the network has access to private keys and seed phrases.

After submitting a password, the node will use the generated keys and seed phrases. In addition, it is highly recommended that you download and store generated keys config backup in case the password is lost.

By clicking “Deploy Node”, you will launch the Gravity node deployment.

If you want to download private data once again, you need to enter the password you’ve entered before.

Once you’ve downloaded a secured file with private keys, make sure to send us your public ledger key. Consuls will vote for your node in order to set an initial score. This constraint is vital for proper work of the node in the system.

Congratulations, you have successfully tested the deployment of a Gravity node! You are now ready to integrate into the Gravity network. To dive deeper into the technical specifications of Gravity nodes, extractors and methods to create custom implementations, please read Gravity documentation.

Docker Registry

We maintain our Docker Hub registry, where you can build your own images on top of those provided by us.

Docker Registry

For more information, you can read the Gravity Whitepaper, visit the Gravity website, join the community on Twitter or Telegram or contact press@gravity.tech

--

--

Gravity Protocol
Gravity Protocol

Gravity is a blockchain-agnostic cross-chain communication and data oracles protocol. https://gravity.tech/