Repository navigation
feat(admin): operator commands for the gateway's configuration, the chain catalogue (diff, reload, chains, tokens, contracts) and every account's payouts - #227
Merged
Conversation
pviti
force-pushed
the
feature/admin-disputes-operators
branch
from
November 27, 2026 15:33
cba6393 to
1f1dc5c
Compare
pviti
force-pushed
the
feature/admin-config-catalog-payouts
branch
from
November 27, 2026 15:34
e445c28 to
d62ef7d
Compare
pviti
force-pushed
the
feature/admin-disputes-operators
branch
from
November 27, 2026 15:49
1f1dc5c to
e80104d
Compare
…hain catalogue and payouts rail0 admin config [group] what the gateway is running with, one setting a row rail0 admin catalog what a reload of the catalogue snapshot would change rail0 admin catalog reload apply it (write mode, asks first, one process) rail0 admin catalog chains|tokens|contracts whole rows, what is not in service included rail0 admin payouts [get|events] every account's payouts, read-only rail0 admin payouts destinations [get|events] every account's payout destinations, read-only Refused in agent mode like the rest of the group. rail0-go at the branch of commercelayer/rail0-go#99.
The gateway's configuration report names a source for every setting (constant, default, override, environment_file) since it reads part of its settings from a file per environment (rail0-gateway#496). The row carries it as it comes, the table has a column for it, and the help says what "overridden" means for a setting that has no variable: the environment's file gives a value other than the code's. A gateway older than the field leaves it null.
pviti
force-pushed
the
feature/admin-config-catalog-payouts
branch
from
November 27, 2026 15:50
d62ef7d to
fe4b8cc
Compare
pviti
changed the base branch from
feature/admin-disputes-operators
to
milestone/next
November 27, 2026 15:50
pviti
marked this pull request as ready for review
November 27, 2026 15:51
This was referenced Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
go.modrequires the released rail0-go v1.12.0 (commercelayer/rail0-go#96, commercelayer/rail0-go#98 and commercelayer/rail0-go#99 are in it).What
The last three groups under
rail0 admin(OP10 and OP12 of the operator proposal).admin config [group]--overriddenadmin catalogadmin catalog reloadadmin catalog chains|tokens|contractsadmin payouts(get,events)admin payouts destinations(get,events)Refused in agent mode like the rest of the group.
Decisions worth a look
admin catalog chains|tokens|contracts, notadmin chains|tokens|contracts: everything about the catalogue is under one command, next to the diff and the reload;admin payouts destinations, notadmin payout-destinations: the merchant's command israil0 payouts destinations.admin configprints one setting a row (group,setting,value,env,source,overridden,description) in every output mode, where the gateway answers a nested table. A row is what a person reads and whatjq 'select(.overridden)'filters;generated_atis the only thing left out.sourceis the gateway's own word for where the value comes from (constant,default,override,environment_file, from rail0-gateway#496) and is passed on as it comes; a gateway older than the field leaves itnull. For a setting read from the environment's file there is no variable, andoverriddenmeans the file gives a value other than the code's.--overriddenkeeps the settings whose environment variable is set: what an environment changed from the defaults. An argument selects one group; an unknown one is refused with the list this gateway has.catalog reloadasks first, after reading the diff: the question says how many changes are pending and that it changes one process only. It is not destructive, but it is what puts a database change live (a chain switched on starts taking payments).chain_idandchain_slugadded by the command, read from the chain list: the rows carry only the catalogue's internalblockchain_id, andrail0 chainscannot name a chain that is not in service, which is what these lists exist for. One more request.catalogprintspending: 0: the SDK's type leaves a zero out, and zero is the answer looked for.404underadmin payoutsnames the feature: with payouts off the routes do not exist, and "the id may be wrong" alone would send the operator after an id.Tests
gofmt,go vet ./...,go test ./...green;docs/clianddocs/manregenerated.cmd/admin_catalog_test.go: the configuration as sorted rows with their fields, the source of each kind of setting and a gateway that names none, one group, an unknown group,--overriddenfor a variable and for the environment's file; the cells (a map of per-chain values, a flag, a null); the diff with and without pending changes; the chain list with a keyed endpoint's placeholder;chain_idandchain_slugadded to tokens and contracts, a row whose chain is unknown left as it came; the reload refused without write mode with nothing sent, the diff read before the question, nothing reloaded without an answer, the write-mode token on the request, the question's wording for 0, 1 and several changes; the payout and destination filters, single reads and audit trails, their local refusals; the 404 hint, on these commands only.Checked against staging (test operator key, session revoked afterwards)
admin config: 61 settings in 14 groups,--prettyat 150 and 100 columns, one group, an unknown group, the four settings staging overrides.admin catalog: not stale,pending: 0;chains(10, four not in service),tokens(14),contracts, with out-of-service chains named by slug. Every RPC URL checked: no placeholder to resolve and nothing that looks like a key (staging uses public endpoints).admin catalog reload:write_mode_requiredwithout write mode; in write mode the question, answered no; refused in agent mode.admin payouts,destinations,get:404with the hint (the payouts feature is off on staging).Not done live: the catalogue was not reloaded, and no payout row was read (staging has the feature off). Both are covered by the unit tests only.