Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should still work with DIY gateways #28

Open
shawaj opened this issue Mar 27, 2022 · 3 comments
Open

Should still work with DIY gateways #28

shawaj opened this issue Mar 27, 2022 · 3 comments

Comments

@shawaj
Copy link
Member

shawaj commented Mar 27, 2022

This container should still work for DIY gateways.

So we need to maintain ability to have file based key in persistent storage for that

This was removed in #25 / #27 but needs to be added back

@pritamghanghas
Copy link
Contributor

@shawaj How do people with DIY gateways manage this file. Do they manually write it. Or they just use the default key. If so, how do they receive credits.

@shawaj
Copy link
Member Author

shawaj commented Mar 29, 2022

@pritamghanghas if you check for it worked before you should see.

Basically as follows:

  • if there is ECC use that
  • if no ECC and no key file in persistent storage, create new key
  • if no ECC key and there is a key file in persistent storage, then copy it into place

@shawaj
Copy link
Member Author

shawaj commented Mar 29, 2022

if [ -f "/var/data/gateway_key.bin" ]
then
echo "Key file already exists"
echo 'keypair = "/var/data/gateway_key.bin"' >> settings.toml
else
echo "Copying key file to persistent storage"
if ! PUBLIC_KEYS=$(/usr/bin/helium_gateway -c /etc/helium_gateway key info)
then
echo "Can't get miner key info"
exit 1
else
cp /etc/helium_gateway/gateway_key.bin /var/data/gateway_key.bin
echo 'keypair = "/var/data/gateway_key.bin"' >> settings.toml
fi
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants