Getting started with Roaming
Config Service is an Oracle service that stores all routing information on the Helium IoT Network. Each roaming partner is registered in the Config Service under their Net ID, and may define multiple routes. Each route contains information such as
- DevEUI+AppEUI pairs — so we know which join requests to send your way
- DevAddr ranges — so we know which uplinks to send your way
- Server endpoint + port — so we know where to send packets to
There are two ways of interacting with the Config Service, directly through GRPC APIs or through CLI (command-line-interface).
Let’s do some setup with the CLI.
- Run this to pull & build the config service cli
git clone https://github.com/helium/helium-config-service-cli.git
curl https://sh.rustup.rs -sSf | sh
source "$HOME/.cargo/env"
cd helium-config-service-cli
cargo b --release
You can then find the built binary file
helium-config-service.cli
under./target/release
inside thehelium-config-service-cli
directory. I’d rename it into short such asmain
so you can type less words ( you can rename it by runningmv helium-config-service-cli main
)Now that we have the CLI binary, let’s just put it in a separate folder. This is recommended only for simplicity sake. Just copy
main
into the folder you created. You can reference the following commands
cd ..
mkdir cli-testing
cd cli-testing
cp ../helium-config-service-cli/target/release/main .
Let’s generate the keypair you’ll be using to authenticate your interactions with the config service, so only you can create/modify/delete routes. Run
./main env generate-keypair --commit
and you should find a file calledkeypair.bin
. Print out the public key of your keypair by running./main env info --keypair keypair.bin
Next, make sure you have a Helium Wallet. You can download them here.
Contact the Helium Foundation with your public key and Helium Wallet address via email at hello@helium.foundation for the information needed in the next steps.
Next, let’s initialize some environment variables so that you don’t have to tell the CLI the same thing over and over again in later commands
- Run
./main env init
- Fill in
http://maininet-config.helium.io:6080/
forConfig Service Host
- Fill in the path
./keypair.bin
forKeypair Location
- Fill in your NET ID for
Net ID
- Fill in your OUI for
Assigned OUI
- Fill in the number of multi-buy you want for
Default Max Copies
as a default for your routes. - Then export the environment variables. This needs to be done manually. You will see something
like this and just add
export
to each line and run it. For instance, you would run exportHELIUM_MAX_COPIES=15
variable. Do NOT put a space around the=
sign
- Run
Now, you are ready to generate your first route. Routes contain necessary information for us to know how to route a packet — DevEUI+AppEUI (for routing join requests), DevAddr range (for routing uplinks), Endpoint (so we know where to send the packet to), etc.
- Run
./main route new --commit
- You can then see the empty route template. It should look like this, except that you should be seeing you own Net ID, assigned OUI, max_copies in there
- Run
Next, let’s define DevAddr range so packet router knows which uplinks to route to your endpoint. Just use your OUI’s assigned DevAddr range, which you can get by running
./main org get
. Afterwards, run./main route devaddrs add -s <start> -e <end> --route-id <route-id> -- commit
Next, let’s define EUI pairs so packet router knows which join requests to route to your endpoint. You can run
./main route euis add --route-id <route-id> -d <dev-eui> -a <app-eui> --commit
Next, let’s define the endpoint that you use for ingesting traffic. You can run
./main route update server --host <host> --port <port> --route-id <route-id> --commit
Lastly, define other relevant parameters for HTTP roaming. You can run
./main route update http --dedupe-timeout <dedupe-timeout> --path <url path> --auth-header <auth-header> --route-id <route-id> --commit