Skip to content

Commit

Permalink
Merge pull request #31 from NebraLtd/marvinmarnold/integrate-gateway-rs
Browse files Browse the repository at this point in the history
feat: prevent start flag and debug logs
  • Loading branch information
marvinmarnold authored Aug 25, 2022
2 parents ac9ea2f + 8ec9cc1 commit 2197829
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
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

0 comments on commit 2197829

Please sign in to comment.