Docs

Docs

  • Develop
  • Validate
  • Integrate
  • Learn

›Integrators

Welcome to Elrond

  • Welcome to Elrond

Technology

  • Architecture Overview
  • Glossary
  • Entities
  • Chronology
  • Secure Proof of Stake
  • Adaptive State Sharding
  • The Elrond WASM VM
  • Cross Shard Transactions

Wallet

  • Wallets - Overview
  • Web Wallet
  • Maiar Web Wallet Extension
  • Webhooks
  • Ledger

Tokens

  • Native Tokens
  • ESDT tokens
  • NFT tokens

Validators

  • Validators - Overview
  • System Requirements
  • Install a Mainnet Node

    • Scripts & User config
    • Installing a Validator Node
    • Optional Configurations
    • How to use the Docker Image

    Install a Testnet/Devnet Node

    • Scripts & User config
    • Installing a Validator Node
    • Manage a validator node
    • How to use the Docker Image

    Manage your keys

    • Validator Keys
    • Wallet Keys
    • Protecting your keys

    Staking, Unstaking, Unjailing

    • Staking, unstaking and unjailing
    • Staking
    • Unjailing
    • The Staking Smart Contract
  • The Delegation Manager
  • Convert An Existing Validator Into A Staking Pool
  • Merging A Validator Into An Existing Delegation Smart Contract
  • Rating
  • Elrond Node upgrades
  • Node redundancy
  • Import DB
  • Node CLI
  • Node Databases
  • Useful Links & Tools
  • FAQs

Developers

  • Developers - Overview
  • Tutorials

    • Build a dApp in 15 minutes
    • Build a Microservice for your dApp
    • The Crowdfunding Smart Contract (part 1)
    • The Crowdfunding Smart Contract (part 2)
    • The Counter Smart Contract
    • Custom Wallet Connect

    Signing Transactions

    • Signing Transactions
    • Tools for signing
    • Signing programmatically

    Gas and Fees

    • Overview
    • EGLD transfers (move balance transactions)
    • System Smart Contracts
    • User-defined Smart Contracts

    Developer reference

    • The Elrond Serialization Format
    • Smart contract annotations
    • Smart contract modules
    • Smart contract to smart contract calls
    • Smart Contract Developer Best Practices
    • Code Metadata
    • Smart Contract API Functions
    • Storage Mappers
    • Rust Testing Framework
    • Rust Testing Framework Functions Reference
    • Rust Smart Contract Debugging
    • Random Numbers in Smart Contracts

    Developers Best Practices

    • Basics
    • BigUint Operations
    • The dynamic allocation problem
    • Multi-values

    Mandos tests reference

    • Mandos Overview
    • Mandos Structure
    • Mandos Simple Values
    • Mandos Complex Values
    • Embedding Mandos code in Go
  • Constants
  • Built-In Functions
  • Account storage
  • Setup a Local Testnet
  • Set up a Local Testnet (advanced)
  • Creating Wallets

SDK and Tools

  • SDKs and Tools - Overview
  • REST API

    • REST API overview
    • api.elrond.com
    • Gateway overview
    • Addresses
    • Transactions
    • Network
    • Nodes
    • Blocks
    • Virtual Machine
    • Versions and Changelog
  • Proxy
  • Elasticsearch
  • erdpy

    • erdpy
    • Installing erdpy
    • Configuring erdpy
    • erdpy CLI
    • Deriving the Wallet PEM file
    • Sending bulk transactions
    • Writing and running erdpy scripts
    • Smart contract interactions

    erdjs

    • erdjs
    • Cookbook
    • Extending erdjs
    • Writing and testing interactions
    • Migration guides
    • Signing Providers for dApps
  • erdgo
  • erdcpp
  • erdjava
  • erdkotlin
  • erdwalletjs-cli

Integrators

  • Integrators - Overview
  • EGLD integration guide
  • ESDT tokens integration guide
  • Observing Squad
  • Accounts Management
  • Creating Transactions
  • Querying the Blockchain

Observing Squad

The N+1 setup for connecting to the Elrond Network

In order to integrate with the Elrond Network and be able to broadcast transactions and query blockchain data in an optimized approach, one needs to set up an on-premises Observing Squad.

An Observing Squad is defined as a set of N Observer Nodes (one for each Shard, including the Metachain) plus an Elrond Proxy instance which will connect to these Observers and provide an HTTP API (by delegating requests to the Observers).

tip

Currently the Elrond Mainnet has 3 Shards, plus the Metachain. Therefore, the Observing Squad is composed of 4 Observers and one Proxy instance.

By setting up an Observing Squad and querying the blockchain data through the Proxy, the particularities of Elrond's sharded architecture are abstracted away. This means that the client interacting with the Proxy does not have to be concerned about sharding at all.

System requirements

The Observing Squad can be installed on multiple machines or on a single, but more powerful machine.

In case of a single machine, our recommendation is as follows:

  • 16 x CPU
  • 32 GB RAM
  • Disk space that can grow up to 5 TB
  • 100 Mbit/s always-on Internet connection
  • Linux OS (Ubuntu 20.04 recommended)

The recommended number of CPUs has been updated from 8 to 16 in April 2021, considering the increasing load over the network.

tip

These specs are only a recommendation. Depending on the load over the API or the observers, one should upgrade the machine as to keep the squad synced and with good performance.

Setup via the Mainnet scripts

Installation and Configuration

The Observing Squad can be set up using the installation scripts. Within the installation process, the LookupDatabaseExtension feature (required by the Hyperblock API) will be enabled by default.

