A tool for building and sending executor_chaincode
's transactions.
git submodule init
git submodule update
-
protoc
brew install protobuf
apt install protobuf-compiler
-
rustfmt
rustup component add rustfmt
cargo run --example asset-transfer-basic
cargo run --example asset-transfer-secured-agreement
use chaincode_invoker::Invoker;
// chaincode name
let cc_name = "asset-transfer-secured-agreement";
let kms_addr = "localhost:50005";
let controller_addr = "localhost:50004";
let channel_id = "cita-cloud";
let org1_mspid = "Org1MSP";
let org1_cert = /* cert file ommitted */;
let org1 = Invoker::new(
cc_name,
kms_addr,
controller_addr,
channel_id,
org1_mspid,
org1_cert.as_bytes().to_vec(),
).await;
org1.call(
// method name
"CreateAsset",
// args
&["asset1", "A new asset for Org1MSP"],
// transient_map(a key-value map representing the private data)
&[("asset_properties", "asset1's property")],
).await;