How to handle changing public IP address on the node for personal user


Avery Starr
 

Hi,

 

Transactions depend on the IP address of the node. But for the personal user at home or small office environment, their public IP address of any computer is not fixed. It is difficult to ask personal users who might not be tech savvy to always change the config file.

How do we handle dynamic IP addresses for personal users?

 

Many thanks,

Avery


Bogdan Paunescu
 

Hi,

It is a good question. But, the way I see it, "personal users" that are able to run a node should be "tech savvy" enough to know to have a fixed public IP address and change a line in the config file. 
However, changing the node.conf doesn't propagate the change across the network. Other peers will have no idea you're at a different address. But, for the sake of argument, let's say that a user insists on deploying a Corda node on a machine with a dynamic public IP. The user could register the node with a name instead of an IP and use a DDNS.

Bogdan


Stefano Franz
 

One slight subtlety - transactions do not actually depend on the IP address of the node, but the "advertised" p2pAddress, is looked up to open a flow session.

So a simple solution would be to make the p2pAddress config field an environment variable similar to:

p2pAddress: ${MY_P2P_ADDRESS}":10200"

then, in whatever you use to start the node, you can do a lookup of what your current public facing IP address is ( I use: curl ifconfig.me)  and set the environment variable similar to:

MY_P2P_ADDRESS=$(curl ifconfig.me)
./run-corda.sh

This will ensure that everytime you register with the network-map, you will be publishing the correct IP address.


From: corda-dev@groups.io <corda-dev@groups.io> on behalf of Bogdan Paunescu via Groups.Io <Bogdan.Paunescu@...>
Sent: 23 September 2019 23:49
To: corda-dev@groups.io <corda-dev@groups.io>
Subject: Re: [corda-dev] How to handle changing public IP address on the node for personal user
 
Hi,

It is a good question. But, the way I see it, "personal users" that are able to run a node should be "tech savvy" enough to know to have a fixed public IP address and change a line in the config file. 
However, changing the node.conf doesn't propagate the change across the network. Other peers will have no idea you're at a different address. But, for the sake of argument, let's say that a user insists on deploying a Corda node on a machine with a dynamic public IP. The user could register the node with a name instead of an IP and use a DDNS.

Bogdan


Mike Hearn
 

Note that Corda isn't designed for home use. It assumes flat network connectivity, but at home or on the move users are often behind [carrier] NAT or firewalls they don't know how to control. You'd need to integrate a UPnP library to be able to successfully receive connections from other nodes. Also, the code assumes IP address changes are rare. Nodes cache NodeInfo objects.

There are probably better designs for this. For instance running a shared MQ broker in a central location, and having consumer nodes connect to it to download/upload messages, a bit like syncing email.


Viktor Kolomeyko
 

The other option that could be suitable for home or small office environment is to expose your local IP via DNS name using services like: https://ngrok.com

Even if you are on the move and changing connections, as long as you can create a tunnel to NGrok people should be able to connect to services running locally.

 

HTH,

Viktor

 

From: corda-dev@groups.io <corda-dev@groups.io> On Behalf Of Mike Hearn via Groups.Io
Sent: 24 September 2019 13:58
To: corda-dev@groups.io
Subject: Re: [corda-dev] How to handle changing public IP address on the node for personal user

 

Note that Corda isn't designed for home use. It assumes flat network connectivity, but at home or on the move users are often behind [carrier] NAT or firewalls they don't know how to control. You'd need to integrate a UPnP library to be able to successfully receive connections from other nodes. Also, the code assumes IP address changes are rare. Nodes cache NodeInfo objects.

There are probably better designs for this. For instance running a shared MQ broker in a central location, and having consumer nodes connect to it to download/upload messages, a bit like syncing email.


Wawrzyniec Niewodniczanski
 

Hi,


Drawing any design for this problem, please remember that the network map in a Corda network is cached. By designed it should be behind a CDN. So it can take minutes, hours or days to update your P2P address in NM.


That link my still be valid: https://medium.com/corda/cordas-new-network-map-infrastructure-8c4c248fd7f3


Wawrzek




On 24/09/2019 13:45, Stefano Franz via Groups.Io wrote:
One slight subtlety - transactions do not actually depend on the IP address of the node, but the "advertised" p2pAddress, is looked up to open a flow session.

So a simple solution would be to make the p2pAddress config field an environment variable similar to:

p2pAddress: ${MY_P2P_ADDRESS}":10200"

then, in whatever you use to start the node, you can do a lookup of what your current public facing IP address is ( I use: curl ifconfig.me)  and set the environment variable similar to:

MY_P2P_ADDRESS=$(curl ifconfig.me)
./run-corda.sh

This will ensure that everytime you register with the network-map, you will be publishing the correct IP address.

From: corda-dev@groups.io <corda-dev@groups.io> on behalf of Bogdan Paunescu via Groups.Io <Bogdan.Paunescu@...>
Sent: 23 September 2019 23:49
To: corda-dev@groups.io <corda-dev@groups.io>
Subject: Re: [corda-dev] How to handle changing public IP address on the node for personal user
 
Hi,

It is a good question. But, the way I see it, "personal users" that are able to run a node should be "tech savvy" enough to know to have a fixed public IP address and change a line in the config file. 
However, changing the node.conf doesn't propagate the change across the network. Other peers will have no idea you're at a different address. But, for the sake of argument, let's say that a user insists on deploying a Corda node on a machine with a dynamic public IP. The user could register the node with a name instead of an IP and use a DDNS.

Bogdan
--

Dr Wawrzyniec (Wawrzek) Niewodniczański | R3. | DevOps Lead
2 London Wall Place, 12th Floor, | London, EC2Y 5AU
O: +44 207 113 1460 | M: +44 7917-44-79-88 |
wawrzek@... . www.r3.com


Ryan Gledhill
 

IIRC, you can run clearNetworkMapCache to force a refresh on the next run


paulo@...
 

Hello Guys, 

 

as this topic was ended couple years ago, also i am new at the Group, i would like to know if a more recent market suitable solution for this is in place?

 

Regards, 

Paulo.


David Awad
 

Hey paulo, for future reference, try to use #general on slack.corda.net as it's a much faster way to get answers and input on questions. 

That being said, for a personal use case you're better off using the network bootstrapper when working locally. Don't think about the IP address at all. 

 

Normally what you'd need to do is setup a network map server, we normally recommend you use corda enterprise network manager or cordite to do so. 

 

Hopefully this helps.