Running the utility

Navigate back to the nodejs project repository on your terminal window. Run the CreateTrustline utility by executing the following command:

node CreateTrustline.js

A successful response from the Stellar network after the transaction is submitted indicates the trustlines have been created. You can verify this on your own.

Navigate to your internet browser and open a tab. View any account on Horizon by going to the accounts link. You can do so by going to the following link: http://localhost:8000/accounts/<Account ID>.

For example, for receivingKeys1, the public key we saved earlier is GDM3ACVBVHZXPYHQYTMQFS42DSIU7AVIZS4ARWNQGUNGL55BPCBUJV6C.

So, open the following link:

http://localhost:8000/accounts/GDM3ACVBVHZXPYHQYTMQFS42DSIU7AVIZS4ARWNQGUNGL55BPCBUJV6C.

Now, scroll down and check the balances again. Notice how it shows balances for four assets, including the native asset now. This can be seen in the following code block:

  "balances": [
    {
      "balance": "0.0000000",
      "limit": "1000000.0000000",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 503,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "USD",
      "asset_issuer": "GBUM3XRJKUVEQA4UF63CUCS3P72C5AZTRYI2VKELS7T7DVCCLV3DODNE"
    },
    {
      "balance": "0.0000000",
      "limit": "1000000.0000000",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 503,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "GBP",
      "asset_issuer": "GBUM3XRJKUVEQA4UF63CUCS3P72C5AZTRYI2VKELS7T7DVCCLV3DODNE"
    },
    {
      "balance": "0.0000000",
      "limit": "1000000.0000000",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "last_modified_ledger": 503,
      "is_authorized": true,
      "asset_type": "credit_alphanum4",
      "asset_code": "EUR",
      "asset_issuer": "GBUM3XRJKUVEQA4UF63CUCS3P72C5AZTRYI2VKELS7T7DVCCLV3DODNE"
    },
    {
      "balance": "99999.9999700",
      "buying_liabilities": "0.0000000",
      "selling_liabilities": "0.0000000",
      "asset_type": "native"
    }

Next, we'll write a transfer utility, to transfer these assets from the issuer account to the receiving account.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.42.168