genlayer 0.39.1 → 0.39.2
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/.claude/skills/release/SKILL.md +89 -0
- package/.github/e2e-track +1 -0
- package/.github/workflows/e2e-housekeeper.yml +84 -0
- package/.github/workflows/e2e.yml +740 -0
- package/.github/workflows/publish.yml +42 -29
- package/.github/workflows/validate-code.yml +1 -1
- package/CHANGELOG.md +13 -0
- package/CONTRIBUTING.md +24 -0
- package/README.md +50 -1
- package/dist/index.js +418 -48
- package/package.json +3 -4
- package/scripts/release.sh +157 -0
- package/src/commands/contracts/deploy.ts +6 -1
- package/src/commands/contracts/estimateFees.ts +133 -0
- package/src/commands/contracts/fees.ts +236 -0
- package/src/commands/contracts/index.ts +43 -0
- package/src/commands/contracts/write.ts +16 -3
- package/src/commands/localnet/validators.ts +4 -5
- package/src/lib/clients/jsonRpcClient.ts +9 -4
- package/src/lib/clients/system.ts +19 -17
- package/tests/actions/deploy.test.ts +49 -0
- package/tests/actions/estimateFees.test.ts +271 -0
- package/tests/actions/validators.test.ts +5 -5
- package/tests/actions/write.test.ts +47 -0
- package/tests/commands/deploy.test.ts +25 -0
- package/tests/commands/estimateFees.test.ts +98 -0
- package/tests/commands/write.test.ts +26 -0
- package/tests/libs/jsonRpcClient.test.ts +18 -0
- package/tests/libs/system.test.ts +36 -3
- package/tsconfig.json +2 -3
|
@@ -1,40 +1,29 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: Publish Package to NPM
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Tag-driven publish. The release is cut by a human (or Claude via the
|
|
4
|
+
# release skill) running scripts/release.sh on the target stable branch
|
|
5
|
+
# — that script bumps package.json, updates CHANGELOG.md, commits,
|
|
6
|
+
# tags vX.Y.Z, and pushes both the branch commit and the tag. This
|
|
7
|
+
# workflow fires on the tag push, sanity-checks the tag matches
|
|
8
|
+
# package.json, builds, publishes to npm, and creates the GitHub
|
|
9
|
+
# Release. It never bumps or tags by itself.
|
|
4
10
|
on:
|
|
5
11
|
workflow_dispatch:
|
|
6
12
|
push:
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
- staging
|
|
10
|
-
paths-ignore:
|
|
11
|
-
- 'docs/**'
|
|
13
|
+
tags:
|
|
14
|
+
- "v*"
|
|
12
15
|
|
|
13
16
|
permissions:
|
|
14
17
|
contents: write
|
|
15
18
|
id-token: write
|
|
16
19
|
|
|
17
20
|
jobs:
|
|
18
|
-
|
|
21
|
+
publish:
|
|
19
22
|
runs-on: ubuntu-latest
|
|
20
23
|
environment: Publish
|
|
21
24
|
steps:
|
|
22
|
-
- name:
|
|
23
|
-
uses: actions/create-github-app-token@v3
|
|
24
|
-
id: ci_bot_token
|
|
25
|
-
with:
|
|
26
|
-
client-id: ${{ vars.PUBLISH_CI_APP_CLIENT_ID }}
|
|
27
|
-
private-key: ${{ secrets.PUBLISH_CI_APP_KEY }}
|
|
28
|
-
|
|
29
|
-
- name: Checkout source code
|
|
25
|
+
- name: Checkout tag
|
|
30
26
|
uses: actions/checkout@v4
|
|
31
|
-
with:
|
|
32
|
-
token: ${{ steps.ci_bot_token.outputs.token }}
|
|
33
|
-
|
|
34
|
-
- name: Initialize Git User
|
|
35
|
-
run: |
|
|
36
|
-
git config --global user.email "github-actions[bot]@genlayer.com"
|
|
37
|
-
git config --global user.name "github-actions[bot]"
|
|
38
27
|
|
|
39
28
|
- uses: actions/setup-node@v4
|
|
40
29
|
with:
|
|
@@ -43,12 +32,36 @@ jobs:
|
|
|
43
32
|
|
|
44
33
|
- run: npm ci
|
|
45
34
|
|
|
46
|
-
- name:
|
|
35
|
+
- name: Verify tag matches package.json version
|
|
47
36
|
run: |
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
TAG_VERSION="${GITHUB_REF_NAME#v}"
|
|
38
|
+
PKG_VERSION="$(node -p "require('./package.json').version")"
|
|
39
|
+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
|
|
40
|
+
echo "Tag ($TAG_VERSION) and package.json ($PKG_VERSION) disagree — refusing to publish." >&2
|
|
41
|
+
echo "Re-cut the release via scripts/release.sh so the tag and the committed version match." >&2
|
|
42
|
+
exit 1
|
|
52
43
|
fi
|
|
44
|
+
echo "Tag $GITHUB_REF_NAME matches package.json $PKG_VERSION."
|
|
45
|
+
|
|
46
|
+
- run: npm run build
|
|
47
|
+
|
|
48
|
+
- name: Publish to npm
|
|
49
|
+
run: npm publish --provenance --access public
|
|
50
|
+
env:
|
|
51
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
52
|
+
|
|
53
|
+
- name: Create GitHub Release
|
|
53
54
|
env:
|
|
54
|
-
|
|
55
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
56
|
+
run: |
|
|
57
|
+
NOTES="$(awk -v ver="$GITHUB_REF_NAME" '
|
|
58
|
+
$0 ~ "^## \\[?" substr(ver, 2) {capture=1; next}
|
|
59
|
+
capture && /^## / {exit}
|
|
60
|
+
capture {print}
|
|
61
|
+
' CHANGELOG.md)"
|
|
62
|
+
if [ -z "$NOTES" ]; then
|
|
63
|
+
NOTES="Release $GITHUB_REF_NAME"
|
|
64
|
+
fi
|
|
65
|
+
gh release create "$GITHUB_REF_NAME" \
|
|
66
|
+
--title "$GITHUB_REF_NAME" \
|
|
67
|
+
--notes "$NOTES"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.39.2](https://github.com/genlayerlabs/genlayer-cli/compare/v0.39.1...v0.39.2) (2026-06-11)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add v0.6 fee-aware commands ([#340](https://github.com/genlayerlabs/genlayer-cli/issues/340)) ([ca083ab](https://github.com/genlayerlabs/genlayer-cli/commit/ca083abbf854960a6638d5af63096b532a03cc5a))
|
|
8
|
+
* branch-per-major release model ([#311](https://github.com/genlayerlabs/genlayer-cli/issues/311)) ([6fd2f3a](https://github.com/genlayerlabs/genlayer-cli/commit/6fd2f3a678ce348c92470828b03bdfc596afa9cb)), closes [genlayer-js#172](https://github.com/genlayerlabs/genlayer-js/issues/172)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **localnet:** print validator count to stdout ([37519e1](https://github.com/genlayerlabs/genlayer-cli/commit/37519e18b6155bc762fa24ea809a53c3e83ac9a7))
|
|
13
|
+
* run CI on v0.39 branch ([#322](https://github.com/genlayerlabs/genlayer-cli/issues/322)) ([e129bab](https://github.com/genlayerlabs/genlayer-cli/commit/e129bab0c471c2d59d360b5ca8c1cb3190774ff8))
|
|
14
|
+
* **system:** handle command-check and version parse failures ([#349](https://github.com/genlayerlabs/genlayer-cli/issues/349)) ([5b93dd3](https://github.com/genlayerlabs/genlayer-cli/commit/5b93dd32e45683f30368d0c9324078800c3d8dda)), closes [#301](https://github.com/genlayerlabs/genlayer-cli/issues/301) [#303](https://github.com/genlayerlabs/genlayer-cli/issues/303)
|
|
15
|
+
|
|
3
16
|
## 0.39.1 (2026-05-06)
|
|
4
17
|
|
|
5
18
|
### Bug Fixes
|
package/CONTRIBUTING.md
CHANGED
|
@@ -31,6 +31,30 @@ Have ideas for new features or use cases? We're eager to hear them! But first:
|
|
|
31
31
|
- Ensure you have the CLI installed to explore existing functionality.
|
|
32
32
|
- After familiarizing yourself with the CLI, contribute your unique use case and share your ideas in our [Discord channel](https://discord.gg/8Jm4v89VAu).
|
|
33
33
|
|
|
34
|
+
## Branch model
|
|
35
|
+
|
|
36
|
+
This repo uses a branch-per-major release model. There is no `main`.
|
|
37
|
+
|
|
38
|
+
- **`v0.39`** — current stable major (semver-zero, so 0.39 IS the major; 0.40 would be a major bump that gets its own branch). PRs for bug fixes / non-breaking features target this branch.
|
|
39
|
+
- **`v<next>-dev`** — when next-major work is in progress, this branch is open for breaking changes. PRs introducing them target this branch.
|
|
40
|
+
- **Older majors** stay for back-ports. Default branch on github.com is whichever major is current stable.
|
|
41
|
+
|
|
42
|
+
When you fork or clone, the default branch is `v0.39` today. If you have a `main` branch from a previous checkout, delete it locally:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
git checkout v0.39
|
|
46
|
+
git branch -D main
|
|
47
|
+
git remote prune origin
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The previous `staging` branch (beta channel) has been retired. Pre-releases now go through the same release script with an explicit version (`scripts/release.sh 0.39.2-beta.0`).
|
|
51
|
+
|
|
52
|
+
## Releases
|
|
53
|
+
|
|
54
|
+
Releases are deliberate, not automatic. `scripts/release.sh` bumps the version, updates `CHANGELOG.md`, commits, tags, and pushes; CI takes over from the tag push and publishes to npm. See `.claude/skills/release/SKILL.md` for the full flow.
|
|
55
|
+
|
|
56
|
+
**Semver-zero rule**: this package is on 0.x, so minor IS the breaking-change boundary. `0.39 → 0.40` is a major bump and needs a new branch — the script refuses `minor`/`major` keywords without `--allow-major`.
|
|
57
|
+
|
|
34
58
|
### Bug fixing and Feature development
|
|
35
59
|
|
|
36
60
|
#### 1. Set yourself up to start coding
|
package/README.md
CHANGED
|
@@ -169,11 +169,15 @@ USAGE:
|
|
|
169
169
|
genlayer deploy [options]
|
|
170
170
|
genlayer call <contractAddress> <method> [options]
|
|
171
171
|
genlayer write <contractAddress> <method> [options]
|
|
172
|
+
genlayer estimate-fees [contractAddress] [method] [options]
|
|
172
173
|
genlayer schema <contractAddress> [options]
|
|
173
174
|
|
|
174
175
|
OPTIONS (deploy):
|
|
175
176
|
--contract <contractPath> (Optional) Path to the intelligent contract to deploy
|
|
176
177
|
--rpc <rpcUrl> RPC URL for the network
|
|
178
|
+
--fees <json> Transaction fee options JSON passed to genlayer-js
|
|
179
|
+
--fee-value <wei> Explicit fee deposit value
|
|
180
|
+
--valid-until <timestamp> Unix timestamp after which the transaction is invalid
|
|
177
181
|
--args <args...> Contract arguments (see Argument Types below)
|
|
178
182
|
|
|
179
183
|
OPTIONS (call):
|
|
@@ -182,8 +186,17 @@ OPTIONS (call):
|
|
|
182
186
|
|
|
183
187
|
OPTIONS (write):
|
|
184
188
|
--rpc <rpcUrl> RPC URL for the network
|
|
189
|
+
--fees <json> Transaction fee options JSON passed to genlayer-js
|
|
190
|
+
--fee-value <wei> Explicit fee deposit value
|
|
191
|
+
--valid-until <timestamp> Unix timestamp after which the transaction is invalid
|
|
185
192
|
--args <args...> Method arguments (see Argument Types below)
|
|
186
193
|
|
|
194
|
+
OPTIONS (estimate-fees):
|
|
195
|
+
--rpc <rpcUrl> RPC URL for the network
|
|
196
|
+
--fees <json> Fee estimate options JSON, or a transaction fee object
|
|
197
|
+
--include-report Include simulation fee accounting/report in the generated estimate output
|
|
198
|
+
--args <args...> Method arguments for simulation-derived estimates
|
|
199
|
+
|
|
187
200
|
OPTIONS (schema):
|
|
188
201
|
--rpc <rpcUrl> RPC URL for the network
|
|
189
202
|
|
|
@@ -191,14 +204,51 @@ EXAMPLES:
|
|
|
191
204
|
genlayer deploy
|
|
192
205
|
genlayer deploy --contract ./my_contract.gpy
|
|
193
206
|
genlayer deploy --contract ./my_contract.gpy --args "arg1" "arg2" 123
|
|
207
|
+
genlayer deploy --contract ./my_contract.gpy --fees '{"distribution":{"leaderTimeunitsAllocation":"100","validatorTimeunitsAllocation":"200","rotations":["0"]}}'
|
|
194
208
|
genlayer call 0x123456789abcdef greet --args "Hello World!"
|
|
195
209
|
genlayer write 0x123456789abcdef updateValue --args 42
|
|
210
|
+
genlayer write 0x123456789abcdef updateValue --fees '{"distribution":{"leaderTimeunitsAllocation":"100","validatorTimeunitsAllocation":"200","rotations":["0"]}}' --args 42
|
|
211
|
+
genlayer estimate-fees
|
|
212
|
+
genlayer estimate-fees 0x123456789abcdef updateValue --args 42
|
|
196
213
|
genlayer write 0x123456789abcdef sendReward --args 0x6857Ed54CbafaA74Fc0357145eC0ee1536ca45A0
|
|
197
214
|
genlayer write 0x123456789abcdef setScores --args '[1, 2, 3]'
|
|
198
215
|
genlayer write 0x123456789abcdef setConfig --args '{"timeout": 30, "retries": 5}'
|
|
199
216
|
genlayer schema 0x123456789abcdef
|
|
200
217
|
```
|
|
201
218
|
|
|
219
|
+
##### Transaction Fee Options
|
|
220
|
+
|
|
221
|
+
`--fees` accepts the same transaction fee object as `genlayer-js`. Quote large
|
|
222
|
+
integer values as strings to preserve precision. `messageAllocations[].messageType`
|
|
223
|
+
may be `"internal"`, `"external"`, `0`, or `1`.
|
|
224
|
+
|
|
225
|
+
For targeted message budgets, the CLI can derive GenVM call keys before passing
|
|
226
|
+
the JSON to `genlayer-js`:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
genlayer estimate-fees 0x123456789abcdef settle \
|
|
230
|
+
--fees '{"messageAllocations":[{"messageType":"internal","recipient":"0x0000000000000000000000000000000000000001","callKeyMethod":"settle_campaign","budget":"700000"}]}'
|
|
231
|
+
|
|
232
|
+
genlayer write 0x123456789abcdef sendReward \
|
|
233
|
+
--fees '{"messageAllocations":[{"messageType":"external","recipient":"0x0000000000000000000000000000000000000002","callKeySelector":"0xa9059cbb","budget":"210000"}]}'
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Use `callKeyMethod` for internal GenVM messages, `callKeySelector` for a 4-byte
|
|
237
|
+
EVM selector, or `callKeyCalldata` for full external calldata. Explicit
|
|
238
|
+
`callKey` is still accepted for advanced cases.
|
|
239
|
+
|
|
240
|
+
If `--fees` includes a `distribution` and `--fee-value` is omitted, the SDK
|
|
241
|
+
derives the fee deposit from FeeManager on network backends, or from
|
|
242
|
+
`sim_getFeeConfig` on Studio. Use `--fee-value` only when you need to force an
|
|
243
|
+
explicit deposit value.
|
|
244
|
+
|
|
245
|
+
`estimate-fees` prints the SDK fee preset. Without a contract/method it calls
|
|
246
|
+
`estimateTransactionFees`. With a contract/method it uses the SDK target-write
|
|
247
|
+
estimation helper so the preset reflects the observed Studio fee accounting
|
|
248
|
+
report. Add `--include-report` to use the explicit simulate-and-derive path and
|
|
249
|
+
include the simulation fee accounting and execution fee report next to the
|
|
250
|
+
preset for reproducible gas-unit debugging.
|
|
251
|
+
|
|
202
252
|
##### Argument Types
|
|
203
253
|
|
|
204
254
|
The `--args` option automatically detects and converts values to the correct type:
|
|
@@ -522,4 +572,3 @@ We welcome contributions to GenLayerJS SDK! Whether it's new features, improved
|
|
|
522
572
|
## License
|
|
523
573
|
|
|
524
574
|
This project is licensed under the ... License - see the [LICENSE](LICENSE) file for details.
|
|
525
|
-
|