【问题标题】:Why cannot connect to ledger Daml-on-Sawtooth via dazl python?为什么无法通过 dazl python 连接到账本 Daml-on-Sawtooth?
【发布时间】:2020-03-29 19:14:22
【问题描述】:

我正在尝试在 Sawtooth 上使用 dazl 客户端部署此 https://github.com/digital-asset/dazl-client/tree/master/samples/ping-pong DAML 智能合约。基于 daml-on 锯齿示例https://github.com/blockchaintp/daml-on-sawtooth。我使用了这个命令:

  1. cd /home/.../daml-on-sawtooth-master

导出 ISOLATION_ID=my-local-build

bin/build.sh

  1. cd /home/.../daml-on-sawtooth-master

daml 账本分配方 Alice Bob --host localhost --port 9000

  1. daml ledger upload-dar --host localhost --port 9000 /home/.../.daml/dist/pingpong-1.0.0.dar

  2. daml ledger navigator --host localhost --port 9000

到目前为止一切正常。我可以访问 navigator 和 daml-on-sawtooth-tracer

但是,当我尝试从 dazl 发送交易时

  1. /home/.../samples/ping-pong/pingpong pipenv 运行 python3 ma​​in.py --url http://localhost:9000

我收到此错误: [错误] 2020-03-29 20:13:13,409 |晕 |尝试发送命令失败! 回溯(最近一次通话最后): 文件“/home/usr/.local/share/virtualenvs/bot-m0tvQ3xh/lib/python3.7/site-packages/dazl/client/_party_client_impl.py”,第 415 行,在 main_writer 等待 submit_command_async(客户端,p,命令) 运行中的文件“/home/usr anaconda3/lib/python3.7/concurrent/futures/thread.py”,第 57 行 结果 = self.fn(*self.args, **self.kwargs) 文件“/home/usr/.local/share/virtualenvs/bot-m0tvQ3xh/lib/python3.7/site-packages/dazl/protocols/v1/grpc.py”,第 42 行,在 lambda:self.connection.command_service.SubmitAndWait(request)) 调用中的文件“/home/usr/.local/share/virtualenvs/bot-m0tvQ3xh/lib/python3.7/site-packages/grpc/_channel.py”,第 826 行 返回_end_unary_response_blocking(状态,调用,假,无) _end_unary_response_blocking 中的文件“/home/usr/.local/share/virtualenvs/bot-m0tvQ3xh/lib/python3.7/site-packages/grpc/_channel.py”,第 729 行 提高_InactiveRpcError(状态) grpc._channel._InactiveRpcError: <_inactiverpcerror of rpc status="StatusCode.INVALID_ARGUMENT" details="“无效参数:命令" ttl debug_error_string="{" created ipv6>

【问题讨论】:

    标签: python hyperledger hyperledger-sawtooth daml


    【解决方案1】:

    错误消息的重要部分是最后一位。

    "Invalid argument: Command TTL (the difference between ledger effective time and maximum record time) PT30S is out of bounds. Min: PT41S. Max: PT1M20S. Client may attempt resubmission with a value that falls within that interval.","grpc_status":3}"
    

    这是说你/DAZL 将 maximum_record_time 设置为 ledger_effective_time + 30s,但 Sawtooth 上的 DAML 需要介于 ledger_effective_time + 41sledger_effective_time + 120s 之间的值。

    查看 DAZL 来源,看起来 30 年代在这里是硬编码的:https://github.com/digital-asset/dazl-client/blob/f7ba752b1ae7d007d457f43ef2f723fdc6e94fb9/python/dazl/client/_party_client_impl.py#L408

    要让它与 Sawtooth 一起使用,您可能需要更改该数字。我创建了一个问题以使其在此处可配置:https://github.com/digital-asset/dazl-client/issues/73

    【讨论】:

    • 我将 ledger_effective_time 更改为 41-120 秒之间的许多值,但没有区别。我得到同样的错误
    • 这不是关于改变ledger_effective_time,而是相对于ledger_effective_time 改变maximum_record_time。这里有一个 PR 将默认值设置为 60s 并使其可配置。因此,DAZL 6.7.1 应该可以与 Sawtooth 一起使用。 github.com/digital-asset/dazl-client/pull/74
    • 我安装了 DAZL 6.7.1。但是,错误仍然是完全一样的......
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-07-24
    • 2013-05-16
    • 2020-07-03
    • 2015-02-05
    • 1970-01-01
    • 2021-01-05
    • 1970-01-01
    相关资源
    最近更新 更多