Skip to content

LykkeCity/Lykke.Service.Stellar.Api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lykke.Service.Stellar.Api

Blockchain.Api implementation for the Stellar ledger based on the Lykke Blockchains integration guide. To integrate with the Stellar network the csharp-stellar-framework is used. The two framework components csharp-stellar-base and csharp-stellar-sdk are referenced as nuget packages.

A deposit wallet (DW) to hot wallet (HW) cash-in funds flow isn't suited for the Stellar ledger. Because each wallet on the Stellar must maintain a minimum account balance. However, another approach is to go with a master hot wallet (MHW) and assign a memo to each customer. Text- and Id-Memos are indexed by the transaction history methods and exposed under the more general purpose name DestinationTag. This means the Lykke Wallet must observe the MHW and assign funds to customer's balance based on the destination tag.

The transaction history methods index operations which alter the account balance including account creations, payments and account merges. They can return multiple items for a transaction hash, if the transaction contains multiple relevant operations.

Find the Lykke.Service.Stellar.Sign module here.

Configuration

Available configuration variables are documented below. See developing for more information on how to work with app and launch settings.

Lykke.Job.Stellar.Api

"StellarApiService": {
    "Db": {
      // Connection string to the Azure storage account where the StellarApiLog table with logs is stored
      "LogsConnString": "",
      // Connection string to the Azure storage account where data tables for observations, transactions and balances are stored
      "DataConnString": ""
    },
    // The network passphrase used when signing transactions. The following passphrases are currently in use:
    // Test: "Test SDF Network ; September 2015"
    // Live: "Public Global Stellar Network ; September 2015"
    "NetworkPassphrase": "",
    // Address of Horizon REST Api endpoint. The following public endpoints are available:
    // Test: https://horizon-testnet.stellar.org/
    // Live: https://horizon.stellar.org/
    "HorizonUrl": "",
    // Array with url formats of blockchain explorers
    // Test: https://stellar.expert/explorer/testnet/account/{0}, http://testnet.stellarchain.io/address/{0}
    // Live: https://stellar.expert/explorer/public/account/{0}, https://stellarchain.io/address/{0}
    "ExplorerUrlFormats": [ "https://stellar.expert/explorer/testnet/account/{0}", "http://testnet.stellarchain.io/address/{0}" ]
  },
  "StellarApiJob": {
    // Period as TimeSpan of the wallet balance update job
    "WalletBalanceJobPeriod": "00:01:00",
    // Period as TimeSpan of the transaction history update job
    "TransactionHistoryJobPeriod": "00:02:00",
    // Period as TimeSpan of the broadcasts in progress update job
    "BroadcastInProgressJobPeriod": "00:02:00",
    // Size of batches processed by the broadcasts in progress update job
    "BroadcastInProgressJobBatchSize": 100
  },
  "SlackNotifications": {
    "AzureQueue": {
      // Connection string to the Azure storage account where slack notifications are queued
      "ConnectionString": "",
      // The name of the queue for the slack notifications
      "QueueName": ""
    }
  }
}

Lykke.Service.Stellar.Api

"StellarApiService": {
    "Db": {
      // Connection string to the Azure storage account where the StellarApiLog table with logs is stored
      "LogsConnString": "",
      // Connection string to the Azure storage account where data tables for observations, transactions and balances are stored
      "DataConnString": ""
    },
    // The network passphrase used when signing transactions. The following passphrases are currently in use:
    // Test: "Test SDF Network ; September 2015"
    // Live: "Public Global Stellar Network ; September 2015"
    "NetworkPassphrase": "",
    // Address of Horizon REST Api endpoint. The following public endpoints are available:
    // Test: https://horizon-testnet.stellar.org/
    // Live: https://horizon.stellar.org/
    "HorizonUrl": "",
    // Array with url formats of blockchain explorers
    // Test: https://stellar.expert/explorer/testnet/account/{0}, http://testnet.stellarchain.io/address/{0}
    // Live: https://stellar.expert/explorer/public/account/{0}, https://stellarchain.io/address/{0}
    "ExplorerUrlFormats": [ "https://stellar.expert/explorer/testnet/account/{0}", "http://testnet.stellarchain.io/address/{0}" ]
  },
  "SlackNotifications": {
    "AzureQueue": {
      // Connection string to the Azure storage account where slack notifications are queued
      "ConnectionString": "",
      // The name of the queue for the slack notifications
      "QueueName": ""
    }
  }
}

Tests

End-to-end tests are available as postman collection. Can be run directly in postman or on the command line.

  • Install newman:
npm install -g newman
  • Start Api and Sign services
  • Set URLs in the pre-request script of INIT to point to the Api and Sign service:
// set global variables
pm.globals.set("URL", "http://localhost:5000");
pm.globals.set("URL_SIGN", "http://localhost:5001");
  • Start tests:
newman run LykkeStellarApiTests.postman_collection.json

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.9%
  • Other 0.1%