Introduction
This article describes what is Swagger and how we can perform blockchain transactions using Stratis Blockchain APIs and Swagger with an example. In the previous part of this article series, we got to know about different blockchain networks and performed a transaction using Stratis Cirrus Core Private Net Wallet. You can refer to the previous part of the article series here. In this part, we will do a similar transaction, get to know how to interact with Stratis Full Node APIs with Swagger as well as will get familiar with some of the Stratis Blockchain API endpoints.
What is Swagger?
Swagger is a tool that simplifies API development for millions of developers, users, teams, and enterprises. It is open-source and used by several enterprise application developers.
- It is an interface description language for RESTful APIs.
- It provides a direct connection to the live APIs through an interactive user interface.
- Swagger UI visualizes Open-API definitions through an interaction Html based user interface.
Swagger can be used for:
- Developing APIs
- Interacting or Testing APIs
- Documenting APIs
Let’s move for hands-on. In this hands-on, we will be performing transactions using the Swagger API. Stratis Full Node is the core of Stratis blockchain. This is the first and very crucial step to set up and run the Stratis Full Node on your development machine to get started with blockchain development. This is needed to run the project locally and interact with the Stratis Blockchain. You need to be familiar with it to know about Stratis blockchain core APIs. In this part, we will cover some basic API interactions and perform the transaction on Stratis Blockchain through Swagger.
Create a Private Blockchain Network
Firstly, we need to create a private or local blockchain network. There are two ways to create a private instance of the Stratis Blockchain network to interact with Stratis Full Node API locally:
- Running Cirrus Core Private Net wallet or
- Running Stratis Full Node project.
You can choose any of these. For beginners using a wallet is an easier approach.
Method 1- Running Cirrus Core Wallet and Creating Network
Cirrus Core Private Net wallet is designed to launch the node for a local development environment to deploy, call the contract, and ease of use for developers to build the solutions without external interference. It runs with an instance of the Stratis Full Node; ‘Stratis.CirrusMinerD’ project in devmode=miner. It provides a graphical user interface for developers to get familiar with cirrus wallet. This wallet is a private instance of the Cirrus Wallet.
If you don’t have Cirrus core private net wallet, then you can download it from here and install it.
To create a Stratis Private Blockchain network, firstly, open your Cirrus core private net wallet. After that, you can go to the browser and see the Stratis fullnode Blockchain APIs. Open Swagger in the browser by clicking http://localhost:38223/swagger/index.html. The Swagger interface will look like the one below.

Method 2- Downloading and Running Full Node
Download the full Node from here. Alternatively, you can clone the Stratis Full Node.
git clone https://github.com/stratisproject/StratisFullNode.git
Once the Stratis Full Node is downloaded, go to the folder and open the Stratis Full Node solution in Visual studio, there, you will see many projects; however, you need to run the Stratis.CirusMinerD project with the -devmode parameter by executing the below command from CLI.
cd StratisFullNode\src\Stratis.CirrusMinerD
dotnet run -devmode=miner
or
Right-click on “Stratis.CirrusMinerD” Project and click on Open in Terminal then run below command.
dotnet run -devmode=miner
The above command runs a single block-producing node using the PoA (Proof-of-Authority) consensus algorithm. After the successful execution of the above command, open the http://localhost:38223/swagger in your device where you can see a list of APIs. These API endpoints will be used to interact with the blockchain.
Run Full Node Cirrus MinerD project.

When you observe the command window, initially there are two wallets in this demo example. However, if you are running the full node for the very first time you will have only one wallet: cirrusdev, having a balance of 100,000 TCRS.

Interact with Stratis Full Node API
Create a New Wallet
Once Stratis.CirrusMinerD project is running, open Swagger in the browser by clicking http://localhost:38223/swagger/index.html.
Go to Wallet and click on API endpoint: /api/Wallet/mnemonic. Then click on Try it out.

Then click Execute. You will get 12-word phrases in the response body that are called mnemonic. Copy it and keep those safe.

Now, we will create a new wallet using the above mnemonic. Go to API endpoint: /api/Wallet/create and click on Try it out.
Provide the mnemonic which was generated in the earlier step, password, name, and passphrase for the wallet that you are going to create, and click on Execute.

Once the wallet is created, you will get response code 200 as shown below.

Keep safely the wallet details such as:














Join the conversation! Your thoughts help the community grow.