Public-IP and Listen-IP settings in stakepool-config.yaml


i made a simple small schematic if someone will run a stakepool on the homenetwork and behind a homerouter with nat enabled. maybe your’re confused what public-ip and listen-ip settings are for?

here is a small example:

maybe this can help you out finding a solution for your home network.

best regards,
martin - atada stakepool


Very useful, Thanks

@ATADA Don’t you think that setup will produce adversarial forks when all 4 nodes will produce 4 different blocks?

This is just a setup how to run 4 instances of jormungandr in a home network. Of course, only one at any time should be the leader, others must be passiv nodes. But that doesn’t change the network setup. If you have 4 pools registered, than you can run all 4 nodes in leader mode of course.

@ATADA How do you switch leadership?

you have to use the “jcli rest” api for that. so basically you have to run some statuscheck scripts in the background checking the health of your leadernode and passive nodes. than you can initiate to rise a passive node to a leader node and also delete the leadership from the leadernode so it became a passive node. jcli rest infos can be found here:

@ATADA I also found what you wrote on telegram:
“just fire up your node without the secret. or better, fire it up with the secret and after the bootstrap delete the leader via the jcli rest request. but you need any kind of “management” script for your nodes. the goal is to run a leader node and one or more passive nodes. in the case the leader node falls behind the blockchain tip you delete the leadership from this node and rise a passive node (the best one of them) to be the new leader.”

“than you can initiate to rise a passive node to a leader node”

Is it possible to do it without restart as the passive node was bootstrapped without node-secret?

I am wondering if you use the same node_id for all of your nodes?

yes, thats the point. you communicate with your passive node via the jcli. and you can make it a leader without restarting. and yes, you start all the nodes with the same secret, same node_id, etc. but you’ll need different rest api ports and also different storage locations.

1 Like

Nice setup :slight_smile: Did you think about making a tcp tunnel to have one port exposed from your network that is tunneling traffic always to leader node?

I mean you have only tunneling rather then forwading to any of your node which is a leader. So event of switching leadership would require ./jcli command & for example ipfw execued on router that redirect -> (old leader) to -> (new leader)

no you don’t need this. the important thing is, that the node is on the tip of the blocks and ready so SEND a block to the blockchain if it is choosen to be the blockleader. this connection will be made out of the node, not in.

But if node is switched from passive to the leader (pool) it initially has no other nodes connected in and less chance to advertise block to the network. Switching port would switch connected pools in theory (they would reset connection anyway). But you would have only one address that network has instead of & that some nodes would misconnect because may not know that leadership switched :slight_smile: I am just loudly thinking :slight_smile:

just try it.

the passive node want come up and stay on top if you have no incoming connections to it. also sometimes a node gets stuck on a forked block, so its better to let the nodes work independently.

and, the passive nodes are having connections to others nodes too. they just don’t generate the block if they were choosen.

but, it will mostly be all different with the haskell shelley testnet release.

Are you sure the listen address should have my internal ip address?

Looking at some guides they always use
Just confirming, thanks for this diagram its great. just means that ALL internal addresses are ok. yes, this works. but if you like to have it clear, use the one that you want. if you only have one ip address on the host, than you can leave it on

Ah ok. Thanks