System Architecture Overview - ajuna-network/Polkadot.Unity.SDK GitHub Wiki
Welcome to the system architecture overview for the Substrate xyz .NET implementation. This framework is crafted to facilitate robust interactions with Substrate blockchain nodes through .NET technologies. In this documentation, we will delineate the core components, elaborate on their functionalities, and illustrate their interplay within the ecosystem.
Building upon the Substrate .NET API, the Polkadot SDK for Unity offers enhanced capabilities including Wallet integration and Toolchain-generated artifacts, streamlining comprehensive blockchain access. Developers are presented with multiple pathways for integration, highlighting the importance of a foundational understanding of each component's utility and the advantages they bring to the table. This understanding is crucial for a seamless and effective integration process.
The Substrate .NET API serves as the foundational framework for interfacing with Substrate blockchain nodes. It facilitates essential blockchain-specific integrations and conversions, such as JSON RPC access, SCALE-encoding, and type conversions from Rust to C#. Additionally, it includes cryptographic algorithms necessary for payload signatures and other blockchain operations, thereby streamlining node communication.
Key features
- SubstrateClient: A client communicates with RPC nodes, allowing users to query blockchain data, submit extrinsic, and listen to network events.
- Base Substrate Types: It supports the necessary base Substrate/Rust types, ensuring accurate data representation and operations, including SCALE encoding and decoding.
Namespace
Substrate.NetApi
The Substrate .NET Extension is a dynamically generated wrapper that serves as an integration artifact. It provides streamlined access to storage, calls, constants, events, and errors for a specific blockchain. Given that each Substrate blockchain can have a unique set of core modules and custom-developed pallets, the access needs for each blockchain vary. The blockchain exposes metadata that is utilized by the Substrate .NET Toolchain to generate multiple artifacts, including this extension as well as specific REST Services and Clients tailored to the blockchain.
The Substrate.NetApi includes basic Rust types but lacks blockchain-specific structures. These structures are automatically generated from the blockchain's metadata in the extension. This ensures that the extension offers precisely calibrated access to the specific chain for which it was generated.
Key features
- SubstrateClientExt: An extended offering of access to each blockchain pallet, and its specific storage, calls, constants, and errors.
- Substrate Types: It supports all necessary Substrate/Rust types, that are used and exposed in the blockchain pallets.
Namespace
-
Substrate.<xyz>.NET.NetApiExt.Generated
(xyz = specific blockchain, Polkadot, Kusama, ...)
Structure
-
Model
- each pallet/module, includes the specific pallet enumerations call, error, and event, and the necessary types.
- each pallet/module, includes the specific pallet enumerations call, error, and event, and the necessary types.
-
Storage
- each exposed pallet, includes storage & call wrappers, and access to constants, and errors
- each exposed pallet, includes storage & call wrappers, and access to constants, and errors
- Types contain generic types used, by the pallets
For further insides in Wrapper and Integration patterns, see Extension, Wrapper & Dependencies
The Substrate .NET Wallet is a comprehensive wallet functionality package for Substrate-based nodes, designed to integrate with various .NET standards including NETStandard 2.0, NETStandard 2.1, and NET6.0. The wallet provides a robust set of features for account management, cryptographic operations, and secure storage.
Key features
- Keyring Creation: Establish a new keyring with default or specified ss58 address formats.
- Mnemonic Phrase Generation: Securely generate new mnemonic phrases with varying word counts for new accounts.
- Account Import: Import existing accounts using mnemonic phrases, unlocking all features for transaction signing.
- Account Export: Export accounts to secure files with password protection for storage or transfer.
- Wallet Import: Import wallets from JSON files and unlock them using associated passwords.
- Signing and Verification: Use accounts to sign messages and verify signatures, ensuring authenticity and integrity.
Namespace
Substrate.NET.Wallet