0

I am learning sawtooth-seth. I can create key-pair and account using seth-cli-go. In order to connect with application I need to connect it with REST API. So I used the following REST API.

curl --data '{"method":"personal_newAccount","params":["test@123"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:3030

But I got the following error msg,

{"jsonrpc":"2.0","error":{"code":-32069,"message":"Error generating key"},"id":1}

seth-rpc server error [00:14:21.966] (7fc28042d700) ERROR Error generating key: No such file or directory (os error 2) [00:14:21.966] (7fc28042d700) ERROR Error generating key

How to fix this? And where my key-pair will be stored?

Gurunath
  • 341
  • 3
  • 17

1 Answers1

0

How to fix this?

The code which producing that error message can be found here. According to the code, this error came because it has mismatch key with the system. I think you could try curl with your keypair as well.

And where my key-pair will be stored?

I read the code to find where it stores the key. You can check the implementation of function get_key_dir() in accounts.rs, which states Some([home.to_str()?, ".sawtooth", "keys"].iter().collect())

So, your key-pair should be in your home directory.