From ae7fd726f6a7cf0a0f62d42f286dfaa3450f4c1f Mon Sep 17 00:00:00 2001 From: Albert Castellana Date: Thu, 11 Jun 2026 17:25:19 +0200 Subject: [PATCH] fix(docs-sync): stop overwriting the generated root _meta.json The sync-docs workflow rsynced the generated category-based docs/api-references/_meta.json into genlayer-docs and then immediately overwrote it with a hardcoded heredoc containing the pre-grouping flat command list (init, up, deploy, ...). Those keys no longer match the directory layout, so the genlayer-docs sidebar rendered broken entries on every sync (fixed manually in genlayer-docs#426; this removes the cause). Also make the generated root meta complete: - add "index": "Overview" for the generated index.mdx - append ungrouped top-level commands (estimate-fees, finalize, finalize-batch) so they get explicit nav entries instead of relying on Nextra's implicit append Snapshot under docs/api-references regenerated against current main (picks up the new estimate-fees command and latest help text). Co-Authored-By: Claude Fable 5 --- .github/workflows/sync-docs.yml | 24 ------------------- docs/api-references/_meta.json | 6 ++++- docs/api-references/contracts/deploy.mdx | 3 +++ docs/api-references/contracts/write.mdx | 3 +++ docs/api-references/estimate-fees.mdx | 25 ++++++++++++++++++++ docs/api-references/finalize-batch.mdx | 20 ++++++++++++++++ docs/api-references/finalize.mdx | 20 ++++++++++++++++ docs/api-references/index.mdx | 5 +++- docs/api-references/transactions/receipt.mdx | 2 +- scripts/generate-cli-docs.mjs | 10 +++++++- 10 files changed, 90 insertions(+), 28 deletions(-) create mode 100644 docs/api-references/estimate-fees.mdx create mode 100644 docs/api-references/finalize-batch.mdx create mode 100644 docs/api-references/finalize.mdx diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 080706ca..abb65083 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -72,30 +72,6 @@ jobs: rsync -a "${{ github.workspace }}/docs/api-references/" pages/api-references/genlayer-cli/ # Copy README as sibling file (strip badges/emojis) sed -E '/^\[!\[.*\]\(https:\/\/(img\.shields\.io|dcbadge|badge\.fury)/d' "${{ github.workspace }}/README.md" > pages/api-references/genlayer-cli.mdx - # Write _meta.json - cat > pages/api-references/genlayer-cli/_meta.json << 'METAEOF' - { - "init": "init", - "up": "up", - "stop": "stop", - "new": "new", - "config": "config", - "network": "network", - "deploy": "deploy", - "call": "call", - "write": "write", - "schema": "schema", - "code": "code", - "receipt": "receipt", - "trace": "trace", - "appeal": "appeal", - "appeal-bond": "appeal-bond", - "account": "account", - "staking": "staking", - "localnet": "localnet", - "update": "update" - } - METAEOF if [ -z "$(git status --porcelain)" ]; then echo "No changes to commit" exit 0 diff --git a/docs/api-references/_meta.json b/docs/api-references/_meta.json index aeb6b07b..9b9b4046 100644 --- a/docs/api-references/_meta.json +++ b/docs/api-references/_meta.json @@ -1,9 +1,13 @@ { + "index": "Overview", "environment": "Environment", "configuration": "Configuration", "contracts": "Contracts", "transactions": "Transactions", "accounts": "Accounts", "staking": "Staking", - "localnet": "Localnet" + "localnet": "Localnet", + "estimate-fees": "estimate-fees", + "finalize": "finalize", + "finalize-batch": "finalize-batch" } \ No newline at end of file diff --git a/docs/api-references/contracts/deploy.mdx b/docs/api-references/contracts/deploy.mdx index b0677d0c..0205f4a0 100644 --- a/docs/api-references/contracts/deploy.mdx +++ b/docs/api-references/contracts/deploy.mdx @@ -14,4 +14,7 @@ Deploy intelligent contracts | --- | --- | --- | :---: | --- | | | --contract <contractPath> | Path to the smart contract to deploy | No | | | | --rpc <rpcUrl> | RPC URL for the network | No | | +| | --fees <json> | Transaction fee options JSON passed to genlayer-js. | No | | +| | --fee-value <wei> | Fee deposit value to send with the transaction | No | | +| | --valid-until <unixTimestamp> | Unix timestamp after which the transaction is invalid | No | | | -h | --help | display help for command | No | | diff --git a/docs/api-references/contracts/write.mdx b/docs/api-references/contracts/write.mdx index 9050af76..8da033f7 100644 --- a/docs/api-references/contracts/write.mdx +++ b/docs/api-references/contracts/write.mdx @@ -18,4 +18,7 @@ Sends a transaction to a contract method that modifies the state | Short | Long | Description | Required | Default | | --- | --- | --- | :---: | --- | | | --rpc <rpcUrl> | RPC URL for the network | No | | +| | --fees <json> | Transaction fee options JSON passed to genlayer-js. | No | | +| | --fee-value <wei> | Fee deposit value to send with the transaction | No | | +| | --valid-until <unixTimestamp> | Unix timestamp after which the transaction is invalid | No | | | -h | --help | display help for command | No | | diff --git a/docs/api-references/estimate-fees.mdx b/docs/api-references/estimate-fees.mdx new file mode 100644 index 00000000..12e510e2 --- /dev/null +++ b/docs/api-references/estimate-fees.mdx @@ -0,0 +1,25 @@ +--- +title: estimate-fees +--- + +Build a transaction fee preset, optionally from a Studio/localnet write +simulation + +### Usage + +`$ genlayer estimate-fees [options] [contractAddress] [method]` + +### Arguments + +- `[contractAddress]` +- `[method]` + +### Options + +| Short | Long | Description | Required | Default | +| --- | --- | --- | :---: | --- | +| | --rpc <rpcUrl> | RPC URL for the network | No | | +| | --fees <json> | Fee estimate options JSON passed to genlayer-js estimateTransactionFees. | No | | +| | --json | Print the fee estimate as JSON without spinner output | No | | +| | --include-report | Include simulation fee accounting/report in the generated estimate output | No | | +| -h | --help | display help for command | No | | diff --git a/docs/api-references/finalize-batch.mdx b/docs/api-references/finalize-batch.mdx new file mode 100644 index 00000000..afc1f6f9 --- /dev/null +++ b/docs/api-references/finalize-batch.mdx @@ -0,0 +1,20 @@ +--- +title: finalize-batch +--- + +Finalize a batch of idle transactions in a single call (public call) + +### Usage + +`$ genlayer finalize-batch [options] ` + +### Arguments + +- `` + +### Options + +| Short | Long | Description | Required | Default | +| --- | --- | --- | :---: | --- | +| | --rpc <rpcUrl> | RPC URL for the network | No | | +| -h | --help | display help for command | No | | diff --git a/docs/api-references/finalize.mdx b/docs/api-references/finalize.mdx new file mode 100644 index 00000000..b977d82d --- /dev/null +++ b/docs/api-references/finalize.mdx @@ -0,0 +1,20 @@ +--- +title: finalize +--- + +Finalize a transaction that is ready to be finalized (public call) + +### Usage + +`$ genlayer finalize [options] ` + +### Arguments + +- `` + +### Options + +| Short | Long | Description | Required | Default | +| --- | --- | --- | :---: | --- | +| | --rpc <rpcUrl> | RPC URL for the network | No | | +| -h | --help | display help for command | No | | diff --git a/docs/api-references/index.mdx b/docs/api-references/index.mdx index 49295cfd..faf3b24f 100644 --- a/docs/api-references/index.mdx +++ b/docs/api-references/index.mdx @@ -6,7 +6,7 @@ GenLayer CLI is a development environment for the GenLayer ecosystem. It allows developers to interact with the protocol by creating accounts, sending transactions, and working with Intelligent Contracts by testing, debugging, and deploying them. -Version: `0.34.0` +Version: `0.39.1` ### Command List @@ -17,6 +17,7 @@ Version: `0.34.0` - `genlayer deploy` — Deploy intelligent contracts - `genlayer call` — Call a contract method without sending a transaction or changing the state - `genlayer write` — Sends a transaction to a contract method that modifies the state +- `genlayer estimate-fees` — Build a transaction fee preset, optionally from a Studio/localnet write simulation - `genlayer schema` — Get the schema for a deployed contract - `genlayer code` — Get the source for a deployed contract - `genlayer config` — Manage CLI configuration, including the default network @@ -28,6 +29,8 @@ Version: `0.34.0` - `genlayer appeal` — Appeal a transaction by its hash - `genlayer appeal-bond` — Show minimum appeal bond required for a transaction - `genlayer trace` — Get execution trace for a transaction (return data, stdout, stderr, GenVM logs) +- `genlayer finalize` — Finalize a transaction that is ready to be finalized (public call) +- `genlayer finalize-batch` — Finalize a batch of idle transactions in a single call (public call) - `genlayer staking` — Staking operations for validators and delegators --- diff --git a/docs/api-references/transactions/receipt.mdx b/docs/api-references/transactions/receipt.mdx index 03039ed8..1ab60eda 100644 --- a/docs/api-references/transactions/receipt.mdx +++ b/docs/api-references/transactions/receipt.mdx @@ -16,7 +16,7 @@ Get transaction receipt by hash | Short | Long | Description | Required | Default | | --- | --- | --- | :---: | --- | -| | --status <status> | Transaction status to wait for (UNINITIALIZED, PENDING, PROPOSING, COMMITTING, REVEALING, ACCEPTED, UNDETERMINED, FINALIZED, CANCELED, APPEAL_REVEALING, APPEAL_COMMITTING, READY_TO_FINALIZE, VALIDATORS_TIMEOUT, LEADER_TIMEOUT) (default: "FINALIZED") | No | | +| | --status <status> | Transaction status to wait for (UNINITIALIZED, PENDING, PROPOSING, COMMITTING, REVEALING, ACCEPTED, UNDETERMINED, FINALIZED, CANCELED, APPEAL_REVEALING, APPEAL_COMMITTING, READY_TO_FINALIZE, VALIDATORS_TIMEOUT, LEADER_TIMEOUT, LEADER_REVEALING) | No | `FINALIZED` | | | --retries <retries> | Number of retries | No | `100` | | | --interval <interval> | Interval between retries in milliseconds (default: 5000) | No | | | | --rpc <rpcUrl> | RPC URL for the network | No | | diff --git a/scripts/generate-cli-docs.mjs b/scripts/generate-cli-docs.mjs index f661f9ac..30474d0b 100644 --- a/scripts/generate-cli-docs.mjs +++ b/scripts/generate-cli-docs.mjs @@ -294,10 +294,18 @@ async function main() { 'staking': 'Staking', 'localnet': 'Localnet', }; - const rootMeta = {}; + const rootMeta = { index: 'Overview' }; for (const [key, label] of Object.entries(GROUP_LABELS)) { rootMeta[key] = label; } + // Ungrouped top-level commands (e.g. finalize) still need nav entries + const ungrouped = outputs + .filter((o) => o.relDir === '' && o.filename !== 'index.mdx') + .map((o) => o.filename.replace(/\.mdx$/, '')) + .sort(); + for (const slug of ungrouped) { + if (!rootMeta[slug]) rootMeta[slug] = slug; + } await fs.writeFile(path.join(rootOut, '_meta.json'), JSON.stringify(rootMeta, null, 2), 'utf8'); // Write _meta.json for each group subdirectory