First Steps - ajuna-network/Polkadot.Unity.SDK GitHub Wiki

As a basic first step, you should define what the is the scope of your environment and the targeted blockchain(s) of your dApp.

Different targets will need the use of different targets. Find your target at https://polkadot.js.org/apps/, for more information about the targets, check out the example targets.

Access a single Production Blockchain

If you want to access a blockchain that is already up and running and accessible through a (secure) web socket, you can generate the Extension and start accessing the functionalities. The Extensions for Polkadot and Kusama, are provided in the Polkadot SDK for Unity, allowing you to access and start developing right away, by using the provided libraries.

  • Assembly Substrate.Polkadot.NET.NetApiExt (Substrate.Polkadot.NET.NetApiExt.dll)
  • Assembly Substrate.Kusama.NET.NetApiExt (Substrate.Kusama.NET.NetApiExt.dll)

Access a multiple Production Blockchains

Accessing multiple blockchains in a single project can be challenging, since there is currently no generic wrapper, to access basic functionalities, like transfer balances, or accessing account information. This is due to the nature of the individual blockchains, defining on their own which version of a pallet they run. As an example, a Parachain can run a very old version of the frame system account pallet, leading to a different structure of AccountInfo, and with C# being a typed language, we do face here a challenge. Of course, there are solutions, and workarounds that allow to use of multiple blockchains in a single project, for example, please check out the Explorer Demo project.

Example:

  • old version of [Account](system.account: FrameSystemAccountInfo)
{
  nonce: 0
  consumers: 0
  providers: 0
  sufficients: 0
  data: {
    free: 0
    reserved: 0
    miscFrozen: 0
    feeFrozen: 0
  }
}
  • new version of [Account](system.account: FrameSystemAccountInfo)
{
  nonce: 0
  consumers: 1
  providers: 1
  sufficients: 0
  data: {
    free: 1,817,782,297,000,000
    reserved: 2,613,650,000,000
    frozen: 0
    flags: 170,141,183,460,469,231,731,687,303,715,884,105,728
  }
}

Access a local blockchain or self-hosted blockchain

To explore and access a local blockchain, you can either test the provided example around the game Hexalem, which provides a docker image facilitating the execution of a local blockchain and can be used to play Hexalem, see demo game docker and use Assembly Substrate.Hexalem.NET.NetApiExt (Substrate.Hexalem.NET.NetApiExt.dll).

To create a development environment from scratch, to be used to start developing your pallet, and its integration into Unity, follow the guide for a full development environment on a local blockchain.

Example Targets

Polkadot Ecosystem Blockchain(s)

There are currently close to ~50 Blockchains under the Relaychain Polkadot, and each has an individual set of pallets/modules to interact with, in the following table, some are pointed out as examples in the following table.

Network Category Example RPC Endpoint Example Link
Polkadot Relay Chain wss://1rpc.io/dot via Automata 1RPC
AssetHub System Parachain wss://statemint-rpc.dwellir.com via Dwellir
BridgeHub System Parachain wss://polkadot-bridge-hub-rpc.dwellir.com via Dwellir
Collectives System Parachain wss://polkadot-collectives-rpc.dwellir.com via Dwellir
Acala Parachain wss://polkadot-collectives-rpc.dwellir.com via LuckyFriday
Ajuna Network Parachain wss://ajuna.api.onfinality.io/public-ws via OnFinality
Astar Parachain wss://astar.public.curie.radiumblock.co/ws via RadiumBlock
... Parachain wss://... via ...
Zeitgeist Parachain wss://zeitgeist-rpc.dwellir.com via via Dwellir

Kusama Ecosystem Blockchain(s)

There are currently close to ~46 Blockchains under the Relaychain Kusama, and each has an individual set of pallets/modules to interact with, in the following table, some are pointed out as examples in the following table.

Network Category Example RPC Endpoint Example Link
Kusama Relay Chain wss://ksm-rpc.stakeworld.io via Stakeworld
AssetHub Kusama System Parachain wss://kusama-asset-hub-rpc.polkadot.io via Parity
BridgeHub Kusama System Parachain wss://sys.ibp.network/bridgehub-kusama via IBP-GeoDNS1
Encointer Network System Parachain wss://kusama.api.encointer.org via Encointer Association
Acurast Canary Parachain wss://acurast-canarynet-ws.prod.gke.papers.tech via Acurast
Bajun Network Parachain wss://bajun.api.onfinality.io/public-ws via OnFinality
... Parachain wss://... via ...
Turing Network Parachain wss://turing-rpc.dwellir.com via via Dwellir

Other Targets, beyond Polkadot & Kusama

The Polkadot SDK for Unity provides access to a wide range of substrate-based blockchains beyond the Polkadot Ecosystem, which consists of all Parachains running under the Releychains Polkadot & Kusama. All those networks are accessible and integrated with this SDK, facilitating a broad spectrum of development possibilities.

Networks Referenced in Polkadot.js

Several blockchains are listed in Polkadot.js and can be easily accessed using the Polkadot SDK for Unity. Some notable examples include:

Networks Not Referenced in Polkadot.js

Additionally, there are other networks not listed in Polkadot.js but are still compatible with the Polkadot SDK for Unity. A key example of such a network is:

  • Enjin
  • ... and many more

All these networks, whether listed in Polkadot.js or not, are fully integrated with the Polkadot SDK for Unity, opening up a diverse range of development opportunities for users.


Local Target Connection

When running a node, the default local target is ws://127.0.0.1:9944. This WebSocket connection is exposed in the node's startup logs.

Example of Node Startup Log:
Node Startup Log
Note: This log shows the connection being established.

To test and execute reference calls, connect via Polkadot.JS Interface. This interface provides a user-friendly way to interact with the node.

Polkadot.JS Connection Interface:
Polkadot.JS Interface
Note: The interface allows for comprehensive node interactions.