Introduction To Stratis Platform - Blockchain for C# and .NET Developers

Introduction

 
Stratis Platform is a flexible, powerful Blockchain development platform designed originally for the needs of real-world financial services businesses. It also provides benefits to other types of organizations that want to leverage Blockchain technologies. It is a turnkey solution that enables developers and business to develop, test, and deploy Blockchain-based applications without having to operate their own network infrastructure.
 
What is Stratis Platform?
 
Stratis Group
 
Before I explain Stratis Platform, I want to talk about Stratis Group first. Stratis Group is a UK based Blockchain technology company that offers native C# and .NET end-to-end block solutions. Be more specific, Stratis Group offers
 
Stratis Platform
 
A suite of open source projects on GitHub that covers Blockchain Full Node, Blockchain Full Node UI, Cryptocurrency, Cryptocurrency Wallet, Smart Contract, ICO Platform, etc. The purpose is to provide .NET developers a flexible and powerful blockchain development platform that can be used for any purpose.
 
Cloud Stratis
 
A block-as-a-service in Cloud, especially Azure. 
 
STRATX
 
A cryptocurrency
On top of that, Stratis provides development and integration services to organizations that are looking for implementing private Blockchain or connecting into existing Blockchain networks.
 
Stratis Platform
 
Stratis platform offers a solution for the fast creation of individual chains on the basis of their own Blockchain. These chains can vary in accordance with the needs of your company and even play a popular function of the Blockchain, such as Ethereum or Lisk that can be tested individually or simultaneously. 
 
Some of the advantages of the Stratis project that will affect the real world are the following,
  • Medical Research
     
    Stratis Blockchain will allow you to maintain a database where the reviewer, researcher, and publisher can work with legitimate data.
     
  • Internet Business
     
    Services can be served by Blockchain. For example, a smart lock supported by the Stratis platform will allow people to access a fully automated lease on Airbnb without human interaction.
     
  • Fintech
     
    Stratis will help with trust, data leakage, identity management, settlement management, and others using Blockchain.
Smart Contract on Stratis Platform
 
Smart Contract becomes a crucial feature of a Blockchain platform for enterprise use. The good news is that Stratis platform does have this capability. The following is a very brief comparison among three smart contract Blockchains: Stratis Platform, Ethereum, and Neo
  • Stratis, Ethereum, Neo all support smart contracts. Ethereum only supports writing smart contracts in Solidity language. Stratis and Neo support several popular languages - C#, Java, JavaScript.
  • Stratis maintains contracts for the sidechained. Ethereum has each contract comes from the Blockchain Ethereum.
Building and Running a Stratis Full Node
 
A full node is a computer that connects to a Blockchain network. It stores all Blockchain data locally and be able to communicate with other nodes via P2P protocols. To build and run a Stratis full node is the very first step getting started with the Stratis development.
 
Prerequisites
 
In order to build and run a Stratis full node, you need to meet the following prerequisites
  • System Prerequisites
     
    A Stratis Full Node can be run on a Windows, Linux, or macOS.

  • Windows must be Windows 7 and later.
  • Ubuntu 14.04 and later is recommended, but you should be able to run on other distros of Linux.
  • macOS must be OS X 10.12 and later.
  • Framework Prerequisites
     
    .NET Core 2.0 and later

  • Tools and Utilities
     
    Git
Stratis Full Node on Windows
 
I will use Windows as the example to build and run a Stratis full node,
  1. Create a folder Repos in C drive
     
    C:\> mkdir Repos
     
  2. Go into the Repos folder
     
    C:\> cd Repos
     
  3. Get the repository from GitHub
     
    C:\Repos> git clone https://github.com/stratisproject/StratisBitcoinFullNode.git
     
  4. Go into the StratisBitcoinFullNode folder
     
    C:\Repos> cd StratisBitcoinFullNode\src
You can see all the Stratis modules by list the current directory. 
 
Stratis
 
The solution can be opened with Visual Studio 2017. You can download a copy Community Edition for personal use from here.
  1. Restore NuGet packages
     
    C:\Repos\StratisBitcoinFullnode\src> dotnet restore
     
  2. Build the code
     
    C:\Repos\StratisBitcoinFullnode\src> dotnet build
     
  3. Run Stratis full node,
     
    You can connect Stratis full node with different Blockchain network
    • Run Stratis full node on Bitcoin network
       
      C:\Repos\StratisBitcoinFullnode\src> cd Stratis.BitcoinD
       
      C:\Repos\StratisBitcoinFullnode\src\Stratis.BitcoinD> dotnet run
       
      Stratis
       
    • Run Stratis full node on Bitcoin test network
       
      C:\Repos\StratisBitcoinFullnode\src> cd Stratis.BitcoinD
       
      C:\Repos\StratisBitcoinFullnode\src\Stratis.BitcoinD> dotnet run -testnet
       
      Stratis
       
    • Run Stratis full node on Stratis network
       
      C:\Repos\StratisBitcoinFullnode\src> cd Stratis.StratisD
       
      C:\Repos\StratisBitcoinFullnode\src\Stratis.StratisD> dotnet run
       
      Stratis
       
    • Run Stratis full node on Stratis test network
       
      C:\Repos\StratisBitcoinFullnode\src> cd Stratis.StratisD
       
      C:\Repos\StratisBitcoinFullnode\src\Stratis.StratisD> dotnet run -testnet
       
      Stratis
       
  1. View Node Status via Swagger web interface,
     
    When your full node is up and running, you can view Swagger web interface from your browser,
     
    1. For Bitcoin: http://localhost:37220/swagger
    2. For Stratis: http://localhost:37221/swagger
    3. For Bitcoin Testnet: http://localhost:38220/swagger
    4. For Stratis Testnet: http://localhost:38221/swagger
The following is a Stratis API page display at http://localhost:38220/swagger for a full node on Stratis Network.
 
Stratis
 
APIs can be called directly on the Swagger interface. For example, you want to call “GET /api/BlockStore/getblockcount”
  • Click the API to expand it
  • Click “Try it out!” button
  • You will see request and response are displayed on the screen.
     
    Stratis
Notes
  • The Swagger interfaces for Bitcoin Network and Bitcoin Test Network do not work on my computer.
  • If you get a “This site can’t be reached” message when you are opening Swagger interface for your full node on Stratis network, you just need to wait a little bit. The full node needs a little bit of time to be ready.
    1. Run the node with RPC turned on
       
      A different way of running the full node is to have the RPC turned on with the following command,
       
      dotnet run -server=1 -rpcuser=user -rpcpassword=pass
       
      You can develop a client application to get node information and control it via the RPC interface.

Summary

 
For .NET developers who want to get their feet wet on Blockchain development, there are not many choices. Most of Blockchain networks are built with C++. Stratis Platform is one of the best .NET based Blockchain Platforms in the market.
 
  


Similar Articles