How To Use SDKs On A Stellar Node

Okay, so you spun up a Stellar node. Good plan. Here’s some valuable info on what do next, specifically how to employ SDKs.

First things First

Stellar is broken down into multiple parts. There are stellar-core and horizon, which allow you to interact with the testnet or mainnet. Using Horizon can be a bit complicated when doing certain calls like operations, that is why there are some Stellar SDKs that make it easy to use stellar-core. All you will need to use the SDK is the IP of the Blockdaemon Stellar Node.

How to find your Horizon node IP

  1. Login to your Blockdaemon account.
  2. In the dashboard click on the desired Horizon node (See FAQ on spinning up a node if you haven’t done so already).
  3. In order to generate an IP for the Horizon node it will first need to reach the Ready status in the network page.
  4. Click the Connect tab.
  5. Your Horizon IP and port will be listed in the IP section.

Available SDKs

  • Java SDK
  • Ruby SDK
    • You will need to provide your blockdaemon node endpoint URL and auth token (from your dashboard) when creating your StellarSdk.Server object.
    • ('https://stellar-test.bdnodes.net/?auth=<CUSTOMER TOKEN>')
  • Python SDK
    • dashboard) when creating your StellarSdk.Server object.
    • ('https://stellar-test.bdnodes.net/?auth=<CUSTOMER TOKEN>'

      JS SDK

      • You will need to provide your blockdaemon node endpoint URL and auth token (from your dashboard) when creating your StellarSdk.Server object.
        • example code snippet
      var StellarSdk = require('stellar-sdk');
      var server = new StellarSdk.Server('https://stellar-test.bdnodes.net/?auth=<CUSTOMER TOKEN>');// get a list of transactions that occurred in ledger 714678, you can change the value in the function
      server.transactions()
          .forLedger(714678)
          .call().then(function(r){ console.log(r); }).catch(function () {console.log("Promise Rejected")});

      Note:  the example above is using the testnet node. So you should use //stellar-main.bdnodes.net

      endpoint URLs and auth in your dashboard

      stellar_db_urls.jpg