Why Nostr? What is Njump?
2023-06-07 05:10:33
in reply to

Michael Gronager [ARCHIVE] on Nostr: 📅 Original date posted:2012-02-29 📝 Original message:I just finished adding ...

📅 Original date posted:2012-02-29
📝 Original message:I just finished adding NATPMP, together with IDG UPnP, to libcoin. This enables libcoin/bitcoind to setup port mapping also on Apple routers (AirPort Extreme/Express/TimeMachine) and a few other that supports this protocol.

libcoin/bitcoind first tried to setup mapping using UPnP, if that fails it resorts to using PMP.

It chooses a lease time of (default) 20 minutes and renews this every 10 minutes. This also means that if you are running libcoin on your laptop it will, when e.g. moved to your work, just setup the mapping there and the mapping back home will silently expire.

To include portmapping in libcoin/bitcoind the only thing needed is to add the PortMapper class and start it:

PortMapper mapper(node.get_io_service(), port);
if(portmap) mapper.start();

where "portmap" is the former "upnp" command line option.

Also note that I choose to include the relevant portions of miniupnpc and libnatpmp in the coinNAT library to make it easier to build.

I choose to make a rather aggressive setting for quitting searching for an IGD device (3 seconds). If I waited too long here the PMP port mapping would only kick in after the other clients had tried to connect to the new node and timed out.

If it is too small please notify me - I only have access to a UPnP router sporadicly.

And btw: Also added proxy capability to libcoin (have a look in coinChain/Proxy.h for implementation details).

Cheers,

Michael
Author Public Key
npub1nc78dlt7hp3v5dl32qu3m678h2j0ss374glcjnz8df75xcx7ngpq4gw452