Fluid framework 如何连接到路由器式本地服务器?

Fluid framework 如何连接到路由器式本地服务器?,fluid-framework,Fluid Framework,我遵循了这个指南,并且成功地设置了RouterLogic服务器和网关,但是在将客户端连接到它时遇到了问题。 以下是客户端代码配置: ... const hostUrl = "http://localhost:3000"; const ordererUrl = "http://localhost:3000"; const storageUrl = "http://localhost:3000"; const

我遵循了这个指南,并且成功地设置了RouterLogic服务器和网关,但是在将客户端连接到它时遇到了问题。 以下是客户端代码配置:

...
    const hostUrl = "http://localhost:3000";
    const ordererUrl = "http://localhost:3000";
    const storageUrl = "http://localhost:3000";
    const tenantId = "unused";
    const tenantKey = "unused";
    
    const serviceRouter = new RouterliciousService({
        orderer: ordererUrl,
        storage: storageUrl,
        tenantId: tenantId,
        key: tenantKey,
      });
    const container = await getContainer(
       serviceRouter,
       documented,
       ContainerFactory,
       createNew
     );
...
给我的错误是:


我想这是因为tenantId和tenantKey。我该如何解决这个问题呢?

听起来您已经启动了RouterLogicous,如果是这样,请跳到最后一个标题。重述

通俗的
  • 克隆
  • 从Fluid Framework repo根目录运行npm运行开始:docker
  • RouterLogicous是我们的名称,供参考

    为了让RouterLogic启动,
    npm run start:docker
    使用预构建的。这些是在存储库中的中为您预先打包的

    网关 网关是Fluid Framework主机的参考实现。Gateway让您在网站上运行流体容器。更具体地说,它是一个运行web服务的docker容器。该web服务提供带有流体加载器的网页

    虽然这是在一个站点上运行任何流体容器的一个好选择,但使用您的策略可能更容易。那就是。。。创建您自己的网站,直接连接到服务并加载流体容器

    连接到RouterLogicous
    要连接到本地RouterLogicous实例,您需要知道订购者url、存储url、租户id和租户密钥。默认情况下,我们提供一个本地测试。测试租户id为“本地”,测试密钥为“43cfc3fbf04a97c0921fd23ff10f9e4b”。

    非常感谢您提供详细答案。我遵循您的逐步设置,并以以下方式配置RouterLogicous服务:

    const serviceRouter = new RouterliciousService({
      orderer: "http://localhost:3003",
      storage: "http://gitrest:3000",
      tenantId: "local",
      key: "43cfc3fbf04a97c0921fd23ff10f9e4b",
    });
    
    我已使用指示的订购和存储URL

    但我仍然得到同样的错误:

    我使用的是RouterliciousService和getContainer,它们来自包
    “@fluid-experimental/get-container”