forked from hyperledger-archives/indy-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into IS-1203C
- Loading branch information
Showing
31 changed files
with
5,045 additions
and
7,108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
indy::pool::Pool::set_protocol_version(PROTOCOL_VERSION).unwrap(); | ||
indy::pool::set_protocol_version(PROTOCOL_VERSION).wait().unwrap(); | ||
|
||
println!("1. Creating a new local pool ledger configuration that can be used later to connect pool nodes"); | ||
let pool_config_file = create_genesis_txn_file_for_pool(pool_name); | ||
let pool_config = json!({ | ||
"genesis_txn" : &pool_config_file | ||
}); | ||
Pool::create_ledger_config(&pool_name, Some(&pool_config.to_string())).unwrap(); | ||
"genesis_txn" : &pool_config_file | ||
}); | ||
pool::create_pool_ledger_config(&pool_name, Some(&pool_config.to_string())).wait().unwrap(); | ||
|
||
println!("2. Open pool ledger and get the pool handle from libindy"); | ||
let pool_handle: i32 = Pool::open_ledger(&pool_name, None).unwrap(); | ||
let pool_handle: i32 = pool::open_pool_ledger(&pool_name, None).wait().unwrap(); | ||
|
||
println!("3. Creates a new wallet"); | ||
let config = json!({ "id" : wallet_name.to_string() }).to_string(); | ||
Wallet::create(&config, USEFUL_CREDENTIALS).unwrap(); | ||
wallet::create_wallet(&config, USEFUL_CREDENTIALS).wait().unwrap(); | ||
|
||
println!("4. Open wallet and get the wallet handle from libindy"); | ||
let wallet_handle: i32 = Wallet::open(&config, USEFUL_CREDENTIALS).unwrap(); | ||
let wallet_handle: i32 = wallet::open_wallet(&config, USEFUL_CREDENTIALS).wait().unwrap(); | ||
|
||
println!("5. Generating and storing steward DID and Verkey"); | ||
let first_json_seed = json!({ | ||
"seed":"000000000000000000000000Steward1" | ||
"seed":"000000000000000000000000Steward1" | ||
}).to_string(); | ||
let (steward_did, _steward_verkey) = Did::new(wallet_handle, &first_json_seed).unwrap(); | ||
let (steward_did, _steward_verkey) = did::create_and_store_my_did(wallet_handle, &first_json_seed).wait().unwrap(); | ||
|
||
println!("6. Generating and storing Trust Anchor DID and Verkey"); | ||
let (trustee_did, trustee_verkey) = Did::new(wallet_handle, &"{}".to_string()).unwrap(); | ||
let (trustee_did, trustee_verkey) = did::create_and_store_my_did(wallet_handle, &"{}".to_string()).wait().unwrap(); | ||
|
||
println!("7. Build NYM request to add Trust Anchor to the ledger"); | ||
let build_nym_request: String = Ledger::build_nym_request(&steward_did, &trustee_did, Some(&trustee_verkey), None, Some("TRUST_ANCHOR")).unwrap(); | ||
let build_nym_request: String = ledger::build_nym_request(&steward_did, &trustee_did, Some(&trustee_verkey), None, Some("TRUST_ANCHOR")).wait().unwrap(); | ||
|
||
println!("8. Sending the nym request to ledger"); | ||
let _build_nym_sign_submit_result: String = Ledger::sign_and_submit_request(pool_handle, wallet_handle, &steward_did, &build_nym_request).unwrap(); | ||
let _build_nym_sign_submit_result: String = ledger::sign_and_submit_request(pool_handle, wallet_handle, &steward_did, &build_nym_request).wait().unwrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
println!("11. Creating and storing CREDENTIAL DEFINITION using anoncreds as Trust Anchor, for the given Schema"); | ||
println!("11. Creating and storing CREDENTAIL DEFINITION using anoncreds as Trust Anchor, for the given Schema"); | ||
let config_json = r#"{ "support_revocation": false }"#; | ||
let tag = r#"TAG1"#; | ||
|
||
let (_cred_def_id, _cred_def_json) = Issuer::create_and_store_credential_def(wallet_handle, &trustee_did, &schema_json, tag, None, config_json).unwrap(); | ||
let (_cred_def_id, _cred_def_json) = anoncreds::issuer_create_and_store_credential_def(wallet_handle, &trustee_did, &schema_json, tag, None, config_json).wait().unwrap(); | ||
|
||
// CLEAN UP | ||
println!("12. Close and delete wallet"); | ||
indy::wallet::Wallet::close(wallet_handle).unwrap(); | ||
indy::wallet::Wallet::delete(&config, USEFUL_CREDENTIALS).unwrap(); | ||
indy::wallet::close_wallet(wallet_handle).wait().unwrap(); | ||
indy::wallet::delete_wallet(&config, USEFUL_CREDENTIALS).wait().unwrap(); | ||
|
||
println!("13. Close pool and delete pool ledger config"); | ||
Pool::close(pool_handle).unwrap(); | ||
Pool::delete(&pool_name).unwrap(); | ||
pool::close_pool_ledger(pool_handle).wait().unwrap(); | ||
pool::delete_pool_ledger(&pool_name).wait().unwrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.