Skip to content

logion-network/logion-offchain-client-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

offchain-client

This package essentially contains some code written in RUST that

  • connects to a Logion para- or solo-chain.
  • displays some info queried in the storage.

Among others, one possible usage is to write migrations that do not fit in one block.

It relies on subxt (doc / book / github / examples)

Create metadata from a running node

  1. Pre-requisite: install subxt-cli:
cargo install subxt-cli
  1. Generate metadata

Similarly to typescript, metadata are generated by running this command (nnn is the value of spec_version).

subxt metadata --url wss://dev-rpc01.logion.network -f bytes > ./metadata/logion-nnn.scale
subxt metadata --url wss://dev-rpc01.logion.network -f json > ./metadata/logion-nnn.json

Note that json format is not directly used but is useful for comparing metadata from different nodes/versions.

The generated scale file needs to be references in the code:

#[subxt::subxt(runtime_metadata_path = "metadata/logion-nnn.scale")]
pub mod polkadot {}

Run the client

cargo run

About

A template of RUST client to connect to Logion chain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages