如何通过REST API在sawtooth-seth中创建地址

问题描述 投票:0回答:1

我正在学习sawtooth-seth。我可以使用创建密钥对和帐户seth-cli-go。为了与应用程序连接,我需要将其与REST API连接。因此,我使用了以下REST API。

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

但是我收到以下错误消息,

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

seth-rpc服务器错误[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

如何解决?我的密钥对将存储在哪里?

rest hyperledger hyperledger-sawtooth
1个回答
0
投票

如何解决此问题?

产生该错误消息的代码可以在here中找到。根据代码,出现此错误是因为它与系统的密钥不匹配。我认为您也可以尝试curl with your keypair

以及我的密钥对将存储在哪里?

我阅读了代码,以找到密钥的存储位置。您可以在get_key_dir()中检查功能accounts.rs的实现,该实现指出Some([home.to_str()?, ".sawtooth", "keys"].iter().collect())

因此,您的密钥对应该在您的home directory中。

© www.soinside.com 2019 - 2024. All rights reserved.