Skip to content

Commit

Permalink
missed
Browse files Browse the repository at this point in the history
  • Loading branch information
l1h3r committed Feb 19, 2021
1 parent 51935c6 commit 3629989
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use identity::iota::TangleRef;

#[smol_potat::main]
async fn main() -> Result<()> {

// Create a client to interact with the IOTA Tangle.
let client: Client = Client::new()?;

Expand Down
17 changes: 10 additions & 7 deletions identity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,31 @@
//! ```
//! use identity::crypto::KeyPair;
//! use identity::iota::Client;
//! use identity::iota::IotaDocument;
//! use identity::iota::Document;
//! use identity::iota::Network;
//! use identity::iota::Result;
//! use identity::iota::TangleRef;
//!
//! #[smol_potat::main]
//! async fn main() -> Result<()> {
//! // Create a client to interact with the IOTA Tangle.
//! let client: Client = Client::new()?;
//!
//! // Create a DID Document (an identity).
//! let (mut document, keypair): (IotaDocument, KeyPair) = IotaDocument::builder()
//! .authentication_tag("key-1")
//! .did_network(client.network().as_str())
//! .build()?;
//! let keypair: KeyPair = KeyPair::new_ed25519()?;
//! let mut document: Document = Document::from_keypair(&keypair)?;
//!
//! // Sign the DID Document with the default authentication key.
//! document.sign(keypair.secret())?;
//!
//! // Use the client to publish the DID Document to the IOTA Tangle.
//! let transaction: _ = client.publish_document(&document).await?;
//! document.publish(&client).await?;
//!
//! // Print the DID Document transaction link.
//! println!("DID Document Transaction > {}", client.transaction_url(&transaction));
//! let network: Network = document.id().into();
//! let explore: String = format!("{}/transaction/{}", network.explorer_url(), document.message_id());
//!
//! println!("DID Document Transaction > {}", explore);
//!
//! Ok(())
//! }
Expand Down

0 comments on commit 3629989

Please sign in to comment.