Stellar is a decentralized , open network for sharing and storing funds. Jed McCaleb, the founder of Stellar created Stellar with the intention of providing users with the ability to transfer their fiat currency with digital currency easily.
Developers who create applications on base of Stellar network software making use of Stellar SDKs that they use in their programming languages of choice. SDKs then communicate with Horizon Stellar-network API. Horizon offers a means to verify accounts, join to events, and send transactions.
Stellar ecosystem is based on an API server dubbed Horizon. It functions in the role of an interfacing with Stellar Core and the applications that are part of the Stellar network. It also offers HTTP API for data on data on the Stellar network. It obtains information from data in the Stellar network and serves the data in a format that is simple to access.
There are various benefits for running Horizon with your infrastructure:
- Control the entire operation without any dependence upon any of Stellar Development Foundation
- Set up multiple instances to handle capacity and redundancy
- Enable rate-limiting of requests to ensure access to the network
Prerequisites
Horizon is dependent in the PostgreSQL server to store the data that is processed and ingested by Stellar Core. The PostgreSQL Version 9.5 or greater is required to run Horizon.
The additional RAM required is to host Captive Core’s memory database, which would amount to around 3GB. The second requirement is based on the volume of history of the network that is served by your Horizon instance. It can range from a few GBs up to hundreds of TBs to cover 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 you can choose another method. It is necessary to build Horizon from source. Some developer tools will must be installed for this purpose:
- OS that is similar to Unix that uses common basic commands such as mkdir, bash, cp, and so on.
- Go1.15 or later
- Git
Configuration
Parameters
Both command line flags and environmental variables can affect Horizon’s configuration. Use the following command to look up the available command-line flags along with their default values as well as the associated environmental variables:
Horizon -help
The command above will show many flags, but only a few are needed. The three most significant parameters are:
- -db_url: It is the name of the Horizon database. Its value must be an authentic PostgreSQL link 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 scans PATH to find stellar-core automatically; however, if the environment is properly configured then there is no need to specify the path manually.
Read More: https://www.leewayhertz.com/run-stellar-api-server/