LogoLogo
  • Welcome
  • Where to Start
    • Introduction
    • list of Operations
    • Bantu Stack
  • Tutorials
    • Create Account
    • Send and Receive Payments
    • Follow Received Payments
    • Securing Web-based Projects
  • Issue Assets
    • Overview
    • Anatomy of an Asset
    • Issue an Asset
    • Publish Information About an Asset
    • Control Access to an Asset
  • Building Apps
    • Overview
    • Project Setup
    • Key Management Basics
    • Create a Basic Wallet
    • Make XBN Payments
    • Handle Custom Assets
  • Run a Core Node
    • index
    • running-node
    • network-upgrades
    • tier-1-orgs
    • installation
    • prerequisites
    • configuring
    • publishing history archives
    • commands
    • monitoring
  • Run API Server
    • prerequisites
    • quickstart
    • index
    • installing
    • monitoring
    • Running
    • configuring
  • Software and SDKs
    • index
  • Glossary
    • scp
    • Claimable Balance
    • XDR
    • Assets
    • BUDS
    • Inflation
    • Miscellaneous Core Objects
    • Testnet
    • Accounts
    • Network Passphrase
    • Ledger
    • Versioning
    • Sponsored Reserves
    • Operations
    • Decentralized Exchange
    • Fees
    • XBN Supply
    • Fee Bumps
    • Channels
    • Transactions
    • Minimum Balance
    • Multisig
  • Docs
    • Index
  • API
    • Introduction
      • Index
      • Response Format
      • Streaming
      • Rate Limiting
      • XDR
      • Pagination
        • Index
        • Page Arguments
    • Resources
      • Untitled
      • Overview
      • Ledgers
        • index
        • Object
        • Single
        • Transactions
        • Operations
        • Payments
        • Effects
        • List
      • Transactions
        • Index
        • Object
        • Single
        • Operations
        • Effects
        • List
      • Operations
        • Index
        • Object
          • Index
          • Create Account
          • Payment
          • Path Payment Strict Send
          • Path Payment Strict Receive
          • Sell Offer
          • Buy Offer
          • Passive Sell Offer
          • Set Options
          • Change Trust
          • Allow Trust
          • Account Merge
          • Manage Data
          • Bump Sequence
          • Create Claimable Balance
          • Claim Claimable Balance
          • Begin Sponsoring Future Reserves
          • End Sponsoring Future Reserves
          • Revoke Sponsorship
        • Single
        • Effects
        • List
        • List Payments
      • Effects
        • Index
        • Types
        • List
      • Accounts
        • Index
        • Object
        • Transactions
        • List
        • Single
        • Operations
        • Payments
        • Effects
        • Offers
        • Trades
        • Data
      • Offers
        • Index
        • Object
        • Single
        • List
      • Trades
        • Index
        • Object
        • List
      • Assets
        • Index
        • Object
        • List
      • Claimable Balances
        • Index
        • Object
        • Single
        • List
    • Aggregations
      • Index
      • Order Books
        • Index
        • object
        • Single
      • Paths
        • Index
        • Object
        • Strict Receive
        • Strict Send
      • Trade Aggregations
        • Index
        • Object
        • List
      • Fee Stats
        • Index
        • Object
        • Single
    • Errors
      • Index
      • Response
      • HTTP Status Codes
        • Index
        • Standard
        • Expansion Specific
          • Index
          • Transaction Failed
          • Transaction Malformed
          • Before History
          • Stale History
          • Timeout
      • Result Codes
        • Index
        • Transactions
        • Operations
        • Operation Specific
          • Index
          • Create Account
          • Payment
          • Path Payment Strict Receive
          • Path Payment Strict Send
          • Manage Sell Offer
          • Manage Buy Offer
          • Create Passive Sell Offer
          • Set Options
          • Change Trust
          • Allow Trust
          • Account Merge
          • Manage Data
          • Bump Sequence
Powered by GitBook
On this page
  • Preparing the Database
  • Postgres Configuration

Was this helpful?

  1. Run API Server

configuring

PreviousRunningNextSoftware and SDKs

Last updated 4 years ago

Was this helpful?

Expansion is configured using command line flags or environment variables. To see the list of command line flags that are available (and their default values) for your version of Horizon, run:

expansion --help

When you run the command above, you'll see that Horizon defines a large number of flags; however, only three are required:

flag

envvar

example

--db-url

DATABASE_URL

postgres://localhost/expansion_testnet

--bantu-core-db-url

BANTU_CORE_DATABASE_URL

postgres://localhost/core_testnet

--bantu-core-url

BANTU_CORE_URL

--db-url specifies the Horizon database, and its value should be a valid . --bantu-core-db-url specifies a Stellar Core database which will be used to load data from the Stellar ledger. Finally, --bantu-core-url specifies the HTTP control port for an instance of Stellar Core. This URL should be associated with the Stellar Core server that is writing to the database at --bantu-core-db-url.

Additionally, if you are running a single Expansion instance you should start ingestion using the following flags:

flag

envvar

example

--history-archive-urls

HISTORY_ARCHIVE_URLS

--ingest

INGEST

true

Specifying command line flags every time you invoke Expansion can be cumbersome, and so we recommend using environment variables. There are many tools you can use to manage environment variables: we recommend either or .

Preparing the Database

Before running the Expansion server, you must first prepare the Horizon database. This database will be used for all of the information produced by Horizon, notably historical information about successful transactions that have occurred on the stellar network.

To prepare a database for Horizon's use, you must first ensure the database is blank. It's easiest to simply create a new database on your postgres server specifically for Horizon's use. Next you must install the schema by running horizon db init. Remember to use the appropriate command line flags or environment variables to configure Horizon as explained in . This command will log any errors that occur.

Postgres Configuration

It is recommended to set random_page_cost=1 in Postgres configuration if you are using SSD storage. With this setting Query Planner will make a better use of indexes, expecially for JOIN queries. We've noticed a huge speed improvement for some queries.

PostgreSQL Connection URI
direnv
dotenv
Configuring
http://localhost:11626
http://history.stellar.org/prd/core-testnet/core_testnet_001/