Skip to content

Commit 8e94576

Browse files
committed
docs/node: Document on-chain ROFL offer access policy
1 parent 1789071 commit 8e94576

1 file changed

Lines changed: 49 additions & 23 deletions

File tree

docs/node/run-your-node/rofl-node.mdx

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -233,35 +233,61 @@ logs](#checking-status) to figure out the remapped value, for example:
233233
Above, the original ROFL app ID `rofl1qrjtky678pd3uchsdlhqtjugnsvtck3wyg7w5324`
234234
was remapped to `4bd2d31255ae7e5cec31084cde02fb40640d4d678db111d1c6ba53478f5f2fc2`.
235235

236-
#### Limit ROFL node to specific ROFL creators
236+
#### Limit an offer to specific ROFL creators {#limit-rofl-node-to-specific-rofl-creators}
237237

238238
Sometimes you want your ROFL node to be used only by yourself or your team.
239239
Or have market-priced offers that can be rented by anyone and "internal"
240-
offers that are free of charge for yourself or your team. `allowed_creators`
241-
option in the `rofl_scheduler` section of your node's configuration allows
242-
you to do that. You can define the whitelist globally and/or per-offer in
243-
your node configuration.
244-
245-
```yaml title="config.yml"
246-
...
247-
config:
248-
rofl_scheduler:
249-
provider_address: oasis1qqcd0qyda6gtwdrfcqawv3s8cr2kupzw9v967au6
250-
allowed_creators: # Global whitelist of allowed apps by ROFL creators on this node
251-
- oasis1qrk58a6j2qn065m6p06jgjyt032f7qucy5wqeqpt
252-
offers:
253-
- small
254-
- id: internal # Per-offer whitelist of allowed apps by ROFL creators on this node
255-
allowed_creators:
256-
- oasis1qqnf0s9p8z79zfutszt0hwlh7w7jjrfqnq997mlw
257-
capacity:
258-
instances: 24
259-
memory: 65536
260-
cpus: 24
261-
storage: 549755813888
240+
offers that are free of charge for yourself or your team.
241+
242+
This access policy is defined **per-offer and on-chain**, as part of the offer
243+
metadata. Consequently, you can change it by submitting a transaction instead of
244+
editing your node's configuration file and restarting the node. Add the
245+
corresponding keys to the `metadata` section of an offer in your
246+
`rofl-provider.yaml`:
247+
248+
```yaml title="rofl-provider.yaml"
249+
offers:
250+
- id: small
251+
# ...resources, payment and capacity omitted...
252+
- id: internal
253+
# ...resources, payment and capacity omitted...
254+
metadata:
255+
# Only these accounts can rent machines from this offer.
256+
net.oasis.scheduler.offer.allowed_creators: >-
257+
oasis1qrk58a6j2qn065m6p06jgjyt032f7qucy5wqeqpt,
258+
oasis1qqnf0s9p8z79zfutszt0hwlh7w7jjrfqnq997mlw
259+
# Hide this offer from public offer listings.
260+
net.oasis.scheduler.offer.private: "1"
262261
```
263262

263+
Then run [`oasis rofl provider update-offers`] to store the updated offers
264+
on-chain. The ROFL Scheduler picks up the new policy on the next round, no node
265+
restart required.
266+
267+
The ROFL Scheduler recognizes the following offer metadata keys:
268+
269+
| Key | Value |
270+
|-----|-------|
271+
| `net.oasis.scheduler.offer.allowed_creators` | Comma-separated list of accounts allowed to rent machines from this offer. If the key is absent or empty, anyone can rent a machine. |
272+
| `net.oasis.scheduler.offer.allowed_artifacts.<kind>` | Comma-separated list of allowed SHA256 hashes of the artifact `<kind>` which is one of `firmware`, `kernel`, `initrd` or `stage2`. If the key for a specific kind is absent, any artifact of that kind is allowed. |
273+
| `net.oasis.scheduler.offer.private` | Set to `"1"` to hint that this offer should be hidden from public-facing offer listings. Any other value (or an absent key) keeps the offer public. This is only a listing hint and does **not** restrict who can rent the offer — combine it with `allowed_creators` for that. |
274+
275+
Malformed entries (an invalid address or artifact hash) are ignored and reported
276+
as a warning in [your logs](#checking-status).
277+
278+
:::caution
279+
280+
ROFL Scheduler versions before 0.9.0 read `allowed_creators` and
281+
`allowed_artifacts` from the `rofl_scheduler` section of the node's
282+
`config.yml`. These options have been removed without a fallback, so when
283+
upgrading, move them to the offer metadata as shown above and remove them from
284+
your node configuration. `offers` is now strictly a list of offer identifiers
285+
and no longer accepts per-offer override blocks.
286+
287+
:::
288+
264289
[rofl-scheduler]: https://github.com/oasisprotocol/oasis-sdk/releases
290+
[`oasis rofl provider update-offers`]: https://github.com/oasisprotocol/cli/blob/master/docs/rofl.md#provider-update-offers
265291

266292
### Hosting the ROFL App Bundle Directly
267293

0 commit comments

Comments
 (0)