Uncategorized

HOW TO RUN STELLAR API SERVER?

Stellar is a decentralized , open network that allows for the transfer and storing funds. Jed McCaleb, the founder of Stellar was the one who created Stellar in the hope of providing people with a method to exchange their fiat currencies with digital currency easily.

Developers who develop apps on base of Stellar network application making use of Stellar SDKs that they use in the programming language they prefer. SDKs in turn communicate with Horizon Stellar-network API. Horizon offers a means to monitor accounts, sign up to events, and send transactions.

Stellar ecosystem is based on an API server dubbed Horizon. Horizon acts to act as an intermediary to Stellar Core and the applications that are part of the Stellar network. It also offers HTTP API for data within Stellar Core. Stellar network. It obtains information from data in the Stellar network and serves it in a format that is simple to use.

There are various benefits for running Horizon with your infrastructure:

  • Complete operational control, without reliance from any of Stellar Development Foundation
  • Create multiple instances to ensure scaling and redundancy
  • Limiting the rate of request to ensure network access

Prerequisites

Horizon relies upon the PostgreSQL server it utilizes to store information processed and ingested by Stellar Core. The PostgreSQL Version 9.5 or higher is required to run Horizon.

The additional RAM required is to store Captive Core’s in-memory database, which would amount to about 3 GB. The second requirement is based on the size of the history of the network that is served by your Horizon instance. It could be anything from a few GBs up to 10s of TBs for the entire history of ledgers ingested.

Installation

First, prebuilt binaries downloaded from Stellar repositories must be installed prior to installing Horizon. If you’re not keen to install prebuilt releases there’s a different option. Horizon must be built Horizon from scratch. Some developer tools will are required to complete this task:

  • OS similar to Unix that uses common fundamental commands such as mkdir bash, cp, etc.
  • Go1.15 or later
  • Git

Configuration

Parameters

Both command-line flags as well as environment variables can affect Horizon’s configuration. The following command will check the list of command-line flags along with their default values as well as the associated environmental variables:

Horizon -help

The command above will show numerous flags, but only a few are needed. The three most significant parameters are:

  • -db-url: It indicates Horizon database, and the value must be an authentic PostgreSQL Connection URL.
  • -captive-core-config-append-path: It points to a Captive Core configuration stub.
  • -stellar-core-binary-path: It is a file system path to a Stellar Core binary. Horizon searches the PATH for stellar-core automatically; however, if the environment is properly configured it will not be a need to specify the path manually.

Read More : https://www.leewayhertz.com/run-stellar-api-server/

Standard

Leave a comment