我找到了解决该问题的方法。在 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)绑定的终端中。但是,在锯齿验证器终端中记录了错误。关于为什么会发生这种情况的任何想法?