How to build a Stellar App?

healthcare technology consulting

Blockchain technology has gained a lot of popularity since its emergence in the market. Blockchain use cases in finance such as cryptocurrencies were the first applications of the technology. As the world globalizes and the demand for cross-border payments expands, companies will drive towards innovation in blockchain payments.

We believe that Stellar Core is one of the highly significant distributed technologies that allow anyone to develop low-cost and quick financial solutions. Our blockchain experts have worked upon a number of PoCs and discovered the possibilities with the platform.

In this article, we are going to explain why Stellar is the right platform for developing Fintech apps and how to develop Stellar blockchain apps.

  1. What is Stellar Blockchain?
  2. What products can be built using Stellar Blockchain?
  3. How to build a Stellar App?

Let’s start first with the basic understanding of Stellar Blockchain.

What is Stellar Blockchain?

The aim of Stellar and the team behind building it is to let people receive and send money across borders reliably and quickly and for fractions of a penny. It connects payment systems, banks and users and integrates them to enable the process of moving money at no cost.

With apps or software built on Stellar Blockchain, mobile money apps can be made interoperable with decreased costs of smaller transactions and improved efficiency.

The Stellar Blockchain has an open and decentralized database that enables it to keep a confirmation time of 3-5 seconds. Because the Stellar blockchain is not coded in a Turing complete language, the transaction per second rate is also high. Let’s discuss an example of how Stellar blockchain works for cross-border payments.

For example, you want to send a certain amount of USD to a person (John) you do business with and that person is from Europe who will be receiving money in EUR. Your’s and John’s bank are connected to the Stellar network. When you try to send money in USD to John, a transaction request is sent to John’s banks to check whether John is compliant or not. By getting the green light from the European bank, funds are deducted from the bank account and transferred to the Stellar network in form of Lumens. Once Stellar Lumens are sent to the network, the money is moved to John’s bank and credited to his account.

As you must be aware that the Stellar blockchain is a peer-to-peer and decentralized network, details of all the transactions get stored in the blockchain and act as an open and transparent ledger.

What products can be built using Stellar Blockchain?

Following are some of the product that can be built using the Stellar Blockchain:

  • Peer-to-peer payment app

    You can build a P2P payments app on the Stellar Blockchain that requires minimal transaction charges and is quicker. Using the Stellar platform as the underlying technology, you can enable cross-border and low-cost payments with minimal waiting time and minimum overhead costs.

  • Asset Digitization

    Asset digitization is one of the most significant use cases of Stellar blockchain and helps in digitizing the tangible or non-tangible assets on the Stellar blockchain platform.

  • Decentralized Exchange

    The stellar blockchain protocol helps in building decentralized exchanges because the security in the network is improved when independent servers with fault tolerance systems participate in the network.

    The main difference between Stellar DEX and other centralized, or decentralized exchanges is that you control your own money. Your private key is in control of you and you alone. Unlike centralized exchanges, where these are stored in centralized servers, or Ethereum based exchanges, where these are stored in smart contracts, Stellar DEX gives you full power to control your money. This means no amount of hacking into the central servers or manipulation of smart contracts is going to make you lose your money.

  • Sharing Economy

    Say you build a platform where a person with mobile data while traveling lets others use it via hotspots. And since we’re the creators and believers of technology, let’s assume matching, metering, and whatnot—all will be done real smooth. But how does the person who shares his mobile data with others will get paid for? That’s where the stellar blockchain comes in as you can build payment platforms with it.

How to build a Stellar App?

Let’s look at the below steps to understand how to build an app on the Stellar Blockchain Network.

1. Install SDK based on the technology you want to use

The first step is to install an SDK based on the technology you want to use for building your app. For example, if you want to develop a Python-based app, you will be installing the Python SDK.

You can install the Python SDK via pip utility:

pip install stellar-base

Using this utility, the main SDK will be installed along with all dependencies. The Python SDK for Stellar apps provides a networking layer API for Horizon endpoints. It also allows you to build and sign transactions, communicate with a Stellar Horizon instance, query network history and communicate with a Stellar Horizon instance.

