Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

threefoldtecharchive/grid3_client_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TF Chain client

DEPRECATED: moved to https://github.com/threefoldtech/tfchain/tree/development/tfchain_client

Run the examples

cargo run

Usage

// Create a keypair from phrase or secret
let mnemonic = "<words>";
let p = client::get_from_seed(mnemonic, None);

// Specify the network (devnet, testnet or mainnet)
let network = "mainnet";

// Construct the client and provide a websocket endpoint and port
let cl = client::TfchainClient::new(String::from("ws://127.0.0.1:9944"), p, network).await?;

// Get a twin by ID (example)
let twin = cl.get_twin_by_id(1, None).await?;
println!("got twin: {:?}", twin);

Development

When the runtime has changed you generate the base client like:

subxt metadata -f bytes --url http://localhost:9933 > artifacts/network.scale

About

Grid 3 Rust client

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages