2

我正在尝试在 seth-rpc 容器中解锁我创建的别名(使用 seth-cli-go 创建)。我在 seth-rpc 中使用以下命令:

docker exec -it seth-rpc bash
seth-rpc --connect tcp://validator:4004 --bind 0.0.0.0:3030 --unlock myalias

在运行上述命令时,我收到以下错误:'在密钥目录中找不到别名'

在 seth-cli-go 中创建帐户:

docker exec -it seth-cli-go bash
openssl ecparam -genkey -name secp256k1 | openssl ec -out key-file.pem -aes128
seth account import key-file.pem myalias
seth account create --nonce=0 --wait myalias
Account created
Transaction Receipt:  {
  "TransactionID": "bfc03a624baf4ac0f7c983057ae8ce7306190f47029f891e92f8b268b6009b9a3982d0c56dc9ebc45f40d9dc058bb36c76e816398f1046ac95ce48b9bc546aab",
  "Address": "29b71fd0c3100d9595cd9daefa9850e16feb2831"
}

有人可以指出我做错了什么吗?

4

2 回答 2

1

我找到了解决该问题的方法。在 docker-compose.yaml 文件中,在 seth-cli-go 的“volumes”部分下添加“-sawtooth:/root/.sawtooth”。这确保在seth-cli-go docker 容器下创建的别名对seth-rpc 容器也是可见的。我们可以用这个从seth-rpc 中解锁别名。但是,如果我尝试使用“eth_sendTransaction”发送交易,解锁后会显示内部错误:“找不到地址的帐户”。

$ seth-rpc --unlock myalias --connect tcp://validator:4004 --bind 0.0.0.0:3030
02c0b4c855d0e54a7f6dc5635e2aab0714387ba88b678fe2cc264ce0917fab83b6 unlocked: 373ec8d9b7d1814aa4d081ab4241bf618d73f384

$ curl -d '{"jsonrpc": "2.0", "method": "eth_sendTransaction", "id": 2, "params": [{"from": "0x373ec8d9b7d1814aa4d081ab4241bf618d73f384", "data": "0x608060405234801561001057600080fd5b50610271806100206000396000f3fe608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631ab06ee514610067578063812600df146100ac5780639507d39a146100e7578063c20efb9014610136575b600080fd5b34801561007357600080fd5b506100aa6004803603604081101561008a57600080fd5b810190808035906020019092919080359060200190929190505050610171565b005b3480156100b857600080fd5b506100e5600480360360208110156100cf57600080fd5b81019080803590602001909291905050506101cb565b005b3480156100f357600080fd5b506101206004803603602081101561010a57600080fd5b81019080803590602001909291905050506101fa565b6040518082815260200191505060405180910390f35b34801561014257600080fd5b5061016f6004803603602081101561015957600080fd5b8101908080359060200190929190505050610216565b005b80600080848152602001908152602001600020819055507f545b620a3000f6303b158b321f06b4e95e28a27d70aecac8c6bdac4f48a9f6b38282604051808381526020018281526020019250505060405180910390a15050565b600160008083815260200190815260200160002054016000808381526020019081526020016000208190555050565b6000806000838152602001908152602001600020549050919050565b60016000808381526020019081526020016000205403600080838152602001908152602001600020819055505056fea165627a7a723058203b4d5a111ec2d08b1e7c24d98b5021878a6bb192cc2c5a309663b6bf9db18a2d0029"}]}' -H "Content-Type: application/json" localhost:3030
{"jsonrpc":"2.0","error":{"code":-32603,"message":"Internal error"},"id":2}

另一件事是没有错误消息记录在我将验证器(端口 4004)与 seth-rpc(端口 3030)绑定的终端中。但是,在锯齿验证器终端中记录了错误。关于为什么会发生这种情况的任何想法?

于 2018-11-29T05:08:16.127 回答
0

这已通过 PR#49 https://github.com/hyperledger/sawtooth-seth/pull/49/files Integrated 2018-07-10在 Sawtooth Seth 源代码中 修复。所以最新版本的赛斯应该没有这个问题。

于 2019-03-26T22:35:39.283 回答