Google cloud platform 如何为IPFS客户端添加外部IP地址

Google cloud platform 如何为IPFS客户端添加外部IP地址,google-cloud-platform,ethereum,ipfs,Google Cloud Platform,Ethereum,Ipfs,我在Google计算引擎中创建了一个IPFS实例 当我用 ipfs daemon 框的本地IP地址(列出了专用地址)10.128.0.4,但是当我想从Google外部连接到外部IP(134.123.143.185)时,我不能 如何将外部IP添加到要连接的可接受IP地址列表中 try { const client = createClient(new URL('http://134.123.143.185:5001')) // call Core API methods

我在Google计算引擎中创建了一个IPFS实例

当我用

ipfs daemon
框的本地IP地址(列出了专用地址)10.128.0.4,但是当我想从Google外部连接到外部IP(134.123.143.185)时,我不能

如何将外部IP添加到要连接的可接受IP地址列表中

try {
    const client = createClient(new URL('http://134.123.143.185:5001'))

    // call Core API methods
    const { cid } = await client.add('Hello world!')
    console.log(cid);
} catch (error) {
    console.log(error);
}

IPFS服务器可能只设置为在127.0.0.1/5001上侦听

如果你跑

sudo ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
这可能是非常不安全的,而且不是正确的做法,希望有人能纠正这个答案。

从官方那里,我们发现了类似的配置。