Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iota-client dependency #371

Merged
merged 4 commits into from Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions bindings/wasm/Cargo.toml
Expand Up @@ -9,6 +9,7 @@ repository = "https://github.com/iotaledger/identity.rs"
license = "Apache-2.0"
keywords = ["iota", "tangle", "identity", "wasm"]
homepage = "https://www.iota.org"
resolver = "2"

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Expand Up @@ -8,7 +8,7 @@ publish = false
identity = { path = "../identity", features = ["account"] }
pretty_env_logger = { version = "0.4" }
rand = { version = "0.8" }
tokio = { version = "1.5", features = ["full"] }
tokio = { version = "1.10", features = ["full"] }

[[example]]
name = "getting_started"
Expand Down
15 changes: 13 additions & 2 deletions examples/account/private_tangle.rs
Expand Up @@ -26,21 +26,32 @@ async fn main() -> Result<()> {
let network = Network::from_name(network_name)?;

// Create a new Account with the default configuration
let private_node_url = "http://127.0.0.1:14265/";
let account: Account = Account::builder()
// Configure a client for the private network.
// Also set the URL that points to the REST API
// of the locally running hornet node.
.client(network, |builder| {
// unwrap is safe, we provided a valid node URL
builder.node("http://127.0.0.1:14265/").unwrap()
builder.node(private_node_url).unwrap()
})
.build()
.await?;

let id_create = IdentityCreate::new().network(network_name);

// Create a new Identity with default settings
let snapshot: IdentitySnapshot = account.create_identity(id_create).await?;
let snapshot: IdentitySnapshot = match account.create_identity(id_create).await {
Ok(snapshot) => snapshot,
Err(err) => {
eprintln!("[Example] Error: {:?} {}", err, err.to_string());
eprintln!(
"[Example] Is your private Tangle node listening on {}?",
private_node_url
);
return Ok(());
}
};

// Retrieve the DID from the newly created Identity state.
let document: &IotaDID = snapshot.identity().try_did()?;
Expand Down
12 changes: 10 additions & 2 deletions examples/low-level-api/private_tangle.rs
Expand Up @@ -23,9 +23,10 @@ pub async fn main() -> Result<()> {

// Set the network and the URL that points to
// the REST API of the locally running hornet node.
let private_node_url = "http://127.0.0.1:14265/";
let client = ClientBuilder::new()
.network(network)
.node("http://127.0.0.1:14265/")?
.node(private_node_url)?
.build()
.await?;

Expand All @@ -45,7 +46,14 @@ pub async fn main() -> Result<()> {
println!("DID Document JSON > {:#}", document);

// Publish the DID Document to the Tangle.
let receipt: Receipt = client.publish_document(&document).await?;
let receipt: Receipt = match client.publish_document(&document).await {
Ok(receipt) => receipt,
Err(err) => {
eprintln!("Error > {:?} {}", err, err.to_string());
eprintln!("Is your private Tangle node listening on {}?", private_node_url);
return Ok(());
}
};

println!("Publish Receipt > {:#?}", receipt);

Expand Down
4 changes: 2 additions & 2 deletions identity-account/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ homepage = "https://www.iota.org"
[dependencies]
async-trait = { version = "0.1", default-features = false }
futures = { version = "0.3" }
hashbrown = { version = "0.9", features = ["serde"] }
hashbrown = { version = "0.11", features = ["serde"] }
identity-core = { version = "=0.3.0", path = "../identity-core" }
identity-credential = { version = "=0.3.0", path = "../identity-credential" }
identity-did = { version = "=0.3.0", path = "../identity-did" }
Expand All @@ -31,7 +31,7 @@ slog = { version = "2.7" }
strum = { version = "0.21", features = ["derive"] }
thiserror = { version = "1.0" }
tokio = { version = "1.5", features = ["sync"] }
zeroize = { version = "1.3" }
zeroize = { version = "1.4" }

[dependencies.iota-crypto]
version = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion identity-core/Cargo.toml
Expand Up @@ -26,7 +26,7 @@ strum = { version = "0.21", features = ["derive"] }
thiserror = { version = "1.0", default-features = false }
typenum = { version = "1.13", default-features = false }
url = { version = "2.2", default-features = false, features = ["serde"] }
zeroize = { version = "1.3", default-features = false }
zeroize = { version = "1.4", default-features = false }

[dependencies.iota-crypto]
version = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion identity-iota/Cargo.toml
Expand Up @@ -26,7 +26,7 @@ thiserror = { version = "1.0", default-features = false }

[dependencies.iota-client]
git = "https://github.com/iotaledger/iota.rs"
rev = "0a011ec37f70874358cf530d3b8e4817c69c9a4c"
rev = "e8c050a749a2e7c13633e97b3372b38388f48c37"
default-features = false

[dependencies.iota-crypto]
Expand Down