-
Notifications
You must be signed in to change notification settings - Fork 64
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
Error while registering a new peer #195
Comments
Hello Matias, I guess the issue is with this code: const public_key = PublicKey({
digest_function: Algorithm('Ed25519'),
payload: Uint8Array.from(Buffer.from(payload, 'hex')),
}); The issue is that your To handle this in the most proper way, let the crypto library handle the multihash: import { crypto } from '@iroha2/crypto-target-node'
import { freeScope } from '@iroha2/crypto-core'
const public_key_hex = 'ed0120C69B431324D855E945B64F8DD757BDB5ED10C915C9C33ED6C1B36E06B97046F0'
const public_key = freeScope(() => crypto.PublicKey.fromMultihash(public_key_hex).toDataModel()) |
@0x009922 Thanks, that makes sense. I tested your solution and it did work with a minor fix. I needed to add "hex" to const public_key = freeScope(() => crypto.PublicKey.fromMultihash('hex', public_key_hex).toDataModel()) Thanks!! |
Ah, yes, indeed. Glad it's fixed! |
I'm experiencing the following error when registering a new peer:
Iroha node version:
INFO iroha: Hyperledgerいろは2にようこそ!(translation) Welcome to Hyperledger Iroha! version=2.0.0-pre-rc.20 git_commit_sha="ca37b7f"
Iroha JS packages:
I'm executing the registration using the following API call:
This is the code being executed:
This is the topology stated on the error message above:
The public key for the node being registered is:
ed0123ED0120C69B431324D855E945B64F8DD757BDB5ED10C915C9C33ED6C1B36E06B97046F0
But that is wrong, it you compare it to the public key used in the API call:
ed0120C69B431324D855E945B64F8DD757BDB5ED10C915C9C33ED6C1B36E06B97046F0
For some reason Iroha is adding "ed123" and turning ed into caps, here is what i mean:
Why is Iroha altering the public key? Should it be encoded in a different way when submitting the instruction?
This problem occurs only when submitting via SDK. If I replicate the operation using
iroha_client_cli
as below, it works fine, and the peer is registered.The text was updated successfully, but these errors were encountered: