Stellar marks first major release of open-source API with Horizon 1.0

Over subsequent releases, Stellar plans to improve existing endpoints and unlock more possibilities to make Horizon serve users even better...

Stellar marks first major release of open-source API with Horizon 1.0

Stellar, the powerful open-source blockchain for payments, announced today the release of Horizon 1.0, the first major release of its open-source API. Horizon was first originated back in 2015, and since then has had 24 minor release versions.

Horizon is an HTTP API server that makes it easy for users to interact with the Stellar network without having to worry about low-level details.  It exposes multiple endpoints that are optimized to allow users to perform actions such as:

Horizon sits between services on Stellar (wallet, asset issuer, payment provider) and a Stellar Core node:

That Stellar Core node is part of a peer-to-peer network: it coordinates with other nodes to validate transactions and maintain the current state of the ledger.  It is not, however, optimized for developer interactions.

Horizon is designed to allow developers to submit transactions and efficiently consume network data. It takes XDR data from Stellar-Core and decodes it into JSON. Stellar SDKs are typically set up to poll Horizon endpoints; sp projects building on Stellar aren’t constantly asking Stellar-Core questions. That means Stellar-Core can focus on the hard work of consensus and ledger ratification. Horizon, meanwhile, can focus on providing answers that are efficient and ergonomic.

Submitting a transaction to the network via Horizon is actually pretty straightforward: you send the transaction to Horizon and it proxies the transaction to a Stellar Core node. Making it easy to read the current state of the ledger or exploring historical data requires more orchestration, and that’s where Horizon offers the most value to its users. Through a process Stellar calls ingestion, Horizon takes data from the ledger and normalizes it so it’s easier to access and consume.

What makes this a major release?

Back in August, Stellar introduced a new system for handling ingestion. It has big advantages over the old ingestion system; it’s more consistent and developer-friendly, allows user configuration, and doesn’t overtax Stellar-Core. Eventually, the plan is to move over to it completely.

The new ingestion system is a pretty big departure from the old one, and after months of refinement and road testing—first behind a feature flag, then in alpha and beta releases—it’s ready for production deployment.  With Horizon 1.0, Stellar switches off the old ingestion system and switches on the new one.

The new ingestion system introduces some breaking changes, which is part of why this is a major release.  It also makes Horizon a lot nimbler, according to Stellar’s release notes, here’s why:

“With the old ingestion system, Horizon knew about the past, but not about the present.  When you asked Horizon about historical transactions (payments, trades), it could find answers in its own database.  If, however, you wanted to know something about the current state of the ledger (an account’s balance, open offers), Horizon didn’t know: it had to consult Stellar-Core’s database.  The new ingestion system gives Horizon access to a full copy of the ledger state built using history archives and then dynamically updated, which means it can now see the present as well as the past.  As a result, it’s more capable, more efficient, and less dependent on Stellar-Core”

Switching Horizon’s guts means it can do more without disturbing Stellar-Core…

As a result, queries are faster and data is more consistent. Those two advantages are covered at length in a previous blog post from Stellar. The new ingestion system also allows Stellar to do more with Horizon, and this release includes some new endpoints that take advantage of that fact.

Examples:

Road Ahead

“We’re planning to switch our public Horizon instances to 1.0 on 03/20/20. You can track that upgrade and sign up for notifications on our statuspage. If you’re running your own Horizon, you can find all the details on how to migrate in our testing guide.  Please make sure to take a look at the release notes for information about breaking changes, and to update your SDK so it’s compatible with the new version. Working on this rewrite was our number one priority over the last couple of months.  Now that it’s finally out, we’re going to continue to improve and add features to Horizon, and to use the new ingestion system to explore new solutions to all kinds of problems.  For example: Until now Horizon has been in an unstable 0.x phase so breaking changes between versions were allowed. However, moving to 1.0 and a more mature deprecation scheme has been long overdue.”
– The Stellar Team

Exit mobile version