{"id":19206589,"url":"https://github.com/concordium/concordium-rust-sdk","last_synced_at":"2025-04-06T20:09:03.002Z","repository":{"id":37767943,"uuid":"384022996","full_name":"Concordium/concordium-rust-sdk","owner":"Concordium","description":"Rust SDK for the Concordium blockchain.","archived":false,"fork":false,"pushed_at":"2025-02-27T16:42:19.000Z","size":1788,"stargazers_count":17,"open_issues_count":11,"forks_count":17,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T20:54:38.688Z","etag":null,"topics":["blockchain","concordium","rust","sdk"],"latest_commit_sha":null,"homepage":"https://docs.rs/concordium-rust-sdk/latest/concordium_rust_sdk/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Concordium.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-08T06:24:26.000Z","updated_at":"2025-03-14T12:46:21.000Z","dependencies_parsed_at":"2023-02-17T05:30:39.640Z","dependency_job_id":"6d7b987f-c5c8-4cd3-a59d-04f6baf96afd","html_url":"https://github.com/Concordium/concordium-rust-sdk","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Concordium%2Fconcordium-rust-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Concordium%2Fconcordium-rust-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Concordium%2Fconcordium-rust-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Concordium%2Fconcordium-rust-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Concordium","download_url":"https://codeload.github.com/Concordium/concordium-rust-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543589,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","concordium","rust","sdk"],"created_at":"2024-11-09T13:16:21.897Z","updated_at":"2025-04-06T20:09:02.968Z","avatar_url":"https://github.com/Concordium.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI](https://github.com/Concordium/concordium-rust-sdk/actions/workflows/build-and-test.yaml/badge.svg)\n\n# An SDK for Rust to interact with the Concordium blockchain\n\nThe SDK has support for constructing and sending transactions, and for querying\nvarious aspects of the chain and the node itself.\n\nThe SDK version 2 supports both the old V1 node GRPC API (accessible via the\n`endpoints` module) as well as the new V2 API (accessible via the `v2` module).\nNew users should use the API since it is more flexible, has more features, and\nperforms better. The V1 API will be deprecated in the next SDK version.\n\n## Minimum supported Rust version\n\nThe minimal supported rust version is stated in the `Cargo.toml` manifest. A\nMSRV bump will be accompanied by at least a minor version bump of the SDK.\n\n## Add it to your project\n\nThe SDK is published on [crates.io](https://crates.io/crates/concordium-rust-sdk).\n\n```shell\ncargo add concordium-rust-sdk\n```\n\n## Versions\n\n- Node version compatibility: 5.4+\n\n## Basic usage\n\nThe core structure of the SDK is the\n[Client](https://docs.rs/concordium-rust-sdk/latest/concordium_rust_sdk/v2/struct.Client.html)\nwhich maintains a connection to the node and supports querying the node and\nsending messages to it. This client is cheaply clonable.\n\nThe `Client` is constructed using the [new](https://docs.rs/concordium-rust-sdk/latest/concordium_rust_sdk/v2/struct.Client.html#method.new) method.\n\n```rust\nuse concordium_rust_sdk::*;\n\n#[tokio::main(flavor = \"multi_thread\")]\nasync fn main() -\u003e anyhow::Result\u003c()\u003e {\n    // Establish a connection to the node running locally and listening on port 20000\n    let mut client = v2::Client::new(v2::Endpoint::from_str(\"http://localhost:20000\")?).await?;\n\n    // Query consensus information and print it as JSON\n    let consensus_info = client.get_consensus_info().await?;\n    println!(\"{}\", serde_json::to_string_pretty(\u0026consensus_info).unwrap());\n    Ok(())\n}\n```\n\n## Signing transactions\n\nThe\n[`transactions::send`](https://docs.rs/concordium-rust-sdk/latest/concordium_rust_sdk/types/transactions/send/index.html)\ncontains methods for constructing and sending transactions. There is an\naccompanying module\n[`transactions::construct`](https://docs.rs/concordium-rust-sdk/latest/concordium_rust_sdk/types/transactions/construct/index.html)\nwhich can be used if transactions only need to be constructed, but not\nimmediately signed.\n\nEach supported transaction has a method to construct it that takes minimal data\nneeded for the transaction. Once a transaction is constructed it can be sent to\nthe node and the chain using the\n[`send_block_item`](https://docs.rs/concordium-rust-sdk/latest/concordium_rust_sdk/v2/struct.Client.html#method.send_block_item)\nendpoint.\n\n## Examples\n\nThere are a number of examples showing basic usage of the different endpoints.\nThey can be found in the [examples](./examples) directory.\n\nAs a basic example, see [v2_send_transfer](./examples/v2_send_transfer.rs) for a\ncomplete example of constructing a transfer transaction and sending it.\n\nAll examples can be compiled with\n\n```shell\ncargo build --release --example $NAME\n```\n\nfor example\n\n\n```shell\ncargo build --release --example v2_send_transfer\n```\n\n## Documentation\n\nThe rendered documentation is available at https://docs.rs/concordium-rust-sdk/latest/\n\n## Migration from V1 to V2\n\nThe endpoints in V1 and V2 APIs for the most part mirror each other. However\nsome endpoints were split in the V2 API to make it possible to only query data\nthat is commonly needed faster. The main differences are\n\n- The `V1` endpoint `get_block_summary` has been split into\n  - `get_block_events` (for transaction events, i.e., outcomes of transactions\n    sent by users)\n  - `get_block_special_events` (for special events such as CCD minting, and delegation/baker rewards)\n  - `get_chain_parameters` for chain parameters\n  - `get_update_next_sequence_numbers` for sequence numbers of update instructions\n  - `get_finalization_summary` for the details of finalization records in a\n    block.\n\n- The node information has been consolidated into two endpoints,\n  `get_node_info`, and `get_peers_info`, the latter of which now returns both\n  the list of peers and their details.\n\n## For developers\n\nThe SDK relies on files generated from [protobuf schemas](https://github.com/Concordium/concordium-grpc-api).\nThese files are committed to the repository so that users of the SDK do not have to have the\nprotobuf compiler installed in order to use the SDK.\n\nOccasionally there is a need to update the generated files, if the schemas\nchange. This can be done by compiling the SDK using the `generate-protos`\nfeature, i.e.,\n\n```\ncargo build --features=generate-protos\n```\n\nUpdating these files should only be done when the node's API, determined by the\nschemas, changes and we need to support the new API in the SDK.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcordium%2Fconcordium-rust-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconcordium%2Fconcordium-rust-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcordium%2Fconcordium-rust-sdk/lists"}