Clone the installer repository:

git clone https://github.com/ElrondNetwork/elrond-go-scripts-mainnet.git

Edit config/variables.cfg accordingly. For example:

CUSTOM_HOME="/home/ubuntu"
CUSTOM_USER="ubuntu"

Additionally, you might want to set the following option, so that the logs are saved within the logs folder of the node:

NODE_EXTRA_FLAGS="-log-save"

Please check that the CUSTOM_HOME directory exists. Run the installation script as follows:

./script.sh observing_squad

After installation, 5 new systemd units will be available (and enabled).

Start the nodes and the Proxy using the command:

./script.sh start

In order to check the status of the Observing Squad, please see the section Monitoring and trivial checks below.

Upgrading the Observing Squad

The Observing Squad can be updated using the Mainnet installation scripts.

April 2021 upgrade

In order to upgrade the Observing Squad - that is, both the Observers and the Proxy, one should issue the following commands:

$ cd ~/elrond-go-scripts-mainnet
$ ./script.sh github_pull
$ ./script.sh stop
$ ./script.sh upgrade_squad
$ ./script.sh upgrade_proxy
$ ./script.sh start

March 2021 upgrade

In order to upgrade the Observing Squad - that is, both the Observers and the Proxy, one should issue the following commands:

$ cd ~/elrond-go-scripts-mainnet
$ ./script.sh github_pull
$ ./script.sh stop
$ ./script.sh upgrade_squad
$ ./script.sh upgrade_proxy
$ ./script.sh start

January 2021 upgrade

In order to upgrade the Observing Squad - that is, both the Observers and the Proxy, one should issue the following commands:

$ cd ~/elrond-go-scripts-mainnet
$ ./script.sh github_pull
$ ./script.sh stop
$ ./script.sh upgrade_squad
$ ./script.sh upgrade_proxy
$ ./script.sh start

Prerequisites for the November 2020 upgrade

Observing Squads set up before November 2020 have been installed using a special branch of the Mainnet installation scripts: exchanges-integration. This special branch has been removed, in favor of the main branch of the installation scripts.

In order to upgrade an Observing Squad set up before November 2020, one has to first follow these steps:

$ cd ~/elrond-go-scripts-mainnet
MANUALLY BACKUP FILE config/variables.cfg

# IN ORDER TO ALLOW THE SUBSEQUENT SWITCH TO MAIN BRANCH
$ git checkout config/variables.cfg
# SWITCH TO MAIN BRANCH
$ git checkout master

MANUALLY RESTORE FILE config/variables.cfg

After following the steps above, the upgrade procedure shall continue as described in the next section.

General upgrade procedure

In order to upgrade the Observing Squad - that is, both the Observers and the Proxy, one should issue the following commands:

$ cd ~/elrond-go-scripts-mainnet
$ ./script.sh github_pull
$ ./script.sh stop
$ ./script.sh upgrade_squad
$ ./script.sh upgrade_proxy
$ ./script.sh start

After running the commands above, the upgraded Observing Squad will start again. The expected downtime is about 2-3 minutes.

Monitoring and trivial checks

One can monitor the running Observers using the termui utility (installed during the setup process itself in the CUSTOM_HOME="/home/ubuntu" folder), as follows:

~/elrond-utils/termui --address localhost:8080    # Shard 0
~/elrond-utils/termui --address localhost:8081    # Shard 1
~/elrond-utils/termui --address localhost:8082    # Shard 2
~/elrond-utils/termui --address localhost:8083    # Metachain

Alternatively, one can query the status of the Observers by performing GET requests using curl:

curl http://localhost:8080/node/status | jq    # Shard 0
curl http://localhost:8081/node/status | jq    # Shard 1
curl http://localhost:8082/node/status | jq    # Shard 2
curl http://localhost:8083/node/status | jq    # Metachain

The Proxy does not offer a termui monitor, but its activity can be inspected using journalctl:

journalctl -f -u elrond-proxy.service

Optionally, one can perform the following smoke test in order to fetch the latest synchronized hyperblock:

export NONCE=$(curl http://localhost:8079/network/status/4294967295 | jq '.data["status"]["erd_highest_final_nonce"]')
curl http://localhost:8079/hyperblock/by-nonce/$NONCE | jq

Setup via Docker

The Observing Squad can be also set up using Docker.

Clone the Observing Squad repository:

git clone https://github.com/ElrondNetwork/observing-squad.git

Install docker-compose if not already installed:

apt install docker-compose

Install and run the whole Observing Squad using the ./start_stack.sh script from the mainnet folder:

cd mainnet
./start_stack.sh

In order to check if the Observing Squad is running, you can list the running containers:

docker ps

In order to check the status inside a container, you can check the logs on the machine for the last synchronized block nonce:

docker exec -it 'CONTAINER ID' /bin/bash
cat logs/elrond-go-.......log

More detailed commands for installing, building and running an Observing Squad using Docker are described here. The images (for the Proxy and for the Observers) are published on Docker Hub.

← ESDT tokens integration guideAccounts Management →
  • System requirements
  • Installation and Configuration
  • Upgrading the Observing Squad
    • April 2021 upgrade
    • March 2021 upgrade
    • January 2021 upgrade
    • Prerequisites for the November 2020 upgrade
    • General upgrade procedure
  • Monitoring and trivial checks
Made withby the Elrond team.
GithubChat
Main siteWalletExplorerBridgeDocsGrowthMaiarMaiar Exchange