basm-sdk-community

Crates.iobasm-sdk-community
lib.rsbasm-sdk-community
version0.1.0
created_at2025-08-09 17:31:00.171277+00
updated_at2025-08-09 17:31:00.171277+00
descriptionCommunity SDK for the Blocky Attestation Service
homepagehttps://github.com/mattjurenka/basm-sdk-community
repositoryhttps://github.com/mattjurenka/basm-sdk-community
max_upload_size
id1788097
size18,974
Matthew Jurenka (mattjurenka)

documentation

https://github.com/mattjurenka/basm-sdk-community

README

BASM Sdk Community

This crate is a community maintained sdk for the Blocky Attestation Service developed by https://www.blocky.rocks/

Example

use basm_sdk_community::{
    http::send_http_request,
    prelude::*
};
use serde::{Serialize, Deserialize};

#[derive(Serialize, Deserialize, Debug)]
pub struct OutputJson {
    error: String,
    data: u64
}

#[bky_entrypoint]
pub fn entrypoint(ctx: Context<String, String>) -> OutputJson {
    let result = send_http_request(
        "GET".into(),
        "https://example.com/api/v2/test".into(),
        &BTreeMap::from([
            ("Content-Type".into(), vec!["application/json".into()]),
        ]),
        &[]
    );

    // Printing http result to log outputted by blocky service
    log!(
        "HTTP Request Result: {:?}",
        result
    );

    let rand_number = rand::random::<u64>();
    // Printing random number to terminal running blocky service for debugging
    host_log!(
        "Printing a random number: {}",
        rand_number
    );

    OutputJson {
        error: String::new(),
        data: rand_number
    }
}

An example crate that consumes this sdk can be found here.

Build Environment

This crate is meant to be used with the wasm32-wasip1 build target on release profile (--release). When using this library, it is ok to use std, however things that the Blocky service doesn't provide like File IO won't work.

Please look in the integration test example repo for more information on how to setup a crate to work properly. In addition the .cargo/config.toml is important to set additional linker settings that are necessary for the wasm executable to run on the Blocky service.

Commit count: 0

cargo fmt