genlayer 0.28.1 → 0.29.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.29.0 (2025-09-03)
4
+
5
+ ### Features
6
+
7
+ * rename studio validators commands ([#249](https://github.com/yeagerai/genlayer-cli/issues/249)) ([fb875e5](https://github.com/yeagerai/genlayer-cli/commit/fb875e5569d21346507eab07b8eacb88b395a15d))
8
+
3
9
  ## 0.28.1 (2025-09-03)
4
10
 
5
11
  ## 0.28.0 (2025-09-03)
package/README.md CHANGED
@@ -238,13 +238,13 @@ EXAMPLES:
238
238
  genlayer update ollama --model deepseek-r1 --remove
239
239
  ```
240
240
 
241
- #### Validator Management
241
+ #### Localnet Validator Management
242
242
 
243
- Manage validator operations.
243
+ Manage localnet validator operations.
244
244
 
245
245
  ```bash
246
246
  USAGE:
247
- genlayer validators <command> [options]
247
+ genlayer localnet validators <command> [options]
248
248
 
249
249
  COMMANDS:
250
250
  get [--address <validatorAddress>] Retrieve details of a specific validator or all validators
@@ -272,16 +272,16 @@ OPTIONS (create):
272
272
  --model <model> Specify the model for the validator
273
273
 
274
274
  EXAMPLES:
275
- genlayer validators get
276
- genlayer validators get --address 0x123456789abcdef
275
+ genlayer localnet validators get
276
+ genlayer localnet validators get --address 0x123456789abcdef
277
277
 
278
- genlayer validators count
279
- genlayer validators delete --address 0x123456789abcdef
280
- genlayer validators update 0x123456789abcdef --stake 100 --provider openai --model gpt-4
278
+ genlayer localnet validators count
279
+ genlayer localnet validators delete --address 0x123456789abcdef
280
+ genlayer localnet validators update 0x123456789abcdef --stake 100 --provider openai --model gpt-4
281
281
 
282
- genlayer validators create
283
- genlayer validators create --stake 50 --provider openai --model gpt-4
284
- genlayer validators create-random --count 3 --providers openai --models gpt-4 gpt-4o
282
+ genlayer localnet validators create
283
+ genlayer localnet validators create --stake 50 --provider openai --model gpt-4
284
+ genlayer localnet validators create-random --count 3 --providers openai --models gpt-4 gpt-4o
285
285
  ```
286
286
 
287
287
  ### Running the CLI from the repository
package/dist/index.js CHANGED
@@ -17856,7 +17856,7 @@ var require_semver2 = __commonJS({
17856
17856
  import { program } from "commander";
17857
17857
 
17858
17858
  // package.json
17859
- var version = "0.28.1";
17859
+ var version = "0.29.0";
17860
17860
  var package_default = {
17861
17861
  name: "genlayer",
17862
17862
  version,
@@ -42888,7 +42888,7 @@ function initializeConfigCommands(program2) {
42888
42888
  return program2;
42889
42889
  }
42890
42890
 
42891
- // src/commands/validators/validators.ts
42891
+ // src/commands/localnet/validators.ts
42892
42892
  import inquirer4 from "inquirer";
42893
42893
  var ValidatorsAction = class extends BaseAction {
42894
42894
  async getValidator(options) {
@@ -43082,10 +43082,11 @@ var ValidatorsAction = class extends BaseAction {
43082
43082
  }
43083
43083
  };
43084
43084
 
43085
- // src/commands/validators/index.ts
43085
+ // src/commands/localnet/index.ts
43086
43086
  function initializeValidatorCommands(program2) {
43087
43087
  const validatorsAction = new ValidatorsAction();
43088
- const validatorsCommand = program2.command("validators").description("Manage validator operations");
43088
+ const localnetCommand = program2.command("localnet").description("Manage localnet operations");
43089
+ const validatorsCommand = localnetCommand.command("validators").description("Manage localnet validators operations");
43089
43090
  validatorsCommand.command("get").description("Retrieve details of a specific validator or all validators").option("--address <validatorAddress>", "The address of the validator to retrieve (omit to retrieve all validators)").action(async (options) => {
43090
43091
  await validatorsAction.getValidator({ address: options.address });
43091
43092
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genlayer",
3
- "version": "0.28.1",
3
+ "version": "0.29.0",
4
4
  "description": "GenLayer Command Line Tool",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -4,9 +4,13 @@ import { ValidatorsAction } from "./validators";
4
4
  export function initializeValidatorCommands(program: Command) {
5
5
  const validatorsAction = new ValidatorsAction();
6
6
 
7
- const validatorsCommand = program
7
+ const localnetCommand = program
8
+ .command("localnet")
9
+ .description("Manage localnet operations");
10
+
11
+ const validatorsCommand = localnetCommand
8
12
  .command("validators")
9
- .description("Manage validator operations");
13
+ .description("Manage localnet validators operations");
10
14
 
11
15
  validatorsCommand
12
16
  .command("get")
@@ -77,7 +81,7 @@ export function initializeValidatorCommands(program: Command) {
77
81
  .option("--stake <stake>", "Stake amount for the validator (default: 1)", "1")
78
82
  .option(
79
83
  "--config <config>",
80
- 'Optional JSON configuration for the validator (e.g., \'{"max_tokens": 500, "temperature": 0.75}\')'
84
+ `Optional JSON configuration for the validator (e.g., '{"max_tokens": 500, "temperature": 0.75}')`
81
85
  )
82
86
  .option("--provider <provider>", "Specify the provider for the validator")
83
87
  .option("--model <model>", "Specify the model for the validator")
@@ -92,3 +96,5 @@ export function initializeValidatorCommands(program: Command) {
92
96
 
93
97
  return program;
94
98
  }
99
+
100
+
@@ -265,3 +265,5 @@ export class ValidatorsAction extends BaseAction {
265
265
  }
266
266
  }
267
267
  }
268
+
269
+
package/src/index.ts CHANGED
@@ -6,7 +6,7 @@ import {initializeGeneralCommands} from "../src/commands/general";
6
6
  import {initializeKeygenCommands} from "../src/commands/keygen";
7
7
  import {initializeContractsCommands} from "../src/commands/contracts";
8
8
  import {initializeConfigCommands} from "../src/commands/config";
9
- import {initializeValidatorCommands} from "../src/commands/validators";
9
+ import {initializeValidatorCommands} from "../src/commands/localnet";
10
10
  import {initializeUpdateCommands} from "../src/commands/update";
11
11
  import {initializeScaffoldCommands} from "../src/commands/scaffold";
12
12
  import {initializeNetworkCommands} from "../src/commands/network";
@@ -1,5 +1,5 @@
1
1
  import { describe, test, vi, beforeEach, afterEach, expect } from "vitest";
2
- import { ValidatorsAction } from "../../src/commands/validators/validators";
2
+ import { ValidatorsAction } from "../../src/commands/localnet/validators";
3
3
  import { rpcClient } from "../../src/lib/clients/jsonRpcClient";
4
4
  import inquirer from "inquirer";
5
5
 
@@ -1,11 +1,11 @@
1
1
  import { Command } from "commander";
2
2
  import { vi, describe, beforeEach, afterEach, test, expect } from "vitest";
3
- import { initializeValidatorCommands } from "../../src/commands/validators";
4
- import { ValidatorsAction } from "../../src/commands/validators/validators";
3
+ import { initializeValidatorCommands } from "../../src/commands/localnet";
4
+ import { ValidatorsAction } from "../../src/commands/localnet/validators";
5
5
 
6
- vi.mock("../../src/commands/validators/validators");
6
+ vi.mock("../../src/commands/localnet/validators");
7
7
 
8
- describe("validators command", () => {
8
+ describe("localnet validator command", () => {
9
9
  let program: Command;
10
10
 
11
11
  beforeEach(() => {
@@ -18,7 +18,7 @@ describe("validators command", () => {
18
18
  });
19
19
 
20
20
  test("ValidatorsAction.getValidator is called with address option", async () => {
21
- program.parse(["node", "test", "validators", "get", "--address", "mocked_address"]);
21
+ program.parse(["node", "test", "localnet", "validators", "get", "--address", "mocked_address"]);
22
22
  expect(ValidatorsAction).toHaveBeenCalledTimes(1);
23
23
  expect(ValidatorsAction.prototype.getValidator).toHaveBeenCalledWith({
24
24
  address: "mocked_address",
@@ -26,13 +26,13 @@ describe("validators command", () => {
26
26
  });
27
27
 
28
28
  test("ValidatorsAction.getValidator is called without address option", async () => {
29
- program.parse(["node", "test", "validators", "get"]);
29
+ program.parse(["node", "test", "localnet", "validators", "get"]);
30
30
  expect(ValidatorsAction).toHaveBeenCalledTimes(1);
31
31
  expect(ValidatorsAction.prototype.getValidator).toHaveBeenCalledWith({});
32
32
  });
33
33
 
34
34
  test("ValidatorsAction.deleteValidator is called with address option", async () => {
35
- program.parse(["node", "test", "validators", "delete", "--address", "mocked_address"]);
35
+ program.parse(["node", "test", "localnet", "validators", "delete", "--address", "mocked_address"]);
36
36
  expect(ValidatorsAction).toHaveBeenCalledTimes(1);
37
37
  expect(ValidatorsAction.prototype.deleteValidator).toHaveBeenCalledWith({
38
38
  address: "mocked_address",
@@ -40,13 +40,13 @@ describe("validators command", () => {
40
40
  });
41
41
 
42
42
  test("ValidatorsAction.deleteValidator is called without address option", async () => {
43
- program.parse(["node", "test", "validators", "delete"]);
43
+ program.parse(["node", "test", "localnet", "validators", "delete"]);
44
44
  expect(ValidatorsAction).toHaveBeenCalledTimes(1);
45
45
  expect(ValidatorsAction.prototype.deleteValidator).toHaveBeenCalledWith({});
46
46
  });
47
47
 
48
48
  test("ValidatorsAction.countValidators is called", async () => {
49
- program.parse(["node", "test", "validators", "count"]);
49
+ program.parse(["node", "test", "localnet", "validators", "count"]);
50
50
  expect(ValidatorsAction).toHaveBeenCalledTimes(1);
51
51
  expect(ValidatorsAction.prototype.countValidators).toHaveBeenCalled();
52
52
  });
@@ -55,6 +55,7 @@ describe("validators command", () => {
55
55
  program.parse([
56
56
  "node",
57
57
  "test",
58
+ "localnet",
58
59
  "validators",
59
60
  "update",
60
61
  "mocked_address",
@@ -81,6 +82,7 @@ describe("validators command", () => {
81
82
  program.parse([
82
83
  "node",
83
84
  "test",
85
+ "localnet",
84
86
  "validators",
85
87
  "create-random",
86
88
  "--count",
@@ -98,7 +100,7 @@ describe("validators command", () => {
98
100
  });
99
101
 
100
102
  test("ValidatorsAction.createValidator is called with default stake", async () => {
101
- program.parse(["node", "test", "validators", "create"]);
103
+ program.parse(["node", "test", "localnet", "validators", "create"]);
102
104
  expect(ValidatorsAction).toHaveBeenCalledTimes(1);
103
105
  expect(ValidatorsAction.prototype.createValidator).toHaveBeenCalledWith({
104
106
  stake: "1",
@@ -110,6 +112,7 @@ describe("validators command", () => {
110
112
  program.parse([
111
113
  "node",
112
114
  "test",
115
+ "localnet",
113
116
  "validators",
114
117
  "create",
115
118
  "--stake",
@@ -123,5 +126,6 @@ describe("validators command", () => {
123
126
  config: '{"temperature":0.8}',
124
127
  });
125
128
  });
126
-
127
129
  });
130
+
131
+
@@ -25,7 +25,7 @@ vi.mock("../src/commands/config", () => ({
25
25
  initializeConfigCommands: vi.fn(),
26
26
  }));
27
27
 
28
- vi.mock("../src/commands/validators", () => ({
28
+ vi.mock("../src/commands/localnet", () => ({
29
29
  initializeValidatorCommands: vi.fn(),
30
30
  }));
31
31