holochain -c hcconfig.toml
当使用生产导体(即使用)运行 holochain 应用程序时,
如何从前端查询实例@holochain/hc-web-client (v0.5.0)
?
我尝试过:
import { connect } from "@holochain/hc-web-client";
const opts = {
url: "ws://localhost:8888"
};
const hConn: HoloConn = await connect(opts);
const { call } = hConn;
const info = await call("info", "instances")();
console.log({ info });
这似乎与开发指挥(即hc run
)一起工作,
但是当我切换到生产指挥时,它会在同一个地方返回一个空数组。
为了与生产指挥一起工作,我需要改变什么吗?
这是我的指挥配置:
bridges = []
[[agents]]
id = "alice"
name = "alice"
keystore_file = "/tmp/hc/keys/alice.key"
public_address = "HcSCj9wvVKj7ryhm9ttRansEX5Zyk5ac4QOFK59sowZzrw36s6NuTSeDtn6oiui"
[[agents]]
id = "bob"
name = "bob"
keystore_file = "/tmp/hc/keys/bob.key"
public_address = "HcSCj7r458cQcxSkfwSa3S6myv7Mv5ukwSc4IP6fg8yYwoevVbFnY4dAO4e3dyz"
[[dnas]]
id = "tender"
file = "dist/hc-201906.dna.json"
[[instances]]
id = "instance_alice"
agent = "alice"
dna = "tender"
[instances.storage]
path = "/tmp/hc/instance_alice.storage"
type = "file"
[[instances]]
id = "instance_bob"
agent = "alice"
dna = "tender"
[instances.storage]
path = "/tmp/hc/instance_bob.storage"
type = "file"
[[interfaces]]
id = "websocket interface"
admin = true
[interfaces.driver]
port = 8888
type = "websocket"
[logger]
type = "debug"
[[logger.rules.rules]]
color = "red"
exclude = false
pattern = "^err/"
[[logger.rules.rules]]
color = "white"
exclude = false
pattern = "^debug/dna"
[[logger.rules.rules]]
exclude = false
pattern = ".*"