genlayer 0.34.0 → 0.34.3

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 +13 -3
  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 -425
  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 -30
  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 -129
  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 -162
  30. package/src/commands/account/show.ts +0 -74
  31. package/src/commands/account/unlock.ts +0 -56
  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 -279
  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 -357
  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 -299
  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
package/dist/index.js CHANGED
@@ -20078,7 +20078,7 @@ var require_cli_table3 = __commonJS({
20078
20078
  import { program } from "commander";
20079
20079
 
20080
20080
  // package.json
20081
- var version = "0.34.0";
20081
+ var version = "0.34.3";
20082
20082
  var package_default = {
20083
20083
  name: "genlayer",
20084
20084
  version,
@@ -20088,10 +20088,19 @@ var package_default = {
20088
20088
  bin: {
20089
20089
  genlayer: "./dist/index.js"
20090
20090
  },
20091
+ files: [
20092
+ "dist",
20093
+ "scripts",
20094
+ "templates",
20095
+ ".env.example",
20096
+ "README.md",
20097
+ "LICENSE"
20098
+ ],
20091
20099
  scripts: {
20092
20100
  test: "vitest",
20093
20101
  "test:watch": "vitest --watch",
20094
20102
  "test:coverage": "vitest run --coverage",
20103
+ "test:smoke": "vitest run --config vitest.smoke.config.ts",
20095
20104
  dev: "cross-env NODE_ENV=development node esbuild.config.js",
20096
20105
  build: "cross-env NODE_ENV=production node esbuild.config.js",
20097
20106
  release: "release-it --ci",
@@ -20101,7 +20110,7 @@ var package_default = {
20101
20110
  },
20102
20111
  repository: {
20103
20112
  type: "git",
20104
- url: "git+https://github.com/yeagerai/genlayer-cli.git"
20113
+ url: "git+https://github.com/genlayerlabs/genlayer-cli.git"
20105
20114
  },
20106
20115
  keywords: [
20107
20116
  "genlayer",
@@ -52351,7 +52360,8 @@ var SLASH_EVENT_ABI = {
52351
52360
  { name: "validator", type: "address", indexed: true },
52352
52361
  { name: "txId", type: "bytes32", indexed: false },
52353
52362
  { name: "epoch", type: "uint256", indexed: false },
52354
- { name: "percentage", type: "uint256", indexed: false }
52363
+ { name: "percentage", type: "uint256", indexed: false },
52364
+ { name: "txStatus", type: "uint8", indexed: false }
52355
52365
  ]
52356
52366
  };
52357
52367
  var REWARD_EVENT_ABI = {
package/package.json CHANGED
@@ -1,16 +1,25 @@
1
1
  {
2
2
  "name": "genlayer",
3
- "version": "0.34.0",
3
+ "version": "0.34.3",
4
4
  "description": "GenLayer Command Line Tool",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "genlayer": "./dist/index.js"
9
9
  },
10
+ "files": [
11
+ "dist",
12
+ "scripts",
13
+ "templates",
14
+ ".env.example",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
10
18
  "scripts": {
11
19
  "test": "vitest",
12
20
  "test:watch": "vitest --watch",
13
21
  "test:coverage": "vitest run --coverage",
22
+ "test:smoke": "vitest run --config vitest.smoke.config.ts",
14
23
  "dev": "cross-env NODE_ENV=development node esbuild.config.js",
15
24
  "build": "cross-env NODE_ENV=production node esbuild.config.js",
16
25
  "release": "release-it --ci",
@@ -20,7 +29,7 @@
20
29
  },
21
30
  "repository": {
22
31
  "type": "git",
23
- "url": "git+https://github.com/yeagerai/genlayer-cli.git"
32
+ "url": "git+https://github.com/genlayerlabs/genlayer-cli.git"
24
33
  },
25
34
  "keywords": [
26
35
  "genlayer",
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- node_modules
2
- dist
@@ -1,121 +0,0 @@
1
- name: Generate CLI Docs and PR to genlayer-docs
2
-
3
- on:
4
- workflow_dispatch:
5
- release:
6
- types: [published]
7
-
8
- jobs:
9
- generate-and-sync:
10
- # Skip for pre-releases (tags containing '-') unless manually dispatched
11
- if: github.event_name != 'release' || !contains(github.event.release.tag_name, '-')
12
- runs-on: ubuntu-latest
13
- permissions:
14
- contents: read
15
- steps:
16
- - name: Checkout CLI repo
17
- uses: actions/checkout@v4
18
-
19
- - name: Setup Node.js
20
- uses: actions/setup-node@v4
21
- with:
22
- node-version: '20'
23
- cache: 'npm'
24
-
25
- - name: Install dependencies
26
- run: npm ci
27
-
28
- - name: Build
29
- run: npm run build
30
-
31
- - name: Determine version for docs
32
- id: version
33
- run: |
34
- if [ "${{ github.event_name }}" = "release" ]; then
35
- echo "value=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
36
- else
37
- # Prefer package.json version when not a release event
38
- echo "value=$(node -p \"require('./package.json').version\")" >> $GITHUB_OUTPUT
39
- fi
40
-
41
- - name: Generate CLI docs (MDX)
42
- env:
43
- DOCS_CLEAN: 'true'
44
- DOCS_VERSION: ${{ steps.version.outputs.value }}
45
- run: node scripts/generate-cli-docs.mjs | cat
46
-
47
- - name: Set up Git (for committing to CLI repo)
48
- run: |
49
- git config user.name "github-actions[bot]"
50
- git config user.email "github-actions[bot]@users.noreply.github.com"
51
-
52
- - name: Commit and push docs back to CLI repo (non-beta releases)
53
- if: github.event_name == 'release' && !contains(github.event.release.tag_name, '-')
54
- run: |
55
- set -euo pipefail
56
- if [ -n "$(git status --porcelain docs/api-references || true)" ]; then
57
- git add docs/api-references
58
- VERSION=${{ steps.version.outputs.value }}
59
- git commit -m "docs(cli): update API reference for ${VERSION}"
60
- git push
61
- else
62
- echo "No docs changes to commit"
63
- fi
64
-
65
- - name: Checkout docs repo
66
- uses: actions/checkout@v4
67
- with:
68
- repository: genlayerlabs/genlayer-docs
69
- token: ${{ secrets.DOCS_REPO_TOKEN || secrets.GITHUB_TOKEN }}
70
- path: docs-repo
71
- fetch-depth: 0
72
-
73
- - name: Prepare branch
74
- working-directory: docs-repo
75
- run: |
76
- set -euo pipefail
77
- git config user.name "github-actions[bot]"
78
- git config user.email "github-actions[bot]@users.noreply.github.com"
79
- BRANCH="docs/cli/${{ github.repository }}-${{ github.ref_name }}-${{ github.run_id }}"
80
- git switch -c "$BRANCH" || git switch "$BRANCH"
81
- echo "BRANCH=$BRANCH" >> $GITHUB_ENV
82
-
83
- - name: Sync CLI docs into docs repo
84
- run: |
85
- set -euo pipefail
86
- mkdir -p docs-repo/pages/api-references/genlayer-cli
87
- rsync -a --delete "${{ github.workspace }}/docs/api-references/" docs-repo/pages/api-references/genlayer-cli/
88
- echo "Synced files:" && ls -la docs-repo/pages/api-references/genlayer-cli | cat
89
-
90
- - name: Commit changes
91
- working-directory: docs-repo
92
- run: |
93
- set -euo pipefail
94
- if [ -n "$(git status --porcelain)" ]; then
95
- git add pages/api-references/genlayer-cli
96
- git commit -m "docs(cli): sync API reference ${VERSION:-${{ env.VERSION }}}"
97
- git push --set-upstream origin "$BRANCH"
98
- echo "HAS_CHANGES=true" >> $GITHUB_ENV
99
- else
100
- echo "No changes to commit"
101
- echo "HAS_CHANGES=false" >> $GITHUB_ENV
102
- fi
103
-
104
- - name: Create PR in docs repo
105
- if: env.HAS_CHANGES == 'true'
106
- uses: peter-evans/create-pull-request@v6
107
- with:
108
- token: ${{ secrets.DOCS_REPO_TOKEN || secrets.GITHUB_TOKEN }}
109
- path: docs-repo
110
- commit-message: "docs(cli): sync API reference ${{ steps.version.outputs.value }}"
111
- branch: ${{ env.BRANCH }}
112
- title: "docs(cli): sync CLI API reference ${{ steps.version.outputs.value }}"
113
- body: |
114
- This PR updates the GenlayerCLI API Reference generated automatically from `${{ github.repository }}`.
115
-
116
- - Version: `${{ steps.version.outputs.value }}`
117
- - Source commit: `${{ github.sha }}`
118
- - Trigger: `${{ github.event_name }}`
119
- labels: documentation, cli
120
-
121
-
@@ -1,41 +0,0 @@
1
- name: Release & Publish Beta version of the Package to NPM with @beta tag
2
-
3
- on:
4
- workflow_dispatch:
5
- push:
6
- branches:
7
- - staging
8
-
9
- jobs:
10
- release:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - name: Get CI Bot Token
14
- uses: tibdex/github-app-token@v2
15
- id: ci_bot_token
16
- with:
17
- app_id: ${{ secrets.CI_BOT_APP_ID }}
18
- private_key: ${{ secrets.CI_BOT_SECRET }}
19
-
20
- - name: Checkout source code
21
- uses: actions/checkout@v4
22
- with:
23
- token: ${{ steps.ci_bot_token.outputs.token }}
24
- - name: Setup Node.js
25
- uses: actions/setup-node@v4
26
- with:
27
- node-version: "22"
28
- - name: Install the dependencies
29
- run: npm ci
30
- - name: Initialize Git User
31
- run: |
32
- git config --global user.email "github-actions[bot]@genlayer.com"
33
- git config --global user.name "github-actions[bot]"
34
- - name: Initialize the NPM configuration
35
- run: npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
36
- env:
37
- NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
38
- - run: npm run release-beta
39
- env:
40
- GITHUB_TOKEN: ${{ steps.ci_bot_token.outputs.token }}
41
- NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
@@ -1,43 +0,0 @@
1
- name: Release & Publish Package to NPM
2
-
3
- on:
4
- workflow_dispatch:
5
- push:
6
- branches:
7
- - main
8
- paths-ignore:
9
- - 'docs/**'
10
-
11
- jobs:
12
- release:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - name: Get CI Bot Token
16
- uses: tibdex/github-app-token@v2
17
- id: ci_bot_token
18
- with:
19
- app_id: ${{ secrets.CI_BOT_APP_ID }}
20
- private_key: ${{ secrets.CI_BOT_SECRET }}
21
-
22
- - name: Checkout source code
23
- uses: actions/checkout@v4
24
- with:
25
- token: ${{ steps.ci_bot_token.outputs.token }}
26
- - name: Setup Node.js
27
- uses: actions/setup-node@v4
28
- with:
29
- node-version: "22"
30
- - name: Install the dependencies
31
- run: npm ci
32
- - name: Initialize Git User
33
- run: |
34
- git config --global user.email "github-actions[bot]@genlayer.com"
35
- git config --global user.name "github-actions[bot]"
36
- - name: Initialize the NPM configuration
37
- run: npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
38
- env:
39
- NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
40
- - run: npm run release
41
- env:
42
- GITHUB_TOKEN: ${{ steps.ci_bot_token.outputs.token }}
43
- NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
@@ -1,47 +0,0 @@
1
- name: CI Workflow
2
-
3
- on:
4
- pull_request:
5
- types:
6
- - opened
7
- - synchronize
8
- - reopened
9
- push:
10
- branches:
11
- - main
12
-
13
- jobs:
14
- build-and-test:
15
- name: Build and Test
16
- runs-on: ubuntu-latest
17
-
18
- steps:
19
- - name: Checkout code
20
- uses: actions/checkout@v4
21
-
22
- - name: Install libsecret runtime
23
- run: sudo apt-get update && sudo apt-get install -y libsecret-1-0
24
-
25
- - name: Set up Node.js
26
- uses: actions/setup-node@v4
27
- with:
28
- node-version: 18
29
- cache: "npm"
30
-
31
- - name: Install dependencies
32
- run: npm ci
33
-
34
- - name: Build the project
35
- run: npm run build
36
-
37
- - name: Run tests
38
- run: npm run test:coverage
39
-
40
- - name: Upload coverage report
41
- if: success()
42
- uses: codecov/codecov-action@v5.4.3
43
- with:
44
- verbose: true
45
- token: ${{ secrets.CODECOV_TOKEN }}
46
- fail_ci_if_error: true
47
- directory: coverage
package/.prettierignore DELETED
@@ -1,19 +0,0 @@
1
- # Node artifact files
2
- node_modules/
3
- dist/
4
- package-lock.json
5
- yarn.lock
6
- pnpm-lock.yaml
7
-
8
- # Log files
9
- *.log
10
-
11
- # Generated by MacOS
12
- .DS_Store
13
-
14
- # Generated by Windows
15
- Thumbs.db
16
-
17
- # aws
18
- .aws-sam
19
- .sam
package/.prettierrc DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "tabWidth": 2,
3
- "useTabs": false,
4
- "semi": true,
5
- "singleQuote": false,
6
- "jsxSingleQuote": false,
7
- "trailingComma": "all",
8
- "bracketSpacing": false,
9
- "bracketSameLine": false,
10
- "arrowParens": "avoid",
11
- "printWidth": 110
12
- }
package/.release-it.json DELETED
@@ -1,64 +0,0 @@
1
- {
2
- "git": {
3
- "commitMessage": "Release v${version} [skip ci]",
4
- "tagName": "v${version}",
5
- "requireCleanWorkingDir": false,
6
- "requireUpstream": false,
7
- "requireCommits": false,
8
- "push": true
9
- },
10
- "github": {
11
- "release": true,
12
- "tokenRef": "GITHUB_TOKEN"
13
- },
14
- "npm": {
15
- "publish": true
16
- },
17
- "plugins": {
18
- "@release-it/conventional-changelog": {
19
- "preset": "conventionalcommits",
20
- "infile": "CHANGELOG.md",
21
- "types": [
22
- {
23
- "type": "feat",
24
- "section": "Features"
25
- },
26
- {
27
- "type": "fix",
28
- "section": "Bug Fixes"
29
- },
30
- {
31
- "type": "chore",
32
- "section": "Improvement Tasks"
33
- },
34
- {
35
- "type": "ci",
36
- "section": "Continuous Integration"
37
- },
38
- {
39
- "type": "docs",
40
- "section": "Documentation"
41
- },
42
- {
43
- "type": "style",
44
- "section": "Styles"
45
- },
46
- {
47
- "type": "refactor",
48
- "section": "Refactor Tasks"
49
- },
50
- {
51
- "type": "perf",
52
- "section": "Performance Improvements"
53
- },
54
- {
55
- "type": "test",
56
- "section": "Testing"
57
- }
58
- ]
59
- }
60
- },
61
- "hooks": {
62
- "after:bump": "npm run build"
63
- }
64
- }