2. Connect the SDK with the Horizon Network

Once you have successfully installed the Python SDK, the next step is to connect it with the Horizon network. Horizon is the client-facing API Server for the Stellar blockchain ecosystem. It acts as a bridge between Stellar core and applications that want to access the Stellar network. Horizon enables you to submit transactions to the network, subscribe to event streams and check the accounts’ status.

You can interact with Horizon directly via the cURL/web browser. Horizon has ledgers endpoints that are used to stream ledger data. It has multiple endpoints that support the streaming of effects, ledgers, offers, operations, accounts, order book, transactions, payments and trades.

To start, you can import the Horizon object from the Python Stellar SDK. The horizon object allows accessing Horizon API endpoints. Then, you need to create two functions, one to manage responses from Horizon and one to call the Horizon/ledgers endpoint in the streaming mode. The handling function will print the response to the console that will look like:

from stellar_base.horizon import Horizondef data_handler(response):
print(response)
def get_ledger_data():
if _name_ == ‘_main_’:
get_ledger_data()

The next step is to create the get_ledger_data() function that will perform actions, including creating a new horizon object, calling the ledgers endpoint in streaming mode and for each response, we will pass it to data_handler():

from stellar_base.horizon import Horizon

def data_handler(response):
print(response)
def get_ledger_data():
# Create new Horizon object (mainnet)
ledger_data = Horizon(horizon_uri=’https://horizon.stellar.org’)
# Send request to ledgers enpoint
ledger_data = ledger_data.ledgers(cursor=’now’, order=’asc’, sse=True)
# Handle responses
for ledger in ledger_data:
data_handler(ledger)
if __name__ == ‘__main__’:
get_ledger_data()

Code line9 creates the new Horizon object and sets the horizon_uri to the main net (https://horizon.stellar.org./).

Line11 shows the calling of the /ledgers endpoint with some arguments. cursor=’now’ implies that we want to initiate returning records after the streaming object is created. order=’asc’ tells us the order in which we want to return rows, for example, in this case, ascending order. Lastly, in line11, sse=True implies that we want to use server-side events for streaming responses.

A for loop in line13 passes each response to the data_handler() function.

The python stellar SDK sends a get request to the ledgers endpoints and returns a dictionary with information from the /ledgers endpoint.

Python dictionaries are comprised of keys and values, for example, we use the relevant key to grab specific data. Here, we will only get data for successful and failed transactions, ledger sequence and total operations in the ledger.

3. Create an account

Once the SDK gets connected to the Horizon Server, the next step is to create an account on the Stellar Network. Accounts are used for holding all your money inside Stellar and enable you to receive and send payments.

Each stellar account has a secret seed and a public key. Stellar leverages public-key cryptography to make sure that every transaction is secure. The public key can be safely shared and other people require it to identify your account and verify that you validated a transaction. However, the secret seed is private information that shows you own your account. You should not share the seed with anyone. It’s like the combination to a lock. Anyone who is aware of the combination can open the lock. In a similar way, anyone who knows your account’s seed can control your account.

The first step in creating an account is to create your own key and seed. Use the following command to generate the key and seed:

from stellar_sdk.keypair import Keypair
pair = Keypair.random()
print(f”Secret: {pair.secret}”)
# Secret: SCMDRX7A7OVRPAGXLUVRNIYTWBLCS54OV7UH2TF5URSG4B4JQMUADCYU
print(f”Public Key: {pair.public_key}”)
# Public Key: GAG7SXULMNWCW6LX42JKZOZRA2JJXQT23LYY32OXA6XECUQG7RZTQJHO

Once you have a seed and public key, you can create an account. To prevent people from making a huge number of unnecessary accounts, each account must have a minimum of 1 lumen. You cannot pay for an account if you don’t have any lumens. However, on Stellar testnet, you can ask Stellar’s Friendbot to create an account for you.

You need to send the public key to Friendbot for creating a test account. The bot will create and fund a new account with the public key as the account ID.

import requests
public_key = “GD4NB2FLQAN5JO7PKPGZJMNBDYQXVSNVC7DEIZMOL5WSNSBLEBUTEF5Q”
response = requests.get(f”https://friendbot.stellar.org?addr={public_key}”)
if response.status_code == 200:
print(f”SUCCESS! You have a new account :)\n{response.text}”)
else: print(f”ERROR! Response: \n{response.text}”)

The last step in creating an account is to get the account’s details and checking the balance.

from stellar_sdk.server import Server
server = Server(“https://horizon-testnet.stellar.org”)
public_key = “GD4NB2FLQAN5JO7PKPGZJMNBDYQXVSNVC7DEIZMOL5WSNSBLEBUTEF5Q”
account = server.accounts().account_id(public_key).call()
for balance in account[‘balances’]:
print(f”Type: {balance[‘asset_type’]}, Balance: {balance[‘balance’]}”)

4. Creating different assets

The Stellar Distributed Network is used to hold, track and transfer any kind of asset: euros, dollars, stocks, gold, bitcoin and other tokens of value. Any asset on the Stellar network can be exchanged and traded with any other asset.

Apart from lumens, all assets on the Stellar have:

Asset type: e.g., BTC or USD
Issuer: the account that creates the asset

The object of the Asset class represents an asset in the stellar network. Currently, there can be three types of assets in the stellar network:

  • native XLM asset (ASSET_TYPE_NATIVE)
  • issued assets with asset code of a maximum of 12 characters
    (ASSET_TYPE_CREDIT_ALPHANUM12)
  • issued assets with asset code of maximum 4 characters
    (ASSET_TYPE_CREDIT_ALPHANUM4)

Use the static native() method to create a new native asset representation:
from stellar_sdk import
Asset native = Asset.native()

You have to create a new object of type Asset with an issuer and asset code for representing an issued asset:

from stellar_sdk import Asset # Creates TEST asset issued by
GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB test_asset = Asset
(“TEST”,”GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB”) is_native = test_asset.is_native() # False # Creates Google stock asset issued by
GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB google_stock_as set = Asset(‘US38259P7069’, ‘GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN
7GI5POFBB’) google_stock_asset_type = google_stock_asset.type # credit_alphanum12

You don’t need a dedicated operation to create an asset on the Stellar network. Instead, you can create an asset using a payment operation. An issuing account makes a payment with the asset it is issuing and that payment is used to create the asset on the network.

The issuing asset makes a payment to the distribution account with the newly named asset. As long as the issuing account is unlocked, it can create new tokens by doing payments to the distribution account. If your plan is to do anything with the asset, the next step is to complete a stellar.toml file to provide exchanges, wallets, market listing services and token holders with the info they require to understand what it represents.

Once it is done, you can also create a sell offer to get your asset onto the Stellar decentralized exchange and put an effort into market-making to create liquidity.

Here is the sample code for issuing an asset on the Stellar network:

from stellar_sdk.asset import Asset
from stellar_sdk.keypair import Keypair
from stellar_sdk.network import Network
from stellar_sdk.server import Server
from stellar_sdk.transaction_builder import TransactionBuilder
# Configure Stellar SDK to talk to the horizon instance hosted by Stellar.org
# To use the live network, set the hostname to ‘https://horizon.stellar.org’
server = Server(horizon_url=”https://horizon-testnet.stellar.org”)
# Use test network, if you need to use public network, please set it to `Network.
PUBLIC_NETWORK_PASSPHRASE` network_passphrase = Network.
TESTNET_NETWORK_PASSPHRASE
# Keys for accounts to issue and receive the new asset
issuing_keypair = Keypair.from_secret(
“SCZANGBA5YHTNYVVV4C3U252E2B6P6F5T3U6MM63WBSBZATAQI3EBTQ4”)
issuing_public = issuing_keypair.public_key
distributor_keypair = Keypair.from_secret(
“SDSAVCRE5JRAI7UFAVLE5IMIZRD6N6WOJUWKY4GFN34LOBEEUS4W2T2D”
)
distributor_public = distributor_keypair.public_key
# Transactions require a valid sequence number that is specific to this account.
# We can fetch the current sequence number for the source account from Horizon.
distributor_account = server.load_account(distributor_public)
# Create an object to represent the new asset
astro_dollar = Asset(“AstroDollar”, issuing_public)
# First, the receiving account must trust the asset
trust_transaction = (
TransactionBuilder(
source_account=distributor_account,
network_passphrase=network_passphrase,
base_fee=100,
)
# The `changeTrust` operation creates (or alters) a trustline
# The `limit` parameter below is optional
.append_change_trust_op(
asset_code=astro_dollar.code, asset_issuer=astro_dollar.issuer, limit=”1000″
)
.set_timeout(100)
.build()
)
trust_transaction.sign(distributor_keypair)
trust_transaction_resp = server.submit_transaction(trust_transaction)
print(f”Change Trust Transaction Resp:\n{trust_transaction_resp}”)
issuing_account = server.load_account(issuing_public)
# Second, the issuing account actually sends a payment using the asset.
payment_transaction = (
TransactionBuilder(
source_account=issuing_account,
network_passphrase=network_passphrase,
base_fee=100,
)
.append_payment_op(
destination=distributor_public,
amount=”10″,
asset_code=astro_dollar.code,
asset_issuer=astro_dollar.issuer,
)
.build()
)
payment_transaction.sign(issuing_keypair)
payment_transaction_resp = server.submit_transaction(payment_transaction)
print(f”Payment Transaction Resp:\n{payment_transaction_resp}”)

The distributor’s account then will hold both new Astrodollars and XLM.

5. Define transaction fees

To maintain the efficiency of the network and ledger spam, Stellar needs small transaction fees and a minimum account balance. Transactions on the Stellar can range from 1 to a defined limit of 100 operations. The fee for a transaction is calculated as:

Transaction fee = number of operations * base fee
Stellar deducts the fee from the transaction’s source account regardless
of which accounts are involved in each operation or who signs the
transaction.

6. Perform transactions

 

Transactions are the commands used to modify the state of the ledger that include sending payments, making changes to account configurations, creating offers and so on. Each transaction has a source account that pays the fee and uses a sequence number for the transaction.

Transactions comprise one or more operations where each operation has a source account that is default to the transaction’s source account.

TransactionBuilder class is used for constructing new transactions. It is provided an account that is used as the transaction’s source account. The transaction uses the current sequence number of the given Account object as its sequence number and increases the given account’s sequence number when build() function is called on the TransactionBuilder.

Operations can be added to the transaction calling append_operation for every operation you want to add to the transaction. append_operation gives the TransactionBuilder object to allow you to chain multiple calls.

After you add the required operations, call the build() method on the TransactionBuilder. It will return an entirely constructed TransactionEnvelope. The TransactionEnvelope object wraps the transaction object and the returned transaction consists of the sequence number of the source account. This transaction is unsigned, it needs to be signed before it is accepted by the Stellar network.

from stellar_sdk import TransactionBuilder, Network, Keypair, Account root_keypair = Keypair.from_secret(“SA6XHAH4GNLRWWWF6TEVEWNS44CBNFAJWHWOPZCVZOUXSQA7BOYN7XHC”)
# Create an Account object from an address and sequence number.
root_account = Account(account_id=root_keypair.public_key, sequence=1)
transaction = TransactionBuilder( source_account=root_account,
# If you want to submit to pubnet, you need to change `network_passphrase` to `Network.
PUBLIC_NETWORK_PASSPHRASE`
network_passphrase=Network.TESTNET_NETWORK_PASSPHRASE, base_fee=100)
\ .append_payment_op(
# add a payment operation to the transaction destination=”GASOCNHNNLYFNMDJYQ3XFMI7BYHI
OCFW3GJEOWRPEGK2TDPGTG2E5EDW”, asset_code=”XLM”, amount=”125.5″)
\ .append_set_options_op( # add a set options operation to the transaction home_domain=”overcat.
me”) \ .set_timeout(30) \ .build()
# mark this transaction as valid only for the next 30 seconds

7. Creating a payment transaction

In the below example, there must be a destination account. We can use both synchronous and asynchronous methods to submit transactions. We have used the synchronous method in the following example:

Create, sign, and submit a transaction using Python Stellar SDK.

Assume that you have the following items:

  1. Secret key of a funded account to be the source account
  2. Public key of an existing account as a recipient These two keys can be created and funded by the friend bot at https://www.stellar.org/laboratory/ under the heading “Quick Start: Test Account”
  3. Access to Python Stellar SDK (https://github.com/StellarCN/py-stellar-base) through Python shell. 

from stellar_sdk import Server, Keypair, TransactionBuilder, Network
# The source account is the account we will be signing and sending from.
source_secret_key = “SBFZCHU5645DOKRWYBXVOXY2ELGJKFRX6VGGPRYUWHQ7PMXXJNDZFMKD”
# Derive Keypair object and public key (that starts with a G) from the secret
source_keypair = Keypair.from_secret(source_secret_key) source_public_key = source_keypair.public_key receiver_public_key = “GA7YNBW5CBTJZ3ZZOWX3ZNBKD6OE7A7IHUQVWMY62W2ZBG2
SGZVOOPVH”
# Configure StellarSdk to talk to the horizon instance hosted by Stellar.org
# To use the live network, set the hostname to ‘horizon.stellar.org’
server = Server(horizon_url=”https://horizon-testnet.stellar.org”)
# Transactions require a valid sequence number that is specific to this account.
# We can fetch the current sequence number for the source account from Horizon.
source_account = server.load_account(source_public_key) base_fee = server.fetch_base_fee()
# we are going to submit the transaction to the test network,
# so network_passphrase is `Network.TESTNET_NETWORK_PASSPHRASE`,
# if you want to submit to the public network, please use `Network.
PUBLIC_NETWORK_PASSPHRASE`.
transaction = ( TransactionBuilder( source_account=source_account, network_passphrase=Network.
TESTNET_NETWORK_PASSPHRASE, base_fee=base_fee, ) .add_text_memo(“Hello, Stellar!”) #
Add a memo
# Add a payment operation to the transaction
# Send 350.1234567 XLM to receiver
# Specify 350.1234567 lumens. Lumens are divisible to seven digits past the decimal.
.append_payment_op(receiver_public_key, “350.1234567”, “XLM”) .set_timeout(30)
# Make this transaction valid for the next 30 seconds only

.build() )
# Sign this transaction with the secret key
# NOTE: signing is transaction is network specific. Test network transactions
# won’t work in the public network. To switch networks, use the Network object # as explained above
(look for stellar_sdk.network.Network).
transaction.sign(source_keypair)
# Let’s see the XDR (encoded in base64) of the transaction we just built
print(transaction.to_xdr())
# Submit the transaction to the Horizon server. # The Horizon server will then submit the transaction into the network for us.
response = server.submit_transaction(transaction) print(response)

The following is an example of sending a payment by an asynchronous method:

The effect of this example is the same as `payment.py`, but this example is asynchronous.

Create, sign, and submit a transaction using Python Stellar SDK.

Assume that you have the following items:
1. Secret key of a funded account to be the source account
2. Public key of an existing account as a recipient
These two keys can be created and funded by the friendbot at https://www.stellar.org/laboratory/ under the heading
“Quick Start:
Test Account”
3. Access to Python Stellar SDK (https://github.com/StellarCN/py-stellarbase) through Python shell.

import asyncio
from stellar_sdk import Server, Keypair, TransactionBuilder, Network, Aioht
tpClient
# The source account is the account we will be signing and sending from.
source_secret_key = “SBFZCHU5645DOKRWYBXVOXY2ELGJKFRX6VGGPRYUWHQ7PMXXJNDZFMKD”
# Derive Keypair object and public key (that starts with a G) from the secret
source_keypair = Keypair.from_secret(source_secret_key)
source_public_key = source_keypair.public_key
receiver_public_key = “GA7YNBW5CBTJZ3ZZOWX3ZNBKD6OE7A7IHUQVWMY62W2ZBG2SGVOOPVH”
async def main():
# Configure StellarSdk to talk to the horizon instance hosted by Stellar.org
# To use the live network, set the hostname to ‘horizon.stellar.org’
# When we use the `with` syntax, it automatically releases the
resources it occupies.
async with Server(
horizon_url=”https://horizon-testnet.stellar.org”, client=AiohttpClient()
) as server:
# Transactions require a valid sequence number that is specific to this account.
# We can fetch the current sequence number for the source account from Horizon.
source_account = await server.load_account(source_public_key)
base_fee = await server.fetch_base_fee()
# we are going to submit the transaction to the test network,
# so network_passphrase is `Network.TESTNET_NETWORK_PASSPHRASE`,
# if you want to submit to the public network, please use `Network.
PUBLIC_NETWORK_PASSPHRASE`.
transaction = (
TransactionBuilder(
source_account=source_account,
network_passphrase=Network.TESTNET_NETWORK_PASSPHRASE,
base_fee=base_fee,
)
.add_text_memo(“Hello, Stellar!”) # Add a memo
# Add a payment operation to the transaction
# Send 350.1234567 XLM to receiver
# Specify 350.1234567 lumens. Lumens are divisible to
seven digits past the decimal.
.append_payment_op(receiver_public_key, “350.1234567”, “XLM”
)
.set_timeout(30) # Make this transaction valid for the
next 30 seconds only
.build()
)
# Sign this transaction with the secret key
# NOTE: signing is transaction is network specific. Test network
transactions
# won’t work in the public network. To switch networks, use the
Network object
# as explained above (look for stellar_sdk.network.Network).
transaction.sign(source_keypair)
# Let’s see the XDR (encoded in base64) of the transaction we just
built
print(transaction.to_xdr())
# Submit the transaction to the Horizon server.
# The Horizon server will then submit the transaction into the
network for us.
response = await server.submit_transaction(transaction)
print(response)
if __name__ == “__main__”:
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
# asyncio.run(main()) # Python 3.7+

In case a transaction requires multiple public keys for signing before they are considered valid, you need to use multi-signature accounts. It is done by configuring your account’s threshold levels. Every operation has either a low, medium or high threshold level.

You provide each threshold a level between 1-255 in your account. For each key in your account, you assign them a weight. Any transaction must be signed with enough keys to meet the threshold.

Suppose you set threshold levels as low=1, medium=2 and high=3. You have to send a payment operation which is a medium threshold operation and your master key has weight 1. Moreover, you have a secondary key associated with your account that has a weight of 1. Now, the transaction you are submitting for the payment must have both signatures of your secondary and master key because their combined weight is 2 that is enough to validate the payment operation.

In the below example, we will:

  • set our account’s master key weight and threshold levels
  • create a multi-signature transaction that sends a payment
  • add a second signer to the account

from stellar_sdk import Server, TransactionBuilder, Signer, Network, Keypair
server = Server(horizon_url=”https://horizon-testnet.stellar.org”)
root_keypair = Keypair.from_secret(“SA6XHAH4GNLRWWWF6TEVEWNS44CBNFAJWHOPZCVZOUXSQA7BOYN7XHC”)
root_account = server.load_account(account_id=root_keypair.public_key)
secondary_keypair = Keypair.from_secret(“SAMZUAAPLRUH62HH3XE7NVD6ZSMTWPWGM
6DS4X47HLVRHEBKP4U2H5E7″)
secondary_signer = Signer.ed25519_public_key(account_id=secondary_keypair.public_key, w
eight=1)
transaction = TransactionBuilder(
source_account=root_account,
network_passphrase=Network.TESTNET_NETWORK_PASSPHRASE,
base_fee=100) \
.append_set_options_op(
master_weight=1, # set master key weight
low_threshold=1,
med_threshold=2, # a payment is medium threshold
high_threshold=2, # make sure to have enough weight to add up to the high threshold!
signer=secondary_signer) \
.set_timeout(30) \
.build()
# only need to sign with the root signer as the 2nd signer won’t
# be added to the account till after this transaction completes
transaction.sign(root_keypair)
response = server.submit_transaction(transaction)
print(response)
# now create a payment with the account that has two signers
destination = “GBA5SMM5OYAOOPL6R773MV7O3CCLUDVLCWHIVVL3W4XTD3DA5FJ4JSEZ”
transaction = TransactionBuilder(
source_account=root_account,
network_passphrase=Network.TESTNET_NETWORK_PASSPHRASE,
base_fee=100) \
.append_payment_op(
destination=destination,
amount=”2000″,
asset_code=”XLM”) \
.set_timeout(30) \
.build()
# now we need to sign the transaction with both the root and the secondary_keypai
transaction.sign(root_keypair)
transaction.sign(secondary_keypair)
response = server.submit_transaction(transaction)
print(response)

8. Monitoring

Once the network is set up and the node is up and running, it is essential to keep an eye to ensure the network is running efficiently. To help with monitoring, Stellar Core reveals vital information that you can use to monitor your node and identify potential problems.

You can access the information related to monitoring using commands and inspecting Stellar Core’s output. You can also connect the Prometheus server to enable easy and quick monitoring, merge it with Alertmanager to automate notification and use pre-built Grafana dashboards for creating a visual representation of your node’s health.

You have to run $ stellar-core http-command ‘info’ command to check the overall health of the Stellar network.

Fields in the info contain:

  • build: the build number for Stellar Core Instance
  • peers: information about the network connectivity
    • pending_count: the number of connections that are not entirely established
    • authenticated_count: the number of live connections
  • protocol_version: the maximum version of the protocol that this instance recognizes
  • state: the node’s synchronization status relative to the network
  • ledger: the local state of your node that can be different from the network state if your node was disconnected from the network.

It is recommended that administrators should import the following dashboards into their grafana deployments:

  1. Stellar Core Monitoring:

    It shows the most crucial metrics, node status and is used to surface common problems.

  2. Stellar Core Full:

    It displays a simple health summary and all the metrics exposed by the stellar-core- prometheus-exporter. It provides more details than the Stellar Core Monitoring and is useful during in-depth troubleshooting.

We hope that we have been able to explain the complete process of building blockchain apps on the Stellar Blockchain Network. As mentioned above, you can build a wide array of apps or payment systems using the Stellar protocol.

Conclusion

Though Stellar is not currently experiencing mass adoption, it is one of the most significant open-source projects that you might need to integrate with your business. Stellar also supports SDKs in different languages, including Python, Go, C++, Javascript and more. Using Stellar, you can develop cost-effective and easy to integrate payment solutions.

Stellar opens the magnitude of new opportunities for entrepreneurs, but you may need technical expertise to build solutions on the Stellar network

Our team of Stellar developers can help you design and develop any financial solution on top of the Stellar blockchain network. Contact us and get started with your Stellar Project. 

Author’s Bio

Akash Takyar
Akash Takyar
CEO LeewayHertz
Akash Takyar is the founder and CEO at LeewayHertz. With the experience of building over 100+ platforms for startups and enterprise allows Akash to rapidly architect and design solutions that are scalable and beautiful.
Akash's ability to build enterprise-grade technology solutions has attracted over 30 Fortune 500 companies, including Siemens, 3M, P&G and Hershey’s. Akash is an early adopter of new technology, a passionate technology enthusiast, and an investor in AI and IoT startups.
Start a conversation by filling the form
Once you let us know your requirement, our technical expert will schedule a call and discuss your idea in detail post sign of an NDA.

All information will be kept confidential.

 Send me the signed Non-Disclosure Agreement (NDA)

Insights

How to Build a Tezos dApp?

Tezos is an open-source dApp and smart contracts platform. It is a self amending cryptographic ledger which uses the Delegated Proof of Stake (DPoS) consensus protocol.

read more