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

feat: prevent start flag and debug logs #31

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ https://github.com/helium/gateway-rs/releases) (built from the [GitHub source](h
## Environment variables
`REGION_OVERRIDE` and `I2C_DEVICE` are used to load the correct settings for the gateway. All settings override will continue to work as documented by upstream [gateway-rs](https://github.com/helium/gateway-rs).

`PREVENT_START_GATEWAYRS` can be set to `1` to prevent the miner from starting.
This is helpful for debugging the miner manually.

## Mr Bump

[Mr Bump](https://github.com/mr-bump) is a GitHub bot we created to automate some tasks related to the miner software. This includes updating the miner to the latest GA (and tagging / releasing this update) as well as updating the necessary `docker-compose.yml` files.
Expand Down
2 changes: 1 addition & 1 deletion nebra-gateway-settings-defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ listen = "0.0.0.0:1680"

[log]
method = "stdio"
level = "info"
level = "debug"
timestamp = false

[update]
Expand Down
15 changes: 10 additions & 5 deletions start-gatewayrs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ then
export GW_REGION="${REGION_OVERRIDE}"
fi

# NOTE:: this should ultimately move to pktfwd container.
# NOTE: this should ultimately move to pktfwd container.
# the local rpc should is capable of providing this information
/opt/nebra-gatewayrs/gen-region.sh &

# there is a systemd/sysv script for this service in the deb package
# it doesn't make much sense to use it in the container
/usr/bin/helium_gateway -c /etc/helium_gateway server

prevent_start="${PREVENT_START_GATEWAYRS:-0}"
if [ "$prevent_start" = 1 ]; then
echo "gatewayrs will not be started. PREVENT_START_GATEWAYRS=1"
while true; do sleep 1000; done
else
# there is a systemd/sysv script for this service in the deb package
# it doesn't make much sense to use it in the container
/usr/bin/helium_gateway -c /etc/helium_gateway server
fi