0

我正在尝试在全新安装的 Ubuntu v18 上构建和测试以下程序:

https://github.com/hyperledger/sawtooth-marketplace

安装后,当我尝试导航到“Marketplace-Rest-API”(localhost:8040)和“Sawtooth-Blockchain-Rest-API”(localhost:8043)时,出现 404“resource not found”错误

我不确定为什么这些不起作用。localhost:8041 和 localhost:8042 的接口运行良好。似乎其余 API 的导航方式与这两个类似,所以我不确定为什么它们会起作用而其他 API 不会。

编辑:看来我可以到达端口,因为终端中有响应:

 `[2018-11-20 15:16:14 +0000] [10] [INFO] Goin' Fast @ http://market-rest-api:8000
--- Logging error ---
`Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/__init__.py", line 982, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 59-63: ordinal not in range(128)
Call stack:
  File "/project/sawtooth-marketplace/bin/marketplace-rest-api", line 30, in <module>
    main()
  File "/project/sawtooth-marketplace/rest_api/api/main.py", line 189, in main
    loop.run_forever()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 345, in run_forever
    self._run_once()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 1312, in _run_once
    handle._run()
  File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
    self._callback(*self._args)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/sanic/app.py", line 775, in create_server
    backlog=backlog, run_async=True)
  File "/usr/local/lib/python3.5/dist-packages/sanic/app.py", line 891, in _helper
    logger.debug(self.config.LOGO)
Message: '\n                 \u2584\u2584\u2584\u2584\u2584\n        \u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584       _______________\n      \u2584\u2584\u2584\u2584\u2584  \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584  /                 \\\n     \u2580\u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u258c \u2580\u2590\u2584 \u2580\u2590\u2588 |   Gotta go fast!  |\n   \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2584\u2584 \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2588\u2588 | _________________/\n   \u2580\u2584\u2584\u2584\u2584\u2584  \u2580\u2580\u2588\u2584\u2580\u2588\u2550\u2550\u2550\u2550\u2588\u2580 |/\n        \u2580\u2580\u2580\u2584  \u2580\u2580\u2588\u2588\u2588 \u2580       \u2584\u2584\n     \u2584\u2588\u2588\u2588\u2580\u2580\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584 \u2584\u2580\u2580\u2580\u2580\u2580\u2580\u2588\u258c\n   \u2588\u2588\u2580\u2584\u2584\u2584\u2588\u2588\u2580\u2584\u2588\u2588\u2588\u2580 \u2580\u2580\u2588\u2588\u2588\u2588      \u2584\u2588\u2588\n\u2584\u2580\u2580\u2580\u2584\u2588\u2588\u2584\u2580\u2580\u258c\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2592\u2588\u2588\u2588     \u258c\u2584\u2584\u2580\n\u258c    \u2590\u2580\u2588\u2588\u2588\u2588\u2590\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2590\u2588\u2588\u258c\n\u2580\u2584\u2584\u2584\u2584\u2580   \u2580\u2580\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2584\u2588\u2588\u2580\n          \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580\n        \u2584\u2584\u2588\u2588\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2580\u2588\n      \u2584\u2588\u2588\u2580     \u2580\u2580\u2580  \u2588\n     \u2584\u2588             \u2590\u258c\n \u2584\u2584\u2584\u2584\u2588\u258c              \u2580\u2588\u2584\u2584\u2584\u2584\u2580\u2580\u2584\n\u258c     \u2590                \u2580\u2580\u2584\u2584\u2584\u2580\n \u2580\u2580\u2584\u2584\u2580\n'
 `

任何帮助将非常感激!

4

1 回答 1

0

所以 REST API 似乎对你根本不起作用。

端口 8042(thinkdb 管理员)和 8041(Sawbuck Web 应用程序)与 REST API 无关。

我的猜测是sawtooth-rest-apimarket-rest-api组件尚未启动(如果您使用的是 Docker),或者如果您直接在 Ubuntu 中运行,您还没有启动marketplace-rest-api和命令(守护程序)。sawtooth-rest-api这些进程是否正在运行?是否可以从网络访问端口(例如,使用 访问 Marketplace REST APItelnet localhost 8040和使用 Sawtooth REST API访问telnet localhost 8043

于 2018-11-19T23:23:12.217 回答