You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CORDA公证节点创建方法及多节点配置方案咨询

Hey there! Let's break down your questions about setting up Corda notary nodes clearly:

Corda Notary Node Setup & Multi-Notary Configuration

Is the config you provided the only necessary step?

The snippet you shared is a core part of defining a notary node, but it’s not the only required step to get a working notary. Let’s break down what each line does, plus what’s missing:

First, your existing config:

  • name "O=NetworkMapAndNotary,L=London,C=GB": Sets the node’s X.500 identity, which is mandatory for all Corda nodes (notaries included) to establish trust.
  • notary = [validating : true]: This is the critical line that marks the node as a validating notary (set to false for a non-validating one). Without this, the node won’t function as a notary.
  • p2pPort 10002: Assigns a unique P2P port for node-to-node communication (prevents port conflicts).
  • cordapps = []: Notaries typically don’t need business-specific CordApps, so an empty list is fine here.

Missing necessary steps:

  1. Corda Gradle Plugins: Your project must include the Corda node plugin in the root build.gradle to enable the deployNodes task. Example snippet:
buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://software.r3.com/artifactory/corda-releases' }
    }
    dependencies {
        classpath "net.corda.plugins:node:${corda_version}" // Replace with your Corda version
    }
}
  1. Generate & Start the Node: After configuring deployNodes, run ./gradlew deployNodes (or gradlew.bat deployNodes on Windows) to generate the node’s directory structure. Then navigate to the generated node folder and run run.sh/run.bat to start the node.

How to configure multiple notary nodes

Corda supports multiple notaries for fault tolerance or partitioned workflows. Here’s how to set them up and connect them:

1. Add multiple node blocks in deployNodes

Each notary needs its own configuration block with unique ports and identity. Example:

deployNodes {
    // First validating notary
    node {
        name "O=Notary1,L=London,C=GB"
        notary = [validating: true]
        p2pPort 10002
        rpcSettings {
            address("localhost:10003")
            adminAddress("localhost:10043")
        }
        cordapps = []
    }

    // Second non-validating notary
    node {
        name "O=Notary2,L=New York,C=US"
        notary = [validating: false]
        p2pPort 10005
        rpcSettings {
            address("localhost:10006")
            adminAddress("localhost:10046")
        }
        cordapps = []
    }

    // Add your business nodes here...
}

⚠️ Important: Ensure all p2pPort, rpcSettings.address, and adminAddress values are unique across nodes to avoid port conflicts.

2. Connect notaries to the Network Map

Corda uses a Network Map service to track all nodes in the network. When you run deployNodes, it automatically creates a Network Map node (if not explicitly defined) and registers all nodes (including notaries) to it.

For manual distributed deployments, each notary’s node.conf needs to reference the Network Map service:

networkMapService {
    address = "localhost:10002" // Replace with your Network Map's P2P address
    legalName = "O=NetworkMapService,L=London,C=GB"
}

This ensures other nodes in the network can discover and use the notaries.

3. Select a notary in your flows

When building transactions, your business flows can specify which notary to use. You can either look up available notaries or target a specific one by its X.500 name:

// Fetch a specific notary by name
val targetNotary = serviceHub.networkMapCache.getNotary(CordaX500Name.parse("O=Notary1,L=London,C=GB"))

// Build transaction with the selected notary
val txBuilder = TransactionBuilder(targetNotary)

Quick Tips

  • Validating notaries check transaction validity (contract rules, signatures), while non-validating ones only timestamp transactions—choose based on your security needs.
  • In production, deploy each notary on a separate server for high availability.
  • Multiple notaries don’t need explicit syncing; the Network Map service maintains their state for the network.

内容的提问来源于stack exchange,提问作者Mahesh Govind

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 07:40:37