genlayer 0.33.1 → 0.34.1

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.
Files changed (128) hide show
  1. package/dist/index.js +68 -31
  2. package/package.json +11 -2
  3. package/.eslintignore +0 -2
  4. package/.github/workflows/cli-docs.yml +0 -121
  5. package/.github/workflows/publish-beta.yml +0 -41
  6. package/.github/workflows/publish.yml +0 -43
  7. package/.github/workflows/validate-code.yml +0 -47
  8. package/.prettierignore +0 -19
  9. package/.prettierrc +0 -12
  10. package/.release-it.json +0 -64
  11. package/CHANGELOG.md +0 -419
  12. package/CLAUDE.md +0 -55
  13. package/CONTRIBUTING.md +0 -117
  14. package/docker-compose.yml +0 -154
  15. package/docs/delegator-guide.md +0 -203
  16. package/docs/validator-guide.md +0 -329
  17. package/esbuild.config.dev.js +0 -17
  18. package/esbuild.config.js +0 -22
  19. package/esbuild.config.prod.js +0 -17
  20. package/eslint.config.js +0 -60
  21. package/renovate.json +0 -22
  22. package/src/commands/account/create.ts +0 -29
  23. package/src/commands/account/export.ts +0 -106
  24. package/src/commands/account/import.ts +0 -135
  25. package/src/commands/account/index.ts +0 -126
  26. package/src/commands/account/list.ts +0 -34
  27. package/src/commands/account/lock.ts +0 -39
  28. package/src/commands/account/remove.ts +0 -30
  29. package/src/commands/account/send.ts +0 -156
  30. package/src/commands/account/show.ts +0 -74
  31. package/src/commands/account/unlock.ts +0 -51
  32. package/src/commands/account/use.ts +0 -21
  33. package/src/commands/config/getSetReset.ts +0 -51
  34. package/src/commands/config/index.ts +0 -30
  35. package/src/commands/contracts/call.ts +0 -39
  36. package/src/commands/contracts/code.ts +0 -33
  37. package/src/commands/contracts/deploy.ts +0 -157
  38. package/src/commands/contracts/index.ts +0 -86
  39. package/src/commands/contracts/schema.ts +0 -31
  40. package/src/commands/contracts/write.ts +0 -49
  41. package/src/commands/general/index.ts +0 -45
  42. package/src/commands/general/init.ts +0 -179
  43. package/src/commands/general/start.ts +0 -116
  44. package/src/commands/general/stop.ts +0 -26
  45. package/src/commands/localnet/index.ts +0 -100
  46. package/src/commands/localnet/validators.ts +0 -269
  47. package/src/commands/network/index.ts +0 -29
  48. package/src/commands/network/setNetwork.ts +0 -77
  49. package/src/commands/scaffold/index.ts +0 -16
  50. package/src/commands/scaffold/new.ts +0 -34
  51. package/src/commands/staking/StakingAction.ts +0 -267
  52. package/src/commands/staking/delegatorClaim.ts +0 -41
  53. package/src/commands/staking/delegatorExit.ts +0 -56
  54. package/src/commands/staking/delegatorJoin.ts +0 -44
  55. package/src/commands/staking/index.ts +0 -346
  56. package/src/commands/staking/setIdentity.ts +0 -78
  57. package/src/commands/staking/setOperator.ts +0 -46
  58. package/src/commands/staking/stakingInfo.ts +0 -584
  59. package/src/commands/staking/validatorClaim.ts +0 -43
  60. package/src/commands/staking/validatorDeposit.ts +0 -48
  61. package/src/commands/staking/validatorExit.ts +0 -63
  62. package/src/commands/staking/validatorHistory.ts +0 -298
  63. package/src/commands/staking/validatorJoin.ts +0 -47
  64. package/src/commands/staking/validatorPrime.ts +0 -73
  65. package/src/commands/staking/wizard.ts +0 -809
  66. package/src/commands/transactions/appeal.ts +0 -39
  67. package/src/commands/transactions/index.ts +0 -39
  68. package/src/commands/transactions/receipt.ts +0 -90
  69. package/src/commands/update/index.ts +0 -25
  70. package/src/commands/update/ollama.ts +0 -103
  71. package/src/lib/actions/BaseAction.ts +0 -295
  72. package/src/lib/clients/jsonRpcClient.ts +0 -41
  73. package/src/lib/clients/system.ts +0 -73
  74. package/src/lib/config/ConfigFileManager.ts +0 -194
  75. package/src/lib/config/KeychainManager.ts +0 -89
  76. package/src/lib/config/simulator.ts +0 -68
  77. package/src/lib/config/text.ts +0 -2
  78. package/src/lib/errors/missingRequirement.ts +0 -9
  79. package/src/lib/errors/versionRequired.ts +0 -9
  80. package/src/lib/interfaces/ISimulatorService.ts +0 -37
  81. package/src/lib/services/simulator.ts +0 -351
  82. package/src/types/node-fetch.d.ts +0 -1
  83. package/tests/actions/appeal.test.ts +0 -99
  84. package/tests/actions/call.test.ts +0 -94
  85. package/tests/actions/code.test.ts +0 -87
  86. package/tests/actions/create.test.ts +0 -65
  87. package/tests/actions/deploy.test.ts +0 -420
  88. package/tests/actions/getSetReset.test.ts +0 -88
  89. package/tests/actions/init.test.ts +0 -467
  90. package/tests/actions/lock.test.ts +0 -86
  91. package/tests/actions/new.test.ts +0 -80
  92. package/tests/actions/ollama.test.ts +0 -193
  93. package/tests/actions/receipt.test.ts +0 -261
  94. package/tests/actions/schema.test.ts +0 -94
  95. package/tests/actions/setNetwork.test.ts +0 -160
  96. package/tests/actions/staking.test.ts +0 -279
  97. package/tests/actions/start.test.ts +0 -235
  98. package/tests/actions/stop.test.ts +0 -77
  99. package/tests/actions/unlock.test.ts +0 -139
  100. package/tests/actions/validators.test.ts +0 -750
  101. package/tests/actions/write.test.ts +0 -102
  102. package/tests/commands/account.test.ts +0 -146
  103. package/tests/commands/appeal.test.ts +0 -58
  104. package/tests/commands/call.test.ts +0 -78
  105. package/tests/commands/code.test.ts +0 -69
  106. package/tests/commands/config.test.ts +0 -54
  107. package/tests/commands/deploy.test.ts +0 -83
  108. package/tests/commands/init.test.ts +0 -101
  109. package/tests/commands/localnet.test.ts +0 -131
  110. package/tests/commands/network.test.ts +0 -60
  111. package/tests/commands/new.test.ts +0 -68
  112. package/tests/commands/receipt.test.ts +0 -142
  113. package/tests/commands/schema.test.ts +0 -67
  114. package/tests/commands/staking.test.ts +0 -329
  115. package/tests/commands/stop.test.ts +0 -27
  116. package/tests/commands/up.test.ts +0 -105
  117. package/tests/commands/update.test.ts +0 -45
  118. package/tests/commands/write.test.ts +0 -76
  119. package/tests/index.test.ts +0 -56
  120. package/tests/libs/baseAction.test.ts +0 -516
  121. package/tests/libs/configFileManager.test.ts +0 -117
  122. package/tests/libs/jsonRpcClient.test.ts +0 -59
  123. package/tests/libs/keychainManager.test.ts +0 -156
  124. package/tests/libs/system.test.ts +0 -148
  125. package/tests/services/simulator.test.ts +0 -705
  126. package/tests/utils.ts +0 -13
  127. package/tsconfig.json +0 -120
  128. package/vitest.config.ts +0 -12
