Demos

Overview & Structure

The Ajuna.SDK.Demos repository contains basic examples of how this .NET toolchain can be used.

This demo repository is in a Work in Progress state since we will be constantly enriching it in the coming weeks/months.

Demo Repo Structure

To make the demos as easy to understand as possible, we have created separate Console Applications for each use case.

The Solution has three folders:

Scaffolded Projects

This folder contains the generated projects of Ajuna.SDK:

These projects were generated against Substrate Node (monthly-2022-07).

Node Direct Access

This folder contains three demos that use our SubstrateClientExt (part of SubstrateNET.NetApi) to directly interact with the node.

  • Ajuna.SDK.Demos.DirectPolling which shows how to poll the node for storage changes directly.

  • Ajuna.SDK.Demos.DirectSubscription which shows how to subscribe to the node for storage changes directly.

  • Ajuna.SDK.Demos.DirectBalanceTransfer which shows how to do a balance transfer from Alice to Bob using the SubstrateClientExt.

  • Ajuna.SDK.Demos.NetWallet which shows how to use the NetWallet to create, store an account and retrieve it to execute an extrinsic - Balance Transfer.

Node Access via Service Layer

This folder contains two demos that use a RestClient (part of SubstrateNET.RestClient) that interacts with a RestService (part of SubstrateNET.RestService), which is responsible for communicating with the node.

  • Ajuna.SDK.Demos.ServicePolling which shows how to poll the node for storage changes using the RestService.

  • Ajuna.SDK.Demos.ServiceSubscription which shows how to directly subscribe to the node for storage changes using the RestService.

This folder contains two demos that use a RestClient (part of SubstrateNET.RestClient) that interacts with a RestService (part of SubstrateNET.RestService) which is responsible for communicating with the node.

  • Ajuna.SDK.Demos.ServicePolling which shows how to poll the node for storage changes using the RestService.

  • Ajuna.SDK.Demos.ServiceSubscription which shows how to directly subscribe to the node for storage changes using the RestService.

Getting Started

The first and most important prerequisite is to have a running Substrate node.

Spin up a local substrate node

Currently, you should find the most recent monthly build with a pre-generated tag in this repo, so make sure you chose a supported monthly substrate tag (ex. monthly-2022-07)

git clone -b monthly-2022-11 --single-branch https://github.com/paritytech/substrate.git
cargo build -p node-cli --release

./target/release/substrate --dev

Start the RestSevice

In the 'Node Access via Service Layer' Demos, you will also need a running RestService for you RestClient to interact with.

To achieve this, open a terminal within the SubstrateNET.RestService folder and execute:

dotnet run

Last updated