Activeledger Transaction Helper
Activeledger is a powerful distributed ledger technology. Think about it as a single ledger, which is updated simultaneously in multiple locations. As the data is written to a ledger, it is approved and confirmed by all other locations.
This Crate
This crate provides Rust developers an easy way to build up transactions without needing other crates, such as Serde.
This crate provides macros as well as builders that help create a transaction with the correct structure. Additionally it provides two methods of creating a complete onboarding transaction. With and without a provided key.
Additional Activeledger crates
Adhearing to the Rust mentality of keeping things small we have created other crates that can be used in conjunction with this one to add additional functionality.
These crates are:
- activeledger - The main SDK. (Crate)
- active_sse - To build transactions without worrying about the JSON. (Crate)
Links
Activeledger Developers portal
Example usage
# use active_tx::{PacketBuilder, TransactionBuilder, Key, packet_data, signees};
# use activeledger::key::EllipticCurve;
# fn main() {
let input = packet_data!({"[streamid]": {"input": "data"}});
let input_data = PacketBuilder::new(input).build().unwrap();
let mut tx_builder = TransactionBuilder::new("namespace", "contract");
let streamid = "streamid";
let key = Key::Ec(EllipticCurve::new(streamid).unwrap());
let signees = signees![{streamid => key}];
let tx = tx_builder
.input(input_data)
.unwrap()
.build(signees)
.unwrap();
# }
For more information on the usage of this crate see the [TransactionBuilder
] documentation.