{"id":22243692,"url":"https://github.com/kompendium-ano/factom-rust-client","last_synced_at":"2025-07-28T01:33:08.416Z","repository":{"id":57627224,"uuid":"176897732","full_name":"kompendium-ano/factom-rust-client","owner":"kompendium-ano","description":"Rust JSON-RPC client for the Factom protocol","archived":false,"fork":false,"pushed_at":"2020-12-10T13:03:50.000Z","size":606,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-13T03:17:50.927Z","etag":null,"topics":["factom","factom-blockchain","json-rpc-client","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kompendium-ano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-21T08:02:47.000Z","updated_at":"2021-03-03T13:35:19.000Z","dependencies_parsed_at":"2022-08-23T17:10:54.194Z","dependency_job_id":null,"html_url":"https://github.com/kompendium-ano/factom-rust-client","commit_stats":null,"previous_names":["kompendium-llc/factom-rust-client"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kompendium-ano/factom-rust-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kompendium-ano%2Ffactom-rust-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kompendium-ano%2Ffactom-rust-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kompendium-ano%2Ffactom-rust-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kompendium-ano%2Ffactom-rust-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kompendium-ano","download_url":"https://codeload.github.com/kompendium-ano/factom-rust-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kompendium-ano%2Ffactom-rust-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267451073,"owners_count":24089291,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["factom","factom-blockchain","json-rpc-client","rust"],"created_at":"2024-12-03T04:28:34.005Z","updated_at":"2025-07-28T01:33:08.117Z","avatar_url":"https://github.com/kompendium-ano.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Factom Rust API Client\n[![Build Status](https://travis-ci.com/kompendium-llc/factom-rust-client.svg?branch=master)](https://travis-ci.com/kompendium-llc/factom-rust-client)\n![Github Action Rust](https://github.com/kompendium-ano/factom-rust-client/workflows/Rust/badge.svg)\n[![Crates.io](https://img.shields.io/crates/v/factom.svg)](https://crates.io/crates/factom)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## Installation\n\nAdd to cargo.toml:\n```toml\n[dependencies]\nfactom = \"^2\"\n```\n\n## Quickstart\n```rust\nuse factom::*;\n// Get current block height from open node\n#[tokio::main]\nasync fn main() {\n  //Create a re-usable client\n  let client = Factom::open_node();\n  // Call the heights function, handle the request result\n  let response = factomd::heights(\u0026client).await.expect(\"Network Request\");\n  assert!(response.result.leaderheight \u003e 0);\n}\n```\n## Usage\nSee the examples folder for common workflows, or use `cargo run --example` to\nview all those you can run.\n\n##### Configuration\n```rust\n// Default settings\n// factomd: http://localhost:8088\n// factom-walletd: http://localhost:8089\nlet client = Factom::new();\n\n// Using open node\n// factomd: https://api.factomd.net/v2\nlet client = Factom::open_node();\n\n// Using the tesnet open node\n// factomd: https://dev.factomd.net/v2\nlet client = Factom::testnet_node();\n\n// Using custom node locations\nlet factomd = \"https://api.factomd.net/\";\nlet factom_walletd = \"http://192.168.1.42:18089\";\nlet client = Factom::custom_node(factomd, factom_walletd)\n```\n\n##### Retrieve a Balance\n```rust\nlet client = factom::testnet_node();\nlet testnet_address = \"FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q\";\nlet response = balance::factoid_balance(\u0026client, testnet_address).await.unwrap();\n// factoid balance returns factoshis, convert\nlet factoids = utils::factoshis_to_fct(response.result.balance);\nprintln!(\"The testnet balance of {} is {} factoids\", FCT_PUB, factoids);\n```\n\n##### Get Entry Data\n```rust\nlet client = factom::testnet_node();\nlet hash = \"97c4e7adce9ed277b62adfb9fb7a31ca4778181e49dcdfebca967102dd424fbc\";\nlet response = entry::entry(hash).await.unwrap();\ndbg!(response);\n```\n\n##### Traverse a Chain\n```rust\n let client = Factom::open_node();\n let chain = \"843dbee7a49a9b9510d399759fbce24b1f700268c94508085abce352d70ed1f6\";\n // traverse_chain is a utility that returns Vec\u003cEntry\u003e, the number of blocks to\n // parse can be specified, to traverse the entire chain use a depth of 0, here\n // only 1 block,the chainhead itself, will be retrieved.\n let response = utils::traverse_chain(\u0026client, chain, 1).await;\n dbg!(response);\n ```\n\n## Runtime\nThis library re-exports the tokio runtime and executor by default, to disable this\nand use a different runtime modify your `cargo.toml` with a feature flag:\n```toml\n[dependencies]\nfactom = {version=\"^2\", default-features=false}\n```\n\n## Testing\nMost of the functions are covered by the test modules along with all the documentation examples.\nBeware that running `cargo test` with nocapture will produce a huge amount of output.\nFor many of the tests to pass you will need to be running factom-walletd, any\ntest transactions or addresses are cleaned up afterward.\n\nSee the [tests readme](https://github.com/kompendium-llc/factom-rust-client/tree/master/tests) for instructions.\n\n## Benchmarking\nA criterion benching harness is provided, if gnuplot is installed it will also automatically\ngenerate plots for any benchmarks run, they can be found at `\u003cLIBRARY\u003e/target/criterion/report/index.html`. This\ncan be used to test the performance of factomd, factom-walletd, network connections\nand the library functions themselves.\n\n## Fuzzing\nA fuzzing suite is provided using the rust implementation of\n[American Fuzzy Lop](http://lcamtuf.coredump.cx/afl/), with appropriate setup\nthis can be used to fuzz both the Factom rust library along with a simulated\nFactom network and factom-walletd. See the\n[fuzz folder readme](https://github.com/kompendium-llc/factom-rust-client/tree/master/fuzz)\nfor more information.\n\n## Learn\n- [Accessing the Factom blockchain from different programming languages](https://medium.com/kompendium-developments/accessing-factom-blockchain-from-different-programming-languages-7f09030efe16)\n- [Building simple blockchain game with Factom](https://medium.com/kompendium-developments/accessing-factom-blockchain-from-different-programming-languages-7f09030efe16)\n\n## Contributions\n\nThe Library developed by Kompendium, LLC in partnership with [Mitchell Berry](https://github.com/MitchellBerry), [Sergey Bushnyak](https://sigrlami.eu), [Kelecorix, Inc](https://kelecorix.com) and for the good of the Factom community.\n\nIf you're an active user or find it useful we strongly encourage you to support our efforts and ensure long maintenance by contributing a small donation to one of the following cryptocurrency addresses:\n\n- BTC: 39oVXpsgsyW8ZgzsnX3sV7HLdtXWfT96qN\n- ETH: 0x9cDBA6bb44772259B3A3fb89cf233A147a720f34\n- FCT: FA38cwer93mmPw1HxjScLmK1yF9iJTu5P87T2vdkbuLovm2YXyss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkompendium-ano%2Ffactom-rust-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkompendium-ano%2Ffactom-rust-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkompendium-ano%2Ffactom-rust-client/lists"}