NebraLtd / helium-miner-software

Software for Nebra (and third party) Helium Miners
https://nebra.io/hnt
MIT License
93 stars 48 forks source link

Upnp support #29

Closed vpetersson closed 3 years ago

vpetersson commented 3 years ago

@ryanteck Now with NAT'ing being discouraged, maybe we should sideload a UPNP client to set this up? I think a lot of consumer grade routers have uPNP enabled by default. What do you think?

ryanteck commented 3 years ago

That's a pretty good idea, I'll have a look at getting it added.

vpetersson commented 3 years ago

I think upnp generate a random port on the router but maybe it's possible to suggest a port. My understanding is that helium requires a specific port.

ryanteck commented 3 years ago

Hmm, it looks like if I add upnpc to one of the containers. (Possibly the one that does all the configuration would be the best to add it to).

And with that it should be possible to specify a specific port and protocol so think it should be able to do the job.

vpetersson commented 3 years ago

Nice! I'd probably add it to a dedicated container to better isolate it.

ryanteck commented 3 years ago

I think @shawaj wanted me to try and keep the images to as small as a size as possible, in some experimentation with balena it seems even if the same base layers are used it still bulks out the images by the size of the container. So could possibly add an extra 100MB even with an alpine base.

But then at the same time means if it doesn't work well it's easier to remove and such. So I'll put it into a new container.

vpetersson commented 3 years ago

100% agree that we should keep the storage footprint to a minimal. However if we use the same base image and just one layer being different, this should add minimal footprint (a few megs tops).

ryanteck commented 3 years ago

Unfortunately I'm fairly certain balena doesn't work like that @vpetersson , I did spend some time a few weeks ago moving them all to the same base image, but the resulting SD image was closer to 3GB as the base image was bigger.

When I changed back to different base images for most containers where the overall container was smaller, the balena image was smaller. (Under 2GB).

However have split this off already, just need to write the script and it should be ready to go.

https://github.com/NebraLtd/hm-upnp

vpetersson commented 3 years ago

Interesting. My understanding was that they just forked Moby. Odd that they removed the dedupe code. I haven't looked into it myself. I just know that is how it works in regular docker/containerd/moby.

ryanteck commented 3 years ago

Implemented and working on testnet.

Will push to prod tomorrow.

On Sun, 18 Apr 2021, 12:24 Viktor Petersson, @.***> wrote:

Interesting. My understanding was that they just forked Moby. Odd that they removed the dedupe code. I haven't looked into it myself. I just know that is how it works in regular docker/containerd/moby.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NebraLtd/helium-miner-software/issues/29#issuecomment-821976158, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINW2NXSJUPD6FERMVGYWDTJK6PFANCNFSM43EBVZZQ .

ryanteck commented 3 years ago

Resolved in #30