Skip to content

KBryan/algorand_rust_sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust algorand sdk

Documentation

Please visit for active project

https://github.com/manuelmauro/algonaut

This is the current Rust version implementation of the Algorand SDK
General Algorand documentation is available at https://developer.algorand.org/

Please look at the examples for Rust Algorand usage.
You can also find Algorand Rust documentation at https://docs.rs/algo_rust_sdk/1.0.3/algo_rust_sdk/
This repo is in RAPID development and subject to breaking changes
and doesn't mirror this repo please visit https://crates.io/crates/algo_rust_sdk
For stable release candidate and documentation.

Quickstart

This quick start guide assumes the user has the Algorand Sandbox 2.x installed.
and using this repo as source.

use std::error::Error;

use algo_rust_sdk::AlgodClient;

fn main() -> Result<(), Box<dyn Error>> {
    let algod_address = "http://localhost:4001";
    let algod_token="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

    let algod_client = AlgodClient::new(algod_address, algod_token);

    // Print algod status
    let node_status = algod_client.status()?;
    println!("algod last round: {}", node_status.last_round);
    println!(
        "algod time since last round: {}",
        node_status.time_since_last_round
    );
    println!("algod catchup: {}", node_status.catchup_time);
    println!("algod latest version: {}", node_status.last_version);

    // Fetch block information
    let last_block = algod_client.block(node_status.last_round)?;
    println!("{:#?}", last_block);

    Ok(())
}

About

This is experimental and only serves as a resource for how one would create a Rust SDK. Please visit https://developer.algorand.com For the official Algorand Rust SDK.

Resources

License

Stars

Watchers

Forks

Packages

No packages published