访问Corda网络地图标识(Corda 2.0)

访问Corda网络地图标识(Corda 2.0),corda,Corda,我想访问网络映射节点的标识(不知道其名称)。我怎么能做到? 是否可以访问cordapps中的node.conf数据(以便我可以找到网络地图标识) 我的最终目标是从对等节点列表中删除网络映射节点。您可以从流中读取节点的node.conf文件,如下所示: @Suspendable @Override public Void call() { try (FileInputStream inputStream = new FileInputStream("./node.conf")) {

我想访问网络映射节点的标识(不知道其名称)。我怎么能做到? 是否可以访问cordapps中的node.conf数据(以便我可以找到网络地图标识)


我的最终目标是从对等节点列表中删除网络映射节点。

您可以从流中读取节点的
node.conf
文件,如下所示:

@Suspendable
@Override
public Void call() {
    try (FileInputStream inputStream = new FileInputStream("./node.conf")) {
        String confContents = IOUtils.toString(inputStream);
        getLogger().info(confContents);

    } catch (IOException e) {
        e.printStackTrace();
    }

    return null;
}
运行流时的工作目录是节点的基本目录,其中存储了
node.conf
文件。运行流测试时,此流将不工作,因为基本目录不同

Corda的未来版本将引入每个CorDapp配置文件,这些文件可以在流期间轻松访问