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
@@ -1,73 +0,0 @@
1
- import util from "node:util";
2
- import {ChildProcess, exec} from "child_process";
3
- import open from "open";
4
-
5
- import {RunningPlatform, AVAILABLE_PLATFORMS} from "../config/simulator";
6
- import {MissingRequirementError} from "../errors/missingRequirement";
7
-
8
- export async function checkCommand(command: string, toolName: string): Promise<void> {
9
- try {
10
- await util.promisify(exec)(command);
11
- }catch (error:any) {
12
- if (error.stderr) {
13
- throw new MissingRequirementError(toolName);
14
- }
15
- }
16
- }
17
-
18
- type ExecuteCommandResult = {
19
- stdout: string;
20
- stderr: string;
21
- };
22
-
23
- type ExecuteCommandByPlatformInput = {
24
- [key in RunningPlatform]: string;
25
- };
26
-
27
- export async function executeCommand(
28
- cmdsByPlatform: ExecuteCommandByPlatformInput,
29
- toolName?: string,
30
- ): Promise<ExecuteCommandResult> {
31
- const runningPlatform = getPlatform();
32
- const command = cmdsByPlatform[runningPlatform];
33
- try {
34
- return await util.promisify(exec)(command);
35
- } catch (error: any) {
36
- throw new Error(`Error executing ${toolName || command}: ${error.message}.`);
37
- }
38
- }
39
-
40
- function getPlatform(): RunningPlatform {
41
- const currentPlatform = process.platform as RunningPlatform;
42
- if (!AVAILABLE_PLATFORMS.includes(currentPlatform)) {
43
- throw new Error(`Unsupported platform: ${currentPlatform}.`);
44
- }
45
- return currentPlatform;
46
- }
47
-
48
- export function openUrl(url: string): Promise<ChildProcess> {
49
- return open(url);
50
- }
51
-
52
- export async function getVersion(toolName: string): Promise<string> {
53
- try {
54
- const toolResponse = await util.promisify(exec)(`${toolName} --version`);
55
-
56
- if (toolResponse.stderr) {
57
- throw new Error(toolResponse.stderr);
58
- }
59
-
60
- try {
61
- const versionMatch = toolResponse.stdout.match(/(\d+\.\d+\.\d+)/);
62
- if (versionMatch) {
63
- return versionMatch[1];
64
- }
65
- } catch (err) {
66
- throw new Error(`Could not parse ${toolName} version.`);
67
- }
68
- } catch (error) {
69
- throw new Error(`Error getting ${toolName} version.`);
70
- }
71
-
72
- return "";
73
- }
@@ -1,194 +0,0 @@
1
- import path from "path";
2
- import os from "os";
3
- import fs from "fs";
4
-
5
- export interface AccountInfo {
6
- name: string;
7
- address: string;
8
- path: string;
9
- }
10
-
11
- export class ConfigFileManager {
12
- private folderPath: string;
13
- private configFilePath: string;
14
- private keystoresPath: string;
15
-
16
- constructor(baseFolder: string = ".genlayer/", configFileName: string = "genlayer-config.json") {
17
- this.folderPath = path.resolve(os.homedir(), baseFolder);
18
- this.configFilePath = path.resolve(this.folderPath, configFileName);
19
- this.keystoresPath = path.resolve(this.folderPath, "keystores");
20
- this.ensureFolderExists();
21
- this.ensureKeystoresDirExists();
22
- this.ensureConfigFileExists();
23
- this.migrateOldConfig();
24
- this.migrateKeystoreFormats();
25
- }
26
-
27
- private ensureFolderExists(): void {
28
- if (!fs.existsSync(this.folderPath)) {
29
- fs.mkdirSync(this.folderPath, { recursive: true });
30
- }
31
- }
32
-
33
- private ensureKeystoresDirExists(): void {
34
- if (!fs.existsSync(this.keystoresPath)) {
35
- fs.mkdirSync(this.keystoresPath, { recursive: true });
36
- }
37
- }
38
-
39
- private ensureConfigFileExists(): void {
40
- if (!fs.existsSync(this.configFilePath)) {
41
- fs.writeFileSync(this.configFilePath, JSON.stringify({}, null, 2));
42
- }
43
- }
44
-
45
- private migrateOldConfig(): void {
46
- const config = this.getConfig();
47
- if (config.keyPairPath && !config.activeAccount) {
48
- const oldPath = config.keyPairPath;
49
- if (fs.existsSync(oldPath)) {
50
- const newPath = this.getKeystorePath("default");
51
- // Read old keystore and convert format if needed
52
- const content = fs.readFileSync(oldPath, "utf-8");
53
- const web3Content = this.convertToWeb3Format(content);
54
- fs.writeFileSync(newPath, web3Content);
55
- delete config.keyPairPath;
56
- config.activeAccount = "default";
57
- fs.writeFileSync(this.configFilePath, JSON.stringify(config, null, 2));
58
- }
59
- }
60
- }
61
-
62
- private migrateKeystoreFormats(): void {
63
- if (!fs.existsSync(this.keystoresPath)) {
64
- return;
65
- }
66
- const files = fs.readdirSync(this.keystoresPath);
67
- if (!Array.isArray(files)) {
68
- return;
69
- }
70
- for (const file of files) {
71
- if (!file.endsWith(".json")) continue;
72
- const filePath = path.resolve(this.keystoresPath, file);
73
- try {
74
- const content = fs.readFileSync(filePath, "utf-8");
75
- const parsed = JSON.parse(content);
76
- // Check if it's old GenLayer format (has 'encrypted' string field)
77
- if (parsed.encrypted && typeof parsed.encrypted === "string") {
78
- const web3Content = this.convertToWeb3Format(content);
79
- fs.writeFileSync(filePath, web3Content);
80
- }
81
- // If it has 'crypto' field, it's already web3 format - skip
82
- } catch {
83
- // Skip files that can't be parsed
84
- }
85
- }
86
- }
87
-
88
- private convertToWeb3Format(content: string): string {
89
- try {
90
- const parsed = JSON.parse(content);
91
- // If it's GenLayer wrapper format (has 'encrypted' string field)
92
- if (parsed.encrypted && typeof parsed.encrypted === "string") {
93
- // The 'encrypted' field contains the actual web3 keystore JSON
94
- return parsed.encrypted;
95
- }
96
- // Already web3 format or unknown - return as-is
97
- return content;
98
- } catch {
99
- return content;
100
- }
101
- }
102
-
103
- getFolderPath(): string {
104
- return this.folderPath;
105
- }
106
-
107
- getFilePath(fileName: string): string {
108
- return path.resolve(this.folderPath, fileName);
109
- }
110
-
111
- getConfig(): Record<string, any> {
112
- const configContent = fs.readFileSync(this.configFilePath, "utf-8");
113
- return JSON.parse(configContent);
114
- }
115
-
116
- getConfigByKey(key: string): any {
117
- const config = this.getConfig();
118
- return config[key] !== undefined ? config[key] : null;
119
- }
120
-
121
- writeConfig(key: string, value: any): void {
122
- const config = this.getConfig();
123
- config[key] = value;
124
- fs.writeFileSync(this.configFilePath, JSON.stringify(config, null, 2));
125
- }
126
-
127
- removeConfig(key: string): void {
128
- const config = this.getConfig();
129
- delete config[key];
130
- fs.writeFileSync(this.configFilePath, JSON.stringify(config, null, 2));
131
- }
132
-
133
- getKeystoresPath(): string {
134
- return this.keystoresPath;
135
- }
136
-
137
- getKeystorePath(name: string): string {
138
- return path.resolve(this.keystoresPath, `${name}.json`);
139
- }
140
-
141
- accountExists(name: string): boolean {
142
- return fs.existsSync(this.getKeystorePath(name));
143
- }
144
-
145
- getActiveAccount(): string | null {
146
- return this.getConfigByKey("activeAccount");
147
- }
148
-
149
- setActiveAccount(name: string): void {
150
- if (!this.accountExists(name)) {
151
- throw new Error(`Account '${name}' does not exist`);
152
- }
153
- this.writeConfig("activeAccount", name);
154
- }
155
-
156
- listAccounts(): AccountInfo[] {
157
- if (!fs.existsSync(this.keystoresPath)) {
158
- return [];
159
- }
160
- const files = fs.readdirSync(this.keystoresPath);
161
- const accounts: AccountInfo[] = [];
162
-
163
- for (const file of files) {
164
- if (!file.endsWith(".json")) continue;
165
- const name = file.replace(".json", "");
166
- const filePath = this.getKeystorePath(name);
167
- try {
168
- const content = JSON.parse(fs.readFileSync(filePath, "utf-8"));
169
- const addr = content.address || "unknown";
170
- accounts.push({
171
- name,
172
- address: addr.startsWith("0x") ? addr : `0x${addr}`,
173
- path: filePath,
174
- });
175
- } catch {
176
- // Skip invalid files
177
- }
178
- }
179
- return accounts;
180
- }
181
-
182
- removeAccount(name: string): void {
183
- const keystorePath = this.getKeystorePath(name);
184
- if (!fs.existsSync(keystorePath)) {
185
- throw new Error(`Account '${name}' does not exist`);
186
- }
187
- fs.unlinkSync(keystorePath);
188
-
189
- // If this was the active account, clear it
190
- if (this.getActiveAccount() === name) {
191
- this.removeConfig("activeAccount");
192
- }
193
- }
194
- }
@@ -1,89 +0,0 @@
1
- type Keytar = typeof import('keytar').default;
2
-
3
- let keytarModule: Keytar | null = null;
4
- let keytarLoadAttempted = false;
5
-
6
- async function getKeytar(): Promise<Keytar | null> {
7
- if (keytarLoadAttempted) return keytarModule;
8
- keytarLoadAttempted = true;
9
- try {
10
- const mod = await import('keytar');
11
- keytarModule = mod.default ?? mod;
12
- return keytarModule;
13
- } catch {
14
- return null;
15
- }
16
- }
17
-
18
- export class KeychainManager {
19
- private static readonly SERVICE = 'genlayer-cli';
20
-
21
- constructor() {}
22
-
23
- private getKeychainAccount(accountName: string): string {
24
- return `account:${accountName}`;
25
- }
26
-
27
- async isKeychainAvailable(): Promise<boolean> {
28
- try {
29
- const keytar = await getKeytar();
30
- if (!keytar) return false;
31
- await keytar.findCredentials('test-service');
32
- return true;
33
- } catch {
34
- return false;
35
- }
36
- }
37
-
38
- async storePrivateKey(accountName: string, privateKey: string): Promise<void> {
39
- const keytar = await getKeytar();
40
- if (!keytar) throw new Error('Keychain not available. Install libsecret-1-dev on Linux.');
41
- try {
42
- return await keytar.setPassword(KeychainManager.SERVICE, this.getKeychainAccount(accountName), privateKey);
43
- } catch (error: any) {
44
- if (error?.message?.includes('org.freedesktop.secrets')) {
45
- throw new Error('Keychain service not running. Install and start gnome-keyring or another secrets service.');
46
- }
47
- throw error;
48
- }
49
- }
50
-
51
- async getPrivateKey(accountName: string): Promise<string | null> {
52
- const keytar = await getKeytar();
53
- if (!keytar) return null;
54
- try {
55
- return await keytar.getPassword(KeychainManager.SERVICE, this.getKeychainAccount(accountName));
56
- } catch {
57
- return null;
58
- }
59
- }
60
-
61
- async removePrivateKey(accountName: string): Promise<boolean> {
62
- const keytar = await getKeytar();
63
- if (!keytar) return false;
64
- try {
65
- return await keytar.deletePassword(KeychainManager.SERVICE, this.getKeychainAccount(accountName));
66
- } catch {
67
- return false;
68
- }
69
- }
70
-
71
- async listUnlockedAccounts(): Promise<string[]> {
72
- const keytar = await getKeytar();
73
- if (!keytar) return [];
74
- try {
75
- const credentials = await keytar.findCredentials(KeychainManager.SERVICE);
76
- return credentials
77
- .map(c => c.account)
78
- .filter(a => a.startsWith('account:'))
79
- .map(a => a.replace('account:', ''));
80
- } catch {
81
- return [];
82
- }
83
- }
84
-
85
- async isAccountUnlocked(accountName: string): Promise<boolean> {
86
- const key = await this.getPrivateKey(accountName);
87
- return key !== null;
88
- }
89
- }
@@ -1,68 +0,0 @@
1
- export const localnetCompatibleVersion = "v0.65.0";
2
- export const DEFAULT_JSON_RPC_URL = "http://localhost:4000/api";
3
- export const CONTAINERS_NAME_PREFIX = "/genlayer-";
4
- export const IMAGES_NAME_PREFIX = "yeagerai";
5
- export const DEFAULT_RUN_SIMULATOR_COMMAND = (location: string, profiles: string) => ({
6
- darwin: `osascript -e 'tell application "Terminal" to do script "cd ${location} && docker compose build && docker compose -p genlayer ${profiles} up"'`,
7
- win32: `start cmd.exe /c "cd /d ${location} && docker compose build && docker compose -p genlayer ${profiles} up && pause"`,
8
- linux: `nohup bash -c 'cd ${location} && docker compose build && docker compose -p genlayer ${profiles} up -d '`,
9
- });
10
- export const DEFAULT_RUN_DOCKER_COMMAND = {
11
- darwin: "open -a Docker",
12
- win32: 'start "" "C:\\Program Files\\Docker\\Docker\\Docker Desktop.exe"',
13
- linux: "sudo systemctl start docker",
14
- };
15
-
16
- export const VERSION_REQUIREMENTS = {
17
- docker: "25.0.0",
18
- node: "18.0.0",
19
- };
20
-
21
- export const AVAILABLE_PLATFORMS = ["darwin", "win32", "linux"] as const;
22
- export type RunningPlatform = (typeof AVAILABLE_PLATFORMS)[number];
23
- export const STARTING_TIMEOUT_WAIT_CYLCE = 2000;
24
- export const STARTING_TIMEOUT_ATTEMPTS = 120;
25
-
26
- export type AiProviders = "ollama" | "openai" | "heuristai" | "geminiai" | "xai";
27
- export type AiProvidersEnvVars = "ollama" | "OPENAIKEY" | "HEURISTAIAPIKEY" | "GEMINI_API_KEY" | "XAI_API_KEY";
28
- export type AiProvidersConfigType = {
29
- [key in AiProviders]: {name: string; hint: string; envVar?: AiProvidersEnvVars; cliOptionValue: string};
30
- };
31
-
32
- export const AI_PROVIDERS_CONFIG: AiProvidersConfigType = {
33
- ollama: {
34
- name: "Ollama",
35
- hint: "(By default, this will download and run a local instance of Llama 3)",
36
- cliOptionValue: "ollama",
37
- },
38
- openai: {
39
- name: "OpenAI",
40
- hint: "(You will need to provide an OpenAI API key)",
41
- envVar: "OPENAIKEY",
42
- cliOptionValue: "openai",
43
- },
44
- heuristai: {
45
- name: "Heurist",
46
- hint: '(You will need to provide an API key. Get free API credits at https://dev-api-form.heurist.ai/ with referral code: "genlayer")',
47
- envVar: "HEURISTAIAPIKEY",
48
- cliOptionValue: "heuristai",
49
- },
50
- geminiai: {
51
- name: "Gemini",
52
- hint: '(You will need to provide an API key.)',
53
- envVar: "GEMINI_API_KEY",
54
- cliOptionValue: "geminiai",
55
- },
56
- xai: {
57
- name: "XAI",
58
- hint: '(You will need to provide an API key)',
59
- envVar: "XAI_API_KEY",
60
- cliOptionValue: "xai",
61
- },
62
- };
63
-
64
- export const GENLAYER_REQUIRED_CONTAINERS = [
65
- "genlayer-jsonrpc",
66
- "genlayer-webrequest",
67
- "genlayer-postgres"
68
- ]
@@ -1,2 +0,0 @@
1
- export const CLI_DESCRIPTION =
2
- "GenLayer CLI is a development environment for the GenLayer ecosystem. It allows developers to interact with the protocol by creating accounts, sending transactions, and working with Intelligent Contracts by testing, debugging, and deploying them.";
@@ -1,9 +0,0 @@
1
- export class MissingRequirementError extends Error {
2
- requirement: string;
3
-
4
- constructor(requirement: string) {
5
- super(`${requirement} is not installed. Please install ${requirement}.`);
6
- this.name = "MissingRequirement";
7
- this.requirement = requirement;
8
- }
9
- }
@@ -1,9 +0,0 @@
1
- export class VersionRequiredError extends Error {
2
- tool: string;
3
-
4
- constructor(tool: string, requiredVersion: string) {
5
- super(`${tool} version ${requiredVersion} or higher is required. Please update ${tool}.`);
6
- this.name = "VersionRequired";
7
- this.tool = tool;
8
- }
9
- }
@@ -1,37 +0,0 @@
1
- import {AiProviders} from "../config/simulator";
2
-
3
- export interface ISimulatorService {
4
- setComposeOptions(headless: boolean, disableOllama?: boolean): void;
5
- getComposeOptions(): string;
6
- checkInstallRequirements(): Promise<Record<string, boolean>>;
7
- checkVersionRequirements(): Promise<Record<string, string>>;
8
- runSimulator(): Promise<{stdout: string; stderr: string}>;
9
- waitForSimulatorToBeReady(retries?: number): Promise<WaitForSimulatorToBeReadyResultType>;
10
- createRandomValidators(numValidators: number, llmProviders: AiProviders[]): Promise<any>;
11
- deleteAllValidators(): Promise<any>;
12
- getAiProvidersOptions(withHint: boolean, excludeProviders?: AiProviders[]): Array<{name: string; value: string}>;
13
- getFrontendUrl(): string;
14
- openFrontend(): Promise<boolean>;
15
- stopDockerContainers(): Promise<void>;
16
- resetDockerContainers(): Promise<void>;
17
- resetDockerImages(): Promise<void>;
18
- resetDockerVolumes(): Promise<void>;
19
- checkCliVersion(): Promise<void>;
20
- cleanDatabase(): Promise<boolean>;
21
- addConfigToEnvFile(newConfig: Record<string, string>): void;
22
- normalizeLocalnetVersion(version: string): string;
23
- compareVersions(version1: string, version2: string): number;
24
- isLocalnetRunning(): Promise<boolean>;
25
- }
26
-
27
-
28
- export type WaitForSimulatorToBeReadyResultType = {
29
- initialized: boolean;
30
- errorCode?: "TIMEOUT" | "ERROR";
31
- errorMessage?: string;
32
- };
33
-
34
- export type InitializeDatabaseResultType = {
35
- createResponse: any;
36
- tablesResponse: any;
37
- };