What is Nostr?
Cobrador
npub1k03…8rty
2025-01-28 17:38:18

Cobrador on Nostr: ### Using the SDK in practice Earlier we explained the ins and outs of building ...

### Using the SDK in practice

Earlier we explained the ins and outs of building packages and images for OpenWRT. Now lets actually build a package rather than just talking about it.

##### Lets clone the SDK
```
git clone https://github.com/OpenTollGate/tollgate-sdk.git
```

##### Lets install a tool to interact with blossom servers
```
./blossom-installer.sh
```

##### Lets install a tool to interact with nostr relays
```
./noscl-installer.sh
```

##### Lets prepare a file containing the keys for these tools
```
cat blossom_secrets.json
{
"servers": [
"https://files.v0l.io/";,
"https://nostr.download/";,
"https://blossom.poster.place/";
],
"relays": [
"wss://orangesync.tech",
"wss://nostr.mom",
"wss://nostr.chaima.info"
],
"secret_key": "nsec[your_secret_key]",
"secret_key_hex": "[hex_version_of_your_secret_key]",
"public_key": "npub[your_public_key]",
"public_key_hex": "[hex_version_of_your_public_key]"
}
```

##### Lets go!
```
./build-firmware gl-mt3000
```

The above script
* installs some dependencies
* downloads the SDK to `/tmp/openwrt-sdk/openwrt-sdk-23.05.3-mediatek-filogic_gcc-12.3.0_musl.Linux-x86_64`
* compiles `golang` as part of a custom feed because the newest version of `golang` is too old for some of [our dependencies](https://github.com/OpenTollGate/tollgate-module-relay-go/blob/main/src/go.mod)
* compiles the remaining custom feeds

> [!Patience]
> Even though we are using the SDK, the above steps will take a while if your running them for the first time. This might be your chance to get a coffee.

##### Are you winning?
Eventually you should see the following output. This is the nostr event that your npub just broadcasted to announce that you compiled your custom feed successfully and that your packages are available on this listed blossom servers. Maybe franzap (nprofile…ucf3) has advice on how we can improve this workflow.
```
{
"binaries": {
"tollgate-module-whoami-go_0.1-1_aarch64_cortex-a53.ipk": {
"file_hash": "cc84a9cc453f5c6a5ff37c8162f5161178ecd7027f29530b5ffc955fd1a7d196",
"servers": [
"https://files.v0l.io/";,
"https://nostr.download/";,
"https://blossom.poster.place/";
]
},
"golang-src_1.23.4-1_aarch64_cortex-a53.ipk": {
"file_hash": "db629bae7a6ab300ee34032cb11717447ffdbfc25260fed8554c991722d29ee8",
"servers": []
},
"golang_1.23.4-1_aarch64_cortex-a53.ipk": {
"file_hash": "95d1e430d654d99c1ca041dfbabc535a1fb72e6d0a19f960f731cc2ab612ccb6",
"servers": []
},
"tollgate-module-crowsnest-go_0.1-1_aarch64_cortex-a53.ipk": {
"file_hash": "3200a4f565886798583403e9d43d515f303172a697e31b55e70d63a7536d6fc9",
"servers": [
"https://files.v0l.io/";,
"https://nostr.download/";,
"https://blossom.poster.place/";
]
},
"tollgate-module-merchant-go_0.1-1_aarch64_cortex-a53.ipk": {
"file_hash": "85e98940f78e3ba1088692a4e812759ba7bfa997af3552acb61c31ac989a6995",
"servers": [
"https://files.v0l.io/";,
"https://nostr.download/";,
"https://blossom.poster.place/";
]
},
"tollgate-module-relay-go_0.1-1_aarch64_cortex-a53.ipk": {
"file_hash": "403e81351cb019df61e96e62fe88c4d7f9783fb5db9e6ffe59ff0d224e1657bc",
"servers": [
"https://files.v0l.io/";,
"https://nostr.download/";,
"https://blossom.poster.place/";
]
},
"golang-doc_1.23.4-1_aarch64_cortex-a53.ipk": {
"file_hash": "6589935e4c472e97280f18e795a6f12292490ee0149ea307556af475548ae36f",
"servers": [
"https://files.v0l.io/";,
"https://nostr.download/";,
"https://blossom.poster.place/";
]
},
"tollgate-module-valve-go_0.1-1_aarch64_cortex-a53.ipk": {
"file_hash": "9fab480f503aef59621db43aa69be671f9d78139c7cb79853279d3d46510e3bc",
"servers": [
"https://files.v0l.io/";,
"https://nostr.download/";,
"https://blossom.poster.place/";
]
}
},
"target_info": {
"target_platform": "mediatek-filogic",
"full_arch": "aarch64_cortex-a53"
},
"feed_info": {
"71e37959c3e0d4a4ef9c8d053f9d9fdb72a797cb": {
"directory": "toll_gate_sdk",
"branch": "main"
},
"278cf417b3b27298b8b1ea9fc116177dd227eb71": {
"directory": "custom",
"branch": "main"
},
"1292a493a68e1ef144429ac33848eabf60a9b59c": {
"directory": "base",
"branch": "openwrt-23.05"
}
}
}
```



##### How can you help? #help
We have plenty of questions that could benefit from your expertise:
* how can we make our custom packages smaller - static/dynamic linking?
* how can we configure [`golang.mk`](https://primal.net/e/nevent1qqs95086an45xa94kxjml23t3774xr2kr295pw0m4u4d4jyaazfcfrsserkkj) so that we can target pretty any OpenWRT router successfully?
* how can we get the builds to run more quickly?
* does it make sense to create a separate git action for each of our modules or is the `set-up` and `tear-down` too expensive?
Author Public Key
npub1k03rader0vm94j5ee8fg7pc2x9xkr2phu77sljas7qu5mh8mvgvqpe8rty