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

Document how to actually configure the backend and connect it to Iroha #33

Open
6r1d opened this issue Oct 29, 2022 · 2 comments
Open
Labels
documentation Improvements or additions to documentation upstream-iroha Needs improvements from Iroha itself

Comments

@6r1d
Copy link

6r1d commented Oct 29, 2022

While attempting to run the backend, user will see this documentation that provides a default configuration. Said config causes an error and there are no additional notes on how to fix it. The user will enter the command that launches the backend and see an error:

./target/release/iroha2_explorer_web -c ./config.json -p 8080
Error: failed to parse client config file: ./config.json

Caused by:
    Algorithm not supported at line 6 column 4

Location:
    src/main.rs:72:18

Returning to the config, said line and column point to the PRIVATE_KEY configuration.

Currently, PUBLIC_KEY configuration and PRIVATE_KEY configuration need to contain some hints for the user to fix them.

If I remember correctly, the PUBLIC_KEY and PRIVATE_KEY could be generated by a Kagami tool. Let's say we build it or run with Cargo:

cargo build --bin kagami
./target/debug/kagami crypto -a ed25519 -s 42
cargo run --bin kagami -- crypto -a ed25519 -s 42

So, we get both private and public key in some form:

Public key (multihash): ed0120ee7a84e8ed0ecc5ae65968ff5465d2bc16f5c6211bc4de0a3f1591e82845f824
Private key: 790e18703ba023439ee28be38def744ae613cd5e90c643434571b6de80666123ee7a84e8ed0ecc5ae65968ff5465d2bc16f5c6211bc4de0a3f1591e82845f824
Digest function: ed25519

Now, is this how the user will record it in a configuration?

{
  "PUBLIC_KEY": "ed0120ee7a84e8ed0ecc5ae65968ff5465d2bc16f5c6211bc4de0a3f1591e82845f824",
  "PRIVATE_KEY": {
    "digest_function": "ed25519",
    "payload": "790e18703ba023439ee28be38def744ae613cd5e90c643434571b6de80666123ee7a84e8ed0ecc5ae65968ff5465d2bc16f5c6211bc4de0a3f1591e82845f824"
  }
}

Moreover, what does "multihash" public key mean?

I believe this has to be documented for the UX of the backend.

@0x009922
Copy link
Contributor

Well, first of all, the documentation reference is wrong. It references the Iroha configuration itself, while Explorer needs the Iroha Client configuration to work. Thank you for noticing.

I don't think it is worth it to document it in this repo, but we could provide several links for more detailed instruction:

As for non-friendliness of the error thrown in case of configuration parsing failure, I think it is the upstream issue, the issue of iroha_client crate itself which is directly used by Explorer. So, could you forward this part of the issue to the Iroha repo?

@0x009922 0x009922 added documentation Improvements or additions to documentation upstream-iroha Needs improvements from Iroha itself labels Oct 31, 2022
@6r1d
Copy link
Author

6r1d commented Oct 31, 2022

So, could you forward this part of the issue to the Iroha repo?

Thanks, yes, I will do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation upstream-iroha Needs improvements from Iroha itself
Projects
None yet
Development

No branches or pull requests

2 participants