This week, we wanted to share some of our top tips for one of your most-asked-about topics: Corda node configuration options.
I’ll summarize the key concepts of Corda node configuration and show you how they’re used by the node explorer. While there are a plethora of ways to integrate with Corda, we’re going to focus on the basics.
If you’ve worked on CorDapps before, you’ve probably seen a node configuration like this:
When standing up web services, you’ll need to set up a small number of ports and make sure they behave as expected. Let’s learn a bit more about each one.
What is the p2pport?
This port is specifically for point-to-point communication between the Corda nodes. You don’t have to worry a lot about this port from the application level, but the host machine or container needs to accept traffic on it.
You can find the docs page on this param here.
What are rpcSettings?
Corda nodes host an RPC server internally for clients to connect with. This object defines settings for that server. You’ll also find settings for limiting RPC users here.
There’s plenty of options, and so the parameters are described in our docs here.
What is the address?
Because we’re using an RPC server for this node,the address is simply the address and port that the RPC server will run on.
Why would the RPC address be separate from the address for other clients to connect to the node?
RPC is a client-server protocol intended to allow computers to perform collaborative computation. It’s not the same thing as HTTP or the Corda node shell (That’s the node sshd option!).
These types of articles tend to have a diagram about this point, and this one is no exception. If this still seems confusing, take a look at this Corda node diagram:
Notice that most input to the node happens through RPC or API calls. The p2p address is only used as the port when the node communicates with other nodes.
Is it possible to use an HTTP binding to connect to a Corda node?
Yes. A Corda node can host other things like web servers, but be aware that those web servers are just triggering Corda flows over RPC and treating the web server as a client. If you’re interested in hosting a Tomcat web server from the same machine as a Corda node, take a look at the Snakes and Ladders CorDapp or the Secret Santa CorDapp. You’ll see that they have a ‘clients’ module that defines the HTTP binding.
So what is the adminAddress?
This is the address for local RPC administrative functions that the Corda node process will use to connect to its own local RPC server.
You will rarely need to worry about the admin address.
So how are these ports used?
Taking this whole picture into account, it should make a lot more sense what needs to happen to use something like the Corda Node Explorer.
If you want to connect to your Corda node as an RPC user and use Corda as a client, you have to define the user and specify the host and port you want to connect to on that node – so that’s precisely what the node explorer asks you for.
In our example node configuration, this is all you need to supply before you’re off to the races making great Corda integrations.
Looking for some additional resources? Take a look at these:
- The Corda documentation page on all of the node config params
- The Corda documentation on node configuration has a lot of great info
- There’s a pretty clear config guide from the blockchain automation framework
- Here’s a good tutorial on RPC programming if you haven’t done it before.
If you’d like to see more blog posts like these or have ideas on what we should add, feel free to send a note to [email protected].