Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/sync-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docs/api-references/_meta.json
Original file line number Diff line number Diff line change
@@ -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"
}
3 changes: 3 additions & 0 deletions docs/api-references/contracts/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ Deploy intelligent contracts
| --- | --- | --- | :---: | --- |
| | --contract &lt;contractPath&gt; | Path to the smart contract to deploy | No | |
| | --rpc &lt;rpcUrl&gt; | RPC URL for the network | No | |
| | --fees &lt;json&gt; | Transaction fee options JSON passed to genlayer-js. | No | |
| | --fee-value &lt;wei&gt; | Fee deposit value to send with the transaction | No | |
| | --valid-until &lt;unixTimestamp&gt; | Unix timestamp after which the transaction is invalid | No | |
| -h | --help | display help for command | No | |
3 changes: 3 additions & 0 deletions docs/api-references/contracts/write.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ Sends a transaction to a contract method that modifies the state
| Short | Long | Description | Required | Default |
| --- | --- | --- | :---: | --- |
| | --rpc &lt;rpcUrl&gt; | RPC URL for the network | No | |
| | --fees &lt;json&gt; | Transaction fee options JSON passed to genlayer-js. | No | |
| | --fee-value &lt;wei&gt; | Fee deposit value to send with the transaction | No | |
| | --valid-until &lt;unixTimestamp&gt; | Unix timestamp after which the transaction is invalid | No | |
| -h | --help | display help for command | No | |
25 changes: 25 additions & 0 deletions docs/api-references/estimate-fees.mdx
Original file line number Diff line number Diff line change
@@ -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 &lt;rpcUrl&gt; | RPC URL for the network | No | |
| | --fees &lt;json&gt; | 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 | |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include variadic --args in estimate-fees docs

When users run estimate-fees in simulation mode for a contract method that takes arguments, the CLI accepts --args <args...> (src/commands/contracts/index.ts:163-168), but this newly added options table omits that option and only documents --rpc, --fees, --json, and --include-report. This leaves the generated reference incomplete for the main case where [contractAddress] [method] needs calldata arguments.

Useful? React with 👍 / 👎.

| -h | --help | display help for command | No | |
20 changes: 20 additions & 0 deletions docs/api-references/finalize-batch.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: finalize-batch
---

Finalize a batch of idle transactions in a single call (public call)

### Usage

`$ genlayer finalize-batch [options] <txIds...>`

### Arguments

- `<txIds...>`

### Options

| Short | Long | Description | Required | Default |
| --- | --- | --- | :---: | --- |
| | --rpc &lt;rpcUrl&gt; | RPC URL for the network | No | |
| -h | --help | display help for command | No | |
20 changes: 20 additions & 0 deletions docs/api-references/finalize.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: finalize
---

Finalize a transaction that is ready to be finalized (public call)

### Usage

`$ genlayer finalize [options] <txId>`

### Arguments

- `<txId>`

### Options

| Short | Long | Description | Required | Default |
| --- | --- | --- | :---: | --- |
| | --rpc &lt;rpcUrl&gt; | RPC URL for the network | No | |
| -h | --help | display help for command | No | |
5 changes: 4 additions & 1 deletion docs/api-references/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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

---
Expand Down
2 changes: 1 addition & 1 deletion docs/api-references/transactions/receipt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Get transaction receipt by hash

| Short | Long | Description | Required | Default |
| --- | --- | --- | :---: | --- |
| | --status &lt;status&gt; | 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 &lt;status&gt; | 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 &lt;retries&gt; | Number of retries | No | `100` |
| | --interval &lt;interval&gt; | Interval between retries in milliseconds (default: 5000) | No | |
| | --rpc &lt;rpcUrl&gt; | RPC URL for the network | No | |
Expand Down
10 changes: 9 additions & 1 deletion scripts/generate-cli-docs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading