forked from iotaledger/identity.rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docs - pair documenation with @Aconitin
- Loading branch information
Showing
4 changed files
with
87 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use identity::iota::Client; | ||
use identity::iota::IotaDocument; | ||
use identity::crypto::KeyPair; | ||
|
||
use identity::iota::Result; | ||
|
||
|
||
#[smol_potat::main] | ||
async fn main() -> Result<()> { | ||
let client: Client = Client::new()?; | ||
|
||
let (mut document, keypair): (IotaDocument, KeyPair) = IotaDocument::builder() | ||
.authentication_tag("key-1") | ||
.did_network(client.network().as_str()) | ||
.build()?; | ||
|
||
// Sign the DID Document with the default authentication key. | ||
document.sign(keypair.secret())?; | ||
|
||
// Use the client to publish the DID Document to the Tangle. | ||
let transaction: _ = client.publish_document(&document).await?; | ||
println!("DID Document Transaction > {}", client.transaction_url(&transaction)); | ||
|
||
Ok(()) | ||
} |
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