genlayer 0.38.9 → 0.38.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.github/workflows/cli-docs.yml +124 -0
- package/.github/workflows/publish.yml +55 -0
- package/.github/workflows/smoke.yml +27 -0
- package/.github/workflows/validate-code.yml +51 -0
- package/.prettierignore +19 -0
- package/.prettierrc +12 -0
- package/.release-it.json +66 -0
- package/CHANGELOG.md +551 -0
- package/CLAUDE.md +55 -0
- package/CONTRIBUTING.md +117 -0
- package/dist/index.js +234 -65
- package/docs/api-references/_meta.json +9 -0
- package/docs/api-references/accounts/_meta.json +3 -0
- package/docs/api-references/accounts/account/create.mdx +19 -0
- package/docs/api-references/accounts/account/export.mdx +19 -0
- package/docs/api-references/accounts/account/import.mdx +22 -0
- package/docs/api-references/accounts/account/list.mdx +15 -0
- package/docs/api-references/accounts/account/lock.mdx +16 -0
- package/docs/api-references/accounts/account/remove.mdx +20 -0
- package/docs/api-references/accounts/account/send.mdx +24 -0
- package/docs/api-references/accounts/account/show.mdx +17 -0
- package/docs/api-references/accounts/account/unlock.mdx +17 -0
- package/docs/api-references/accounts/account/use.mdx +19 -0
- package/docs/api-references/accounts/account.mdx +32 -0
- package/docs/api-references/configuration/_meta.json +4 -0
- package/docs/api-references/configuration/config/get.mdx +21 -0
- package/docs/api-references/configuration/config/reset.mdx +21 -0
- package/docs/api-references/configuration/config/set.mdx +21 -0
- package/docs/api-references/configuration/config.mdx +25 -0
- package/docs/api-references/configuration/network/info.mdx +15 -0
- package/docs/api-references/configuration/network/list.mdx +15 -0
- package/docs/api-references/configuration/network/set.mdx +21 -0
- package/docs/api-references/configuration/network.mdx +25 -0
- package/docs/api-references/contracts/_meta.json +7 -0
- package/docs/api-references/contracts/call.mdx +21 -0
- package/docs/api-references/contracts/code.mdx +20 -0
- package/docs/api-references/contracts/deploy.mdx +17 -0
- package/docs/api-references/contracts/schema.mdx +20 -0
- package/docs/api-references/contracts/write.mdx +21 -0
- package/docs/api-references/environment/_meta.json +7 -0
- package/docs/api-references/environment/init.mdx +20 -0
- package/docs/api-references/environment/new.mdx +21 -0
- package/docs/api-references/environment/stop.mdx +15 -0
- package/docs/api-references/environment/up.mdx +20 -0
- package/docs/api-references/environment/update/ollama.mdx +16 -0
- package/docs/api-references/environment/update.mdx +23 -0
- package/docs/api-references/index.mdx +35 -0
- package/docs/api-references/localnet/_meta.json +3 -0
- package/docs/api-references/localnet/localnet/validators/count.mdx +15 -0
- package/docs/api-references/localnet/localnet/validators/create-random.mdx +16 -0
- package/docs/api-references/localnet/localnet/validators/create.mdx +19 -0
- package/docs/api-references/localnet/localnet/validators/delete.mdx +16 -0
- package/docs/api-references/localnet/localnet/validators/get.mdx +16 -0
- package/docs/api-references/localnet/localnet/validators/update.mdx +23 -0
- package/docs/api-references/localnet/localnet/validators.mdx +28 -0
- package/docs/api-references/localnet/localnet.mdx +23 -0
- package/docs/api-references/staking/_meta.json +3 -0
- package/docs/api-references/staking/staking/active-validators.mdx +18 -0
- package/docs/api-references/staking/staking/banned-validators.mdx +18 -0
- package/docs/api-references/staking/staking/delegation-info.mdx +25 -0
- package/docs/api-references/staking/staking/delegator-claim.mdx +26 -0
- package/docs/api-references/staking/staking/delegator-exit.mdx +26 -0
- package/docs/api-references/staking/staking/delegator-join.mdx +26 -0
- package/docs/api-references/staking/staking/epoch-info.mdx +19 -0
- package/docs/api-references/staking/staking/prime-all.mdx +20 -0
- package/docs/api-references/staking/staking/quarantined-validators.mdx +18 -0
- package/docs/api-references/staking/staking/set-identity.mdx +33 -0
- package/docs/api-references/staking/staking/set-operator.mdx +26 -0
- package/docs/api-references/staking/staking/validator-claim.mdx +24 -0
- package/docs/api-references/staking/staking/validator-deposit.mdx +25 -0
- package/docs/api-references/staking/staking/validator-exit.mdx +25 -0
- package/docs/api-references/staking/staking/validator-history.mdx +29 -0
- package/docs/api-references/staking/staking/validator-info.mdx +25 -0
- package/docs/api-references/staking/staking/validator-join.mdx +22 -0
- package/docs/api-references/staking/staking/validator-prime.mdx +25 -0
- package/docs/api-references/staking/staking/validators.mdx +19 -0
- package/docs/api-references/staking/staking/wizard.mdx +20 -0
- package/docs/api-references/staking/staking.mdx +42 -0
- package/docs/api-references/transactions/_meta.json +6 -0
- package/docs/api-references/transactions/appeal-bond.mdx +20 -0
- package/docs/api-references/transactions/appeal.mdx +21 -0
- package/docs/api-references/transactions/receipt.mdx +25 -0
- package/docs/api-references/transactions/trace.mdx +21 -0
- package/docs/delegator-guide.md +203 -0
- package/docs/validator-guide.md +329 -0
- package/esbuild.config.dev.js +17 -0
- package/esbuild.config.js +22 -0
- package/esbuild.config.prod.js +17 -0
- package/eslint.config.js +60 -0
- package/package.json +2 -11
- package/renovate.json +22 -0
- package/scripts/generate-cli-docs.mjs +68 -5
- package/src/commands/account/create.ts +30 -0
- package/src/commands/account/export.ts +106 -0
- package/src/commands/account/import.ts +135 -0
- package/src/commands/account/index.ts +129 -0
- package/src/commands/account/list.ts +34 -0
- package/src/commands/account/lock.ts +39 -0
- package/src/commands/account/remove.ts +30 -0
- package/src/commands/account/send.ts +162 -0
- package/src/commands/account/show.ts +74 -0
- package/src/commands/account/unlock.ts +56 -0
- package/src/commands/account/use.ts +21 -0
- package/src/commands/config/getSetReset.ts +51 -0
- package/src/commands/config/index.ts +30 -0
- package/src/commands/contracts/call.ts +39 -0
- package/src/commands/contracts/code.ts +33 -0
- package/src/commands/contracts/deploy.ts +161 -0
- package/src/commands/contracts/index.ts +150 -0
- package/src/commands/contracts/schema.ts +31 -0
- package/src/commands/contracts/write.ts +49 -0
- package/src/commands/general/index.ts +45 -0
- package/src/commands/general/init.ts +180 -0
- package/src/commands/general/start.ts +128 -0
- package/src/commands/general/stop.ts +26 -0
- package/src/commands/localnet/index.ts +100 -0
- package/src/commands/localnet/validators.ts +269 -0
- package/src/commands/network/index.ts +29 -0
- package/src/commands/network/setNetwork.ts +77 -0
- package/src/commands/scaffold/index.ts +16 -0
- package/src/commands/scaffold/new.ts +34 -0
- package/src/commands/staking/StakingAction.ts +292 -0
- package/src/commands/staking/delegatorClaim.ts +41 -0
- package/src/commands/staking/delegatorExit.ts +56 -0
- package/src/commands/staking/delegatorJoin.ts +44 -0
- package/src/commands/staking/index.ts +357 -0
- package/src/commands/staking/setIdentity.ts +78 -0
- package/src/commands/staking/setOperator.ts +46 -0
- package/src/commands/staking/stakingInfo.ts +584 -0
- package/src/commands/staking/validatorClaim.ts +43 -0
- package/src/commands/staking/validatorDeposit.ts +48 -0
- package/src/commands/staking/validatorExit.ts +63 -0
- package/src/commands/staking/validatorHistory.ts +300 -0
- package/src/commands/staking/validatorJoin.ts +47 -0
- package/src/commands/staking/validatorPrime.ts +73 -0
- package/src/commands/staking/wizard.ts +809 -0
- package/src/commands/transactions/appeal.ts +83 -0
- package/src/commands/transactions/index.ts +60 -0
- package/src/commands/transactions/receipt.ts +90 -0
- package/src/commands/transactions/trace.ts +42 -0
- package/src/commands/update/index.ts +25 -0
- package/src/commands/update/ollama.ts +103 -0
- package/src/lib/actions/BaseAction.ts +301 -0
- package/src/lib/clients/jsonRpcClient.ts +41 -0
- package/src/lib/clients/system.ts +73 -0
- package/src/lib/config/ConfigFileManager.ts +194 -0
- package/src/lib/config/KeychainManager.ts +89 -0
- package/src/lib/config/simulator.ts +68 -0
- package/src/lib/config/text.ts +2 -0
- package/src/lib/errors/missingRequirement.ts +9 -0
- package/src/lib/errors/versionRequired.ts +9 -0
- package/src/lib/interfaces/ISimulatorService.ts +39 -0
- package/src/lib/services/simulator.ts +386 -0
- package/src/types/node-fetch.d.ts +1 -0
- package/tests/actions/appeal.test.ts +141 -0
- package/tests/actions/call.test.ts +94 -0
- package/tests/actions/code.test.ts +87 -0
- package/tests/actions/create.test.ts +65 -0
- package/tests/actions/deploy.test.ts +420 -0
- package/tests/actions/getSetReset.test.ts +88 -0
- package/tests/actions/init.test.ts +483 -0
- package/tests/actions/lock.test.ts +86 -0
- package/tests/actions/new.test.ts +80 -0
- package/tests/actions/ollama.test.ts +193 -0
- package/tests/actions/receipt.test.ts +261 -0
- package/tests/actions/schema.test.ts +94 -0
- package/tests/actions/setNetwork.test.ts +161 -0
- package/tests/actions/staking.test.ts +280 -0
- package/tests/actions/start.test.ts +257 -0
- package/tests/actions/stop.test.ts +77 -0
- package/tests/actions/unlock.test.ts +139 -0
- package/tests/actions/validators.test.ts +750 -0
- package/tests/actions/write.test.ts +102 -0
- package/tests/commands/account.test.ts +146 -0
- package/tests/commands/appeal.test.ts +97 -0
- package/tests/commands/call.test.ts +78 -0
- package/tests/commands/code.test.ts +69 -0
- package/tests/commands/config.test.ts +54 -0
- package/tests/commands/deploy.test.ts +83 -0
- package/tests/commands/init.test.ts +101 -0
- package/tests/commands/localnet.test.ts +131 -0
- package/tests/commands/network.test.ts +60 -0
- package/tests/commands/new.test.ts +68 -0
- package/tests/commands/parseArg.test.ts +156 -0
- package/tests/commands/receipt.test.ts +142 -0
- package/tests/commands/schema.test.ts +67 -0
- package/tests/commands/staking.test.ts +329 -0
- package/tests/commands/stop.test.ts +27 -0
- package/tests/commands/up.test.ts +105 -0
- package/tests/commands/update.test.ts +45 -0
- package/tests/commands/write.test.ts +76 -0
- package/tests/index.test.ts +56 -0
- package/tests/libs/baseAction.test.ts +535 -0
- package/tests/libs/configFileManager.test.ts +118 -0
- package/tests/libs/jsonRpcClient.test.ts +59 -0
- package/tests/libs/keychainManager.test.ts +156 -0
- package/tests/libs/platformCommands.test.ts +78 -0
- package/tests/libs/system.test.ts +148 -0
- package/tests/services/simulator.test.ts +789 -0
- package/tests/smoke.test.ts +134 -0
- package/tests/utils.ts +13 -0
- package/tsconfig.json +120 -0
- package/vitest.config.ts +13 -0
- package/vitest.smoke.config.ts +17 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: staking validators
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Show validator set with stake, status, and voting power
|
|
6
|
+
|
|
7
|
+
### Usage
|
|
8
|
+
|
|
9
|
+
`$ genlayer staking validators [options]`
|
|
10
|
+
|
|
11
|
+
### Options
|
|
12
|
+
|
|
13
|
+
| Short | Long | Description | Required | Default |
|
|
14
|
+
| --- | --- | --- | :---: | --- |
|
|
15
|
+
| | --all | Include banned validators | No | |
|
|
16
|
+
| | --network <network> | Network to use (localnet, testnet-asimov) | No | |
|
|
17
|
+
| | --rpc <rpcUrl> | RPC URL for the network | No | |
|
|
18
|
+
| | --staking-address <address> | Staking contract address (overrides chain config) | No | |
|
|
19
|
+
| -h | --help | display help for command | No | |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: staking wizard
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Interactive wizard to become a validator
|
|
6
|
+
|
|
7
|
+
### Usage
|
|
8
|
+
|
|
9
|
+
`$ genlayer staking wizard [options]`
|
|
10
|
+
|
|
11
|
+
### Options
|
|
12
|
+
|
|
13
|
+
| Short | Long | Description | Required | Default |
|
|
14
|
+
| --- | --- | --- | :---: | --- |
|
|
15
|
+
| | --account <name> | Account to use (skip selection) | No | |
|
|
16
|
+
| | --network <network> | Network to use (skip selection) | No | |
|
|
17
|
+
| | --skip-identity | Skip identity setup step | No | |
|
|
18
|
+
| | --rpc <rpcUrl> | RPC URL for the network | No | |
|
|
19
|
+
| | --staking-address <address> | Staking contract address (overrides chain config) | No | |
|
|
20
|
+
| -h | --help | display help for command | No | |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: staking
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Staking operations for validators and delegators
|
|
6
|
+
|
|
7
|
+
### Usage
|
|
8
|
+
|
|
9
|
+
`$ genlayer staking [options] [command]`
|
|
10
|
+
|
|
11
|
+
### Arguments
|
|
12
|
+
|
|
13
|
+
- `[command]`
|
|
14
|
+
|
|
15
|
+
### Options
|
|
16
|
+
|
|
17
|
+
| Short | Long | Description | Required | Default |
|
|
18
|
+
| --- | --- | --- | :---: | --- |
|
|
19
|
+
| -h | --help | display help for command | No | |
|
|
20
|
+
|
|
21
|
+
### Subcommands
|
|
22
|
+
|
|
23
|
+
- `genlayer wizard` — Interactive wizard to become a validator
|
|
24
|
+
- `genlayer validator-join` — Join as a validator by staking tokens
|
|
25
|
+
- `genlayer validator-deposit` — Make an additional deposit to a validator wallet
|
|
26
|
+
- `genlayer validator-exit` — Exit as a validator by withdrawing shares
|
|
27
|
+
- `genlayer validator-claim` — Claim validator withdrawals after unbonding period
|
|
28
|
+
- `genlayer validator-prime` — Prime a validator to prepare their stake record for the next epoch
|
|
29
|
+
- `genlayer prime-all` — Prime all validators that need priming
|
|
30
|
+
- `genlayer set-operator` — Change the operator address for a validator wallet
|
|
31
|
+
- `genlayer set-identity` — Set validator identity metadata (moniker, website, socials, etc.)
|
|
32
|
+
- `genlayer delegator-join` — Join as a delegator by staking with a validator
|
|
33
|
+
- `genlayer delegator-exit` — Exit as a delegator by withdrawing shares from a validator
|
|
34
|
+
- `genlayer delegator-claim` — Claim delegator withdrawals after unbonding period
|
|
35
|
+
- `genlayer validator-info` — Get information about a validator
|
|
36
|
+
- `genlayer delegation-info` — Get delegation info for a delegator with a validator
|
|
37
|
+
- `genlayer epoch-info` — Get current epoch and staking parameters
|
|
38
|
+
- `genlayer active-validators` — List all active validators
|
|
39
|
+
- `genlayer quarantined-validators` — List all quarantined validators
|
|
40
|
+
- `genlayer banned-validators` — List all banned validators
|
|
41
|
+
- `genlayer validators` — Show validator set with stake, status, and voting power
|
|
42
|
+
- `genlayer validator-history` — Show slash and reward history for a validator (default: last 10 epochs)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: appeal-bond
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Show minimum appeal bond required for a transaction
|
|
6
|
+
|
|
7
|
+
### Usage
|
|
8
|
+
|
|
9
|
+
`$ genlayer appeal-bond [options] <txId>`
|
|
10
|
+
|
|
11
|
+
### Arguments
|
|
12
|
+
|
|
13
|
+
- `<txId>`
|
|
14
|
+
|
|
15
|
+
### Options
|
|
16
|
+
|
|
17
|
+
| Short | Long | Description | Required | Default |
|
|
18
|
+
| --- | --- | --- | :---: | --- |
|
|
19
|
+
| | --rpc <rpcUrl> | RPC URL for the network | No | |
|
|
20
|
+
| -h | --help | display help for command | No | |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: appeal
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Appeal a transaction by its hash
|
|
6
|
+
|
|
7
|
+
### Usage
|
|
8
|
+
|
|
9
|
+
`$ genlayer appeal [options] <txId>`
|
|
10
|
+
|
|
11
|
+
### Arguments
|
|
12
|
+
|
|
13
|
+
- `<txId>`
|
|
14
|
+
|
|
15
|
+
### Options
|
|
16
|
+
|
|
17
|
+
| Short | Long | Description | Required | Default |
|
|
18
|
+
| --- | --- | --- | :---: | --- |
|
|
19
|
+
| | --bond <amount> | Appeal bond amount (e.g. 500gen, 0.5gen). Auto-calculated if omitted | No | |
|
|
20
|
+
| | --rpc <rpcUrl> | RPC URL for the network | No | |
|
|
21
|
+
| -h | --help | display help for command | No | |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: receipt
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Get transaction receipt by hash
|
|
6
|
+
|
|
7
|
+
### Usage
|
|
8
|
+
|
|
9
|
+
`$ genlayer receipt [options] <txId>`
|
|
10
|
+
|
|
11
|
+
### Arguments
|
|
12
|
+
|
|
13
|
+
- `<txId>`
|
|
14
|
+
|
|
15
|
+
### Options
|
|
16
|
+
|
|
17
|
+
| Short | Long | Description | Required | Default |
|
|
18
|
+
| --- | --- | --- | :---: | --- |
|
|
19
|
+
| | --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 | |
|
|
20
|
+
| | --retries <retries> | Number of retries | No | `100` |
|
|
21
|
+
| | --interval <interval> | Interval between retries in milliseconds (default: 5000) | No | |
|
|
22
|
+
| | --rpc <rpcUrl> | RPC URL for the network | No | |
|
|
23
|
+
| | --stdout | Print only stdout from the receipt | No | |
|
|
24
|
+
| | --stderr | Print only stderr from the receipt | No | |
|
|
25
|
+
| -h | --help | display help for command | No | |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: trace
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Get execution trace for a transaction (return data, stdout, stderr, GenVM logs)
|
|
6
|
+
|
|
7
|
+
### Usage
|
|
8
|
+
|
|
9
|
+
`$ genlayer trace [options] <txId>`
|
|
10
|
+
|
|
11
|
+
### Arguments
|
|
12
|
+
|
|
13
|
+
- `<txId>`
|
|
14
|
+
|
|
15
|
+
### Options
|
|
16
|
+
|
|
17
|
+
| Short | Long | Description | Required | Default |
|
|
18
|
+
| --- | --- | --- | :---: | --- |
|
|
19
|
+
| | --round <round> | Consensus round number | No | `0) (default: 0` |
|
|
20
|
+
| | --rpc <rpcUrl> | RPC URL for the network | No | |
|
|
21
|
+
| -h | --help | display help for command | No | |
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Delegator Guide
|
|
2
|
+
|
|
3
|
+
This guide walks you through delegating GEN tokens to a validator on the GenLayer testnet.
|
|
4
|
+
|
|
5
|
+
## What is Delegation?
|
|
6
|
+
|
|
7
|
+
Delegation allows you to stake your GEN tokens with an existing validator without running validator infrastructure yourself. You earn staking rewards proportional to your stake.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- Node.js installed
|
|
12
|
+
- GenLayer CLI installed (`npm install -g genlayer`)
|
|
13
|
+
- GEN tokens for staking
|
|
14
|
+
|
|
15
|
+
## Step 1: Create an Account
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
genlayer account create
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
You'll be prompted to set a password. This creates an encrypted keystore file.
|
|
22
|
+
|
|
23
|
+
## Step 2: Set Network to Testnet
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
genlayer network testnet-bradbury
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Step 3: Fund Your Account
|
|
30
|
+
|
|
31
|
+
Transfer GEN tokens to your address. Check your balance:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
genlayer account
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Step 4: Check Minimum Delegation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
genlayer staking epoch-info
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Note the `delegatorMinStake` - you need at least this amount.
|
|
44
|
+
|
|
45
|
+
## Step 5: Find a Validator
|
|
46
|
+
|
|
47
|
+
List all active validators:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
genlayer staking active-validators
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Output:
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
count: 6,
|
|
57
|
+
validators: [
|
|
58
|
+
'0xa8f1BF1e5e709593b4468d7ac5DC315Ea3CAe130',
|
|
59
|
+
'0xe9246A020cbb4fC6C46e60677981879c9219e8B9',
|
|
60
|
+
...
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Get details about a specific validator:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
genlayer staking validator-info --validator 0xa8f1BF1e5e709593b4468d7ac5DC315Ea3CAe130
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Look for:
|
|
72
|
+
- `live: true` - Validator is active
|
|
73
|
+
- `banned: 'Not banned'` - Validator is in good standing
|
|
74
|
+
- `identity` - Validator's metadata (moniker, website, etc.)
|
|
75
|
+
|
|
76
|
+
## Step 6: Unlock Your Account (Optional)
|
|
77
|
+
|
|
78
|
+
For convenience:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
genlayer account unlock
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Step 7: Delegate to a Validator
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
genlayer staking delegator-join --validator 0xa8f1...130 --amount 100gen
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Options:
|
|
91
|
+
- `--validator <address>` - Validator address to delegate to (required)
|
|
92
|
+
- `--amount <amount>` - Amount to stake (e.g., `100gen`)
|
|
93
|
+
|
|
94
|
+
## Step 8: Verify Your Delegation
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
genlayer staking delegation-info --validator 0xa8f1...130
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Output:
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
delegator: '0x86D0d159483CBf01E920ECfF8bB7F0Cd7E964E7E',
|
|
104
|
+
validator: '0xa8f1BF1e5e709593b4468d7ac5DC315Ea3CAe130',
|
|
105
|
+
shares: '100000000000000000000',
|
|
106
|
+
stake: '100 GEN',
|
|
107
|
+
projectedReward: '0.2 GEN per epoch',
|
|
108
|
+
pendingDeposits: 'None',
|
|
109
|
+
pendingWithdrawals: 'None'
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The `projectedReward` shows your estimated earnings per epoch based on current inflation and your stake weight.
|
|
114
|
+
|
|
115
|
+
## Managing Your Delegation
|
|
116
|
+
|
|
117
|
+
### Check Your Stake
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
genlayer staking delegation-info --validator 0xa8f1...130
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Withdraw (Exit) Delegation
|
|
124
|
+
|
|
125
|
+
To withdraw your stake:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
genlayer staking delegator-exit --validator 0xa8f1...130 --shares 50
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Options:
|
|
132
|
+
- `--validator <address>` - Validator you delegated to
|
|
133
|
+
- `--shares <shares>` - Number of shares to withdraw
|
|
134
|
+
|
|
135
|
+
This initiates a withdrawal. Your tokens enter an **unbonding period of 7 epochs** before they can be claimed.
|
|
136
|
+
|
|
137
|
+
Check your pending withdrawals with `delegation-info`:
|
|
138
|
+
```json
|
|
139
|
+
pendingWithdrawals: [
|
|
140
|
+
{
|
|
141
|
+
epoch: '5',
|
|
142
|
+
shares: '50',
|
|
143
|
+
stake: '50 GEN',
|
|
144
|
+
claimableAtEpoch: '12',
|
|
145
|
+
status: 'Unbonding (4 epochs remaining)'
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Claim Withdrawals
|
|
151
|
+
|
|
152
|
+
After the 7-epoch unbonding period, claim your tokens:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
genlayer staking delegator-claim --validator 0xa8f1...130
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Choosing a Validator
|
|
159
|
+
|
|
160
|
+
Consider these factors when choosing a validator:
|
|
161
|
+
|
|
162
|
+
1. **Uptime** - Validators with high uptime earn more rewards
|
|
163
|
+
2. **Reputation** - Check their identity metadata and community presence
|
|
164
|
+
3. **Stake** - Higher stake may indicate trust from the community
|
|
165
|
+
4. **Not banned/quarantined** - Avoid validators with issues
|
|
166
|
+
|
|
167
|
+
Check quarantined validators:
|
|
168
|
+
```bash
|
|
169
|
+
genlayer staking quarantined-validators
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Check banned validators:
|
|
173
|
+
```bash
|
|
174
|
+
genlayer staking banned-validators
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Troubleshooting
|
|
178
|
+
|
|
179
|
+
### "No account found"
|
|
180
|
+
Run `genlayer account create` first.
|
|
181
|
+
|
|
182
|
+
### "Insufficient balance"
|
|
183
|
+
Ensure you have enough GEN. Check with `genlayer account`.
|
|
184
|
+
|
|
185
|
+
### "Below minimum stake"
|
|
186
|
+
Check minimum with `genlayer staking epoch-info` and increase your amount.
|
|
187
|
+
|
|
188
|
+
### "Validator not found"
|
|
189
|
+
Verify the validator address is correct and they are still active.
|
|
190
|
+
|
|
191
|
+
### Transaction Stuck
|
|
192
|
+
Check the transaction status:
|
|
193
|
+
```bash
|
|
194
|
+
genlayer receipt <tx-hash>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Lock Your Account
|
|
198
|
+
|
|
199
|
+
When done, lock your account:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
genlayer account lock
|
|
203
|
+
```
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# Validator Guide
|
|
2
|
+
|
|
3
|
+
This guide walks you through becoming a validator on the GenLayer testnet using the CLI.
|
|
4
|
+
|
|
5
|
+
For a deeper understanding of how staking works in GenLayer, see the [Staking documentation](/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking).
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js installed
|
|
10
|
+
- GenLayer CLI installed (`npm install -g genlayer`)
|
|
11
|
+
- GEN tokens for staking (minimum stake required)
|
|
12
|
+
|
|
13
|
+
## Quick Start: Validator Wizard
|
|
14
|
+
|
|
15
|
+
The easiest way to become a validator is using the interactive wizard:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
genlayer staking wizard
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The wizard guides you through all steps:
|
|
22
|
+
1. Account setup (create or select)
|
|
23
|
+
2. Network selection
|
|
24
|
+
3. Balance verification
|
|
25
|
+
4. Operator setup (optional, recommended for security)
|
|
26
|
+
5. Stake amount selection
|
|
27
|
+
6. Validator creation
|
|
28
|
+
7. Identity setup (moniker, website, etc.)
|
|
29
|
+
|
|
30
|
+
If you prefer manual setup, follow the steps below.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Manual Setup
|
|
35
|
+
|
|
36
|
+
## Step 1: Create an Owner Account
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
genlayer account create --name owner
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You'll be prompted to set a password. This creates an encrypted keystore file in standard web3 format.
|
|
43
|
+
|
|
44
|
+
The owner account holds your staked funds and controls the validator. Keep it secure.
|
|
45
|
+
|
|
46
|
+
## Step 2: View Your Account
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
genlayer account show
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Output:
|
|
53
|
+
```
|
|
54
|
+
{
|
|
55
|
+
name: 'owner',
|
|
56
|
+
address: '0x86D0d159483CBf01E920ECfF8bB7F0Cd7E964E7E',
|
|
57
|
+
balance: '0 GEN',
|
|
58
|
+
network: 'localnet',
|
|
59
|
+
status: 'locked',
|
|
60
|
+
active: true
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Step 3: Set Network to Testnet
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
genlayer network testnet-bradbury
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Verify with:
|
|
71
|
+
```bash
|
|
72
|
+
genlayer account show
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
You should see `network: 'Bradbury Testnet'`.
|
|
76
|
+
|
|
77
|
+
## Step 4: Fund Your Account
|
|
78
|
+
|
|
79
|
+
Transfer GEN tokens to your address:
|
|
80
|
+
- Use the faucet (if available)
|
|
81
|
+
- Transfer from another funded account using `genlayer account send`
|
|
82
|
+
|
|
83
|
+
## Step 5: Check Staking Requirements
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
genlayer staking epoch-info
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Output:
|
|
90
|
+
```
|
|
91
|
+
✔ Epoch info
|
|
92
|
+
|
|
93
|
+
Current Epoch: 5 (started 9h 30m ago)
|
|
94
|
+
Next Epoch: in 14h 30m
|
|
95
|
+
Validators: 33
|
|
96
|
+
Weight: 6061746783417938774454
|
|
97
|
+
Slashed: 0 GEN
|
|
98
|
+
|
|
99
|
+
Previous Epoch: 4 (finalized)
|
|
100
|
+
Inflation: 1732904.66 GEN
|
|
101
|
+
Claimed: 0 GEN
|
|
102
|
+
Unclaimed: 1732904.66 GEN
|
|
103
|
+
Slashed: 0 GEN
|
|
104
|
+
|
|
105
|
+
Min Epoch Duration: 24h 0m
|
|
106
|
+
Validator Min Stake: 42000 GEN
|
|
107
|
+
Delegator Min Stake: 42 GEN
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
You can also query a specific epoch:
|
|
111
|
+
```bash
|
|
112
|
+
genlayer staking epoch-info --epoch 4
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Note the `validatorMinStake` - you need at least this amount.
|
|
116
|
+
|
|
117
|
+
## Step 6: Unlock Your Account (Optional)
|
|
118
|
+
|
|
119
|
+
For convenience, unlock your account to avoid entering password repeatedly:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
genlayer account unlock
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
This caches your private key in the OS keychain.
|
|
126
|
+
|
|
127
|
+
## Step 7: Join as Validator
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
genlayer staking validator-join --amount 42000gen --operator 0xOperator...
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Options:
|
|
134
|
+
- `--amount <amount>` - Stake amount (e.g., `42000gen` or `42000`)
|
|
135
|
+
- `--operator <address>` - Operator address (recommended, see below)
|
|
136
|
+
|
|
137
|
+
### Why Use an Operator Address?
|
|
138
|
+
|
|
139
|
+
**Recommended:** Use a separate operator address for security.
|
|
140
|
+
|
|
141
|
+
- **Validator wallet** - Holds your staked funds (keep offline/cold)
|
|
142
|
+
- **Operator wallet** - Signs blocks and performs validator duties (hot wallet on server)
|
|
143
|
+
|
|
144
|
+
This way, if your operator server is compromised, your staked funds remain safe.
|
|
145
|
+
|
|
146
|
+
If you already have an operator wallet (e.g., from geth, foundry, or another tool), you can use its address directly. Otherwise, create one:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Create operator account (skip if you already have one)
|
|
150
|
+
genlayer account create --name operator
|
|
151
|
+
|
|
152
|
+
# View operator address
|
|
153
|
+
genlayer account show --account operator
|
|
154
|
+
# Address: 0xOperator123...
|
|
155
|
+
|
|
156
|
+
# Export keystore for validator node software (standard web3 format)
|
|
157
|
+
genlayer account export --account operator --output ./operator-keystore.json
|
|
158
|
+
|
|
159
|
+
# Join as validator with separate operator
|
|
160
|
+
genlayer staking validator-join --amount 42000gen --operator 0xOperator123...
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Transfer `operator-keystore.json` to your validator server and import it into your validator node software. The keystore is in standard web3 format, compatible with geth, foundry, and other Ethereum tools.
|
|
164
|
+
|
|
165
|
+
You can change the operator later:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
genlayer staking set-operator --validator 0xYourValidator... --operator 0xNewOperator...
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Step 8: Verify Your Validator Status
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
genlayer staking validator-info
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Output:
|
|
178
|
+
```
|
|
179
|
+
{
|
|
180
|
+
validator: '0x86D0d159483CBf01E920ECfF8bB7F0Cd7E964E7E',
|
|
181
|
+
vStake: '42000 GEN',
|
|
182
|
+
vShares: '42000000000000000000000',
|
|
183
|
+
live: true,
|
|
184
|
+
banned: 'Not banned',
|
|
185
|
+
...
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Step 9: Set Validator Identity (Metadata)
|
|
190
|
+
|
|
191
|
+
Set your validator's public identity so delegators can find you:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
genlayer staking set-identity \
|
|
195
|
+
--validator 0x86D0...7E \
|
|
196
|
+
--moniker "My Validator" \
|
|
197
|
+
--website "https://myvalidator.com" \
|
|
198
|
+
--description "Reliable validator with 99.9% uptime" \
|
|
199
|
+
--twitter "myvalidator" \
|
|
200
|
+
--github "myvalidator"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Required:**
|
|
204
|
+
- `--validator <address>` - Your validator address
|
|
205
|
+
- `--moniker <name>` - Display name for your validator
|
|
206
|
+
|
|
207
|
+
**Optional:**
|
|
208
|
+
- `--logo-uri <uri>` - Logo image URL
|
|
209
|
+
- `--website <url>` - Website URL
|
|
210
|
+
- `--description <text>` - Description of your validator
|
|
211
|
+
- `--email <email>` - Contact email
|
|
212
|
+
- `--twitter <handle>` - Twitter handle
|
|
213
|
+
- `--telegram <handle>` - Telegram handle
|
|
214
|
+
- `--github <handle>` - GitHub handle
|
|
215
|
+
- `--extra-cid <cid>` - Additional data as IPFS CID
|
|
216
|
+
|
|
217
|
+
Your identity will show in `validator-info`:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
genlayer staking validator-info
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Output will include:
|
|
224
|
+
```
|
|
225
|
+
{
|
|
226
|
+
...
|
|
227
|
+
identity: {
|
|
228
|
+
moniker: 'My Validator',
|
|
229
|
+
website: 'https://myvalidator.com',
|
|
230
|
+
twitter: 'myvalidator',
|
|
231
|
+
github: 'myvalidator'
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Managing Your Validator
|
|
237
|
+
|
|
238
|
+
### Priming Your Validator
|
|
239
|
+
|
|
240
|
+
Validators must be "primed" each epoch to participate in consensus. Priming updates the validator's stake record for the upcoming epoch.
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Prime your validator
|
|
244
|
+
genlayer staking validator-prime 0xYourValidator...
|
|
245
|
+
|
|
246
|
+
# Or prime all validators at once (anyone can do this)
|
|
247
|
+
genlayer staking prime-all
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
The `validators` command shows priming status:
|
|
251
|
+
- **Green** `e11` - Primed for current epoch
|
|
252
|
+
- **Yellow** `e10` - Needs priming before next epoch
|
|
253
|
+
- **Red** `e9!` - Urgently needs priming (behind)
|
|
254
|
+
|
|
255
|
+
### Add More Stake
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
genlayer staking validator-deposit --validator 0xYourValidatorWallet... --amount 1000gen
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Check Active Validators
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
genlayer staking active-validators
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### View Validator Set
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Show all validators with stake, primed status, and weight
|
|
271
|
+
genlayer staking validators
|
|
272
|
+
|
|
273
|
+
# Include banned validators
|
|
274
|
+
genlayer staking validators --all
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Exit as Validator
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
genlayer staking validator-exit --validator 0xYourValidatorWallet... --shares 100
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
This initiates a withdrawal. Your tokens enter an **unbonding period of 7 epochs** before they can be claimed.
|
|
284
|
+
|
|
285
|
+
Check your pending withdrawals with `validator-info`:
|
|
286
|
+
```
|
|
287
|
+
selfStakePendingWithdrawals: [
|
|
288
|
+
{
|
|
289
|
+
epoch: '5',
|
|
290
|
+
shares: '100',
|
|
291
|
+
stake: '100 GEN',
|
|
292
|
+
claimableAtEpoch: '12',
|
|
293
|
+
status: 'Unbonding (4 epochs remaining)'
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Claim Withdrawals
|
|
299
|
+
|
|
300
|
+
After the 7-epoch unbonding period:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
genlayer staking validator-claim --validator 0xYourValidatorWallet...
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Troubleshooting
|
|
307
|
+
|
|
308
|
+
### "No account found"
|
|
309
|
+
Run `genlayer account create` first.
|
|
310
|
+
|
|
311
|
+
### "Insufficient balance"
|
|
312
|
+
Ensure you have enough GEN. Check with `genlayer account show`.
|
|
313
|
+
|
|
314
|
+
### "Below minimum stake"
|
|
315
|
+
Check minimum with `genlayer staking epoch-info` and increase your stake amount.
|
|
316
|
+
|
|
317
|
+
### Transaction Stuck
|
|
318
|
+
Check the transaction status:
|
|
319
|
+
```bash
|
|
320
|
+
genlayer receipt <tx-hash>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Lock Your Account
|
|
324
|
+
|
|
325
|
+
When done, lock your account to remove the cached private key:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
genlayer account lock
|
|
329
|
+
```
|