@@ -1,154 +0,0 @@
1
- version: "3.8"
2
-
3
- services:
4
- frontend:
5
- image: yeagerai/simulator-frontend:${LOCALNETVERSION:-latest}
6
- ports:
7
- - "${FRONTEND_PORT:-8080}:8080"
8
- environment:
9
- - VITE_*
10
- env_file:
11
- - ./.env
12
- depends_on:
13
- jsonrpc:
14
- condition: service_healthy
15
- expose:
16
- - "${FRONTEND_PORT:-8080}"
17
- restart: always
18
- security_opt:
19
- - "no-new-privileges=true"
20
- logging:
21
- driver: "json-file"
22
- options:
23
- max-size: "10m"
24
- max-file: "3"
25
- profiles:
26
- - frontend
27
-
28
-
29
- jsonrpc:
30
- image: yeagerai/simulator-jsonrpc:${LOCALNETVERSION:-latest}
31
- environment:
32
- - FLASK_SERVER_PORT=${RPCPORT:-5000}
33
- - PYTHONUNBUFFERED=1
34
- - RPCDEBUGPORT=${RPCDEBUGPORT:-5001}
35
- - WEBDRIVERHOST=${WEBDRIVERHOST:-webdriver}
36
- - WEBDRIVERPORT=${WEBDRIVERPORT:-4444}
37
- ports:
38
- - "${RPCPORT:-5000}:${RPCPORT:-5000}"
39
- - "${RPCDEBUGPORT:-5001}:${RPCDEBUGPORT:-5001}"
40
- env_file:
41
- - ./.env
42
- healthcheck:
43
- test: [ "CMD", "python3", "backend/healthcheck.py", "--port", "${RPCPORT}" ]
44
- interval: 30s
45
- timeout: 10s
46
- retries: 3
47
- start_period: 30s
48
- depends_on:
49
- database-migration:
50
- condition: service_completed_successfully
51
- webdriver:
52
- condition: service_healthy
53
- expose:
54
- - "${RPCPORT:-5000}"
55
- restart: always
56
- security_opt:
57
- - "no-new-privileges=true"
58
- logging:
59
- driver: "json-file"
60
- options:
61
- max-size: "10m"
62
- max-file: "3"
63
- deploy:
64
- replicas: ${JSONRPC_REPLICAS:-1}
65
- volumes:
66
- - hardhat_artifacts:/app/hardhat/artifacts
67
- - hardhat_deployments:/app/hardhat/deployments
68
-
69
-
70
- webdriver:
71
- image: yeagerai/genlayer-genvm-webdriver:0.0.3
72
- shm_size: 2gb
73
- environment:
74
- - PORT=${WEBDRIVERPORT:-4444}
75
- expose:
76
- - "${WEBDRIVERPORT:-4444}"
77
- restart: always
78
- security_opt:
79
- - "no-new-privileges=true"
80
- logging:
81
- driver: "json-file"
82
- options:
83
- max-size: "10m"
84
- max-file: "3"
85
-
86
- ollama:
87
- image: ollama/ollama:0.9.6
88
- ports:
89
- - 11434:11434
90
- container_name: genlayer-ollama
91
- tty: true
92
- restart: always
93
- security_opt:
94
- - "no-new-privileges=true"
95
- logging:
96
- driver: "json-file"
97
- options:
98
- max-size: "10m"
99
- max-file: "3"
100
- profiles:
101
- - ollama
102
-
103
- postgres:
104
- image: postgres:17-alpine
105
- ports:
106
- - "${DBPORT:-5432}:5432"
107
- environment:
108
- - POSTGRES_USER=${DBUSER:-postgres}
109
- - POSTGRES_PASSWORD=${DBPASSWORD:-postgres}
110
- - POSTGRES_DB=${DBNAME:-simulator_db}
111
- healthcheck:
112
- test: pg_isready -U ${DBUSER:-postgres} -d ${DBNAME:-simulator_db}
113
- interval: 10s
114
- timeout: 3s
115
- retries: 3
116
- restart: always
117
- security_opt:
118
- - "no-new-privileges=true"
119
- logging:
120
- driver: "json-file"
121
- options:
122
- max-size: "10m"
123
- max-file: "3"
124
-
125
- # Uncomment the following lines if you want your DB to persist
126
- # volumes:
127
- # - "./data/postgres:/var/lib/postgresql/data"
128
-
129
- database-migration:
130
- image: yeagerai/simulator-database-migration:${LOCALNETVERSION:-latest}
131
- environment:
132
- - DB_URL=postgresql://${DBUSER:-postgres}:${DBPASSWORD:-postgres}@postgres/${DBNAME:-simulator_db}
133
- depends_on:
134
- postgres:
135
- condition: service_healthy
136
-
137
- hardhat:
138
- image: yeagerai/simulator-hardhat:${LOCALNETVERSION:-latest}
139
- ports:
140
- - "${HARDHAT_PORT:-8545}:8545"
141
- environment:
142
- - HARDHAT_NETWORK=hardhat
143
- volumes:
144
- - hardhat_artifacts:/app/artifacts
145
- - hardhat_deployments:/app/deployments
146
- - hardhat_cache:/app/cache
147
- - hardhat_snapshots:/app/snapshots
148
-
149
- volumes:
150
- hardhat_artifacts:
151
- hardhat_deployments:
152
- hardhat_cache:
153
- hardhat_snapshots:
154
-
@@ -1,203 +0,0 @@
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-asimov
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
- ```
@@ -1,329 +0,0 @@
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-asimov
68
- ```
69
-
70
- Verify with:
71
- ```bash
72
- genlayer account show
73
- ```
74
-
75
- You should see `network: 'Asimov 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
- ```
@@ -1,17 +0,0 @@
1
- export default {
2
- context: {
3
- tsconfig: "./tsconfig.json",
4
- entryPoints: ["src/index.ts"],
5
- bundle: true,
6
- outfile: "dist/index.js",
7
- platform: "node",
8
- target: "es2020",
9
- format: "esm",
10
- define: { "import.meta.url": "import.meta.url" },
11
- banner: {
12
- js: `const _importMetaUrl = new URL(import.meta.url).pathname;`,
13
- },
14
- external: ["commander", "dockerode", "dotenv", "ethers", "inquirer", "update-check", "ssh2", "fs-extra", "esbuild", "keytar"]
15
- },
16
- watch: true,
17
- };
package/esbuild.config.js DELETED
@@ -1,22 +0,0 @@
1
- /* eslint-disable no-undef -- Allow process and console in ignored file */
2
-
3
- import esbuild from "esbuild";
4
-
5
- const isProduction = process.env.NODE_ENV === "production";
6
- const config = isProduction
7
- ? await import("./esbuild.config.prod.js")
8
- : await import("./esbuild.config.dev.js");
9
-
10
- const run = async () => {
11
- if (config.default.watch) {
12
- const context = await esbuild.context(config.default.context);
13
- await context.watch();
14
- } else {
15
- await esbuild.build(config.default.context);
16
- }
17
- };
18
-
19
- run().catch(e => {
20
- console.error(e);
21
- process.exit(1);
22
- });