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

Add another client config init example #15

Open
6r1d opened this issue Sep 20, 2023 · 0 comments
Open

Add another client config init example #15

6r1d opened this issue Sep 20, 2023 · 0 comments
Assignees

Comments

@6r1d
Copy link
Contributor

6r1d commented Sep 20, 2023

Rust Guide had a way to initialise the client with more details, second in section 2.
I should add that as well.

use iroha_core::prelude::*;
use iroha_data_model::prelude::*;

let public_str = r#"ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"#;
let private_hex = "9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0";

let kp = KeyPair::new(
    PublicKey::from_str(public_str)?,
    PrivateKey::from_hex(Algorithm::Ed25519, private_hex.into())?
)?;

let (public_key, private_key) = kp.clone().into();
let account_id: AccountId = "alice@wonderland".parse()?;

let config = ClientConfiguration {
    public_key,
    private_key,
    account_id,
    torii_api_url: SmallStr::from_string(iroha_config::torii::uri::DEFAULT_API_URL.to_owned()),
    ..ClientConfiguration::default()
};
@6r1d 6r1d self-assigned this Sep 20, 2023
@6r1d 6r1d changed the title Add another client example Add another client config init example Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant