PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@aptos-labs/ts-sdk/dist/esm/cli
Просмотр файла: localNode.d.mts
import { ChildProcessWithoutNullStreams } from 'child_process';
/**
* Represents a local node for running a testnet environment.
* This class provides methods to start, stop, and check the status of the local testnet process.
* It manages the lifecycle of the node process and ensures that it is operational before executing tests.
*/
declare class LocalNode {
readonly MAXIMUM_WAIT_TIME_SEC = 75;
readonly READINESS_ENDPOINT = "http://127.0.0.1:8070/";
showStdout: boolean;
process: ChildProcessWithoutNullStreams | null;
constructor(args?: {
showStdout?: boolean;
});
/**
* Kills the current process and all its descendant processes.
*
* @returns {Promise<void>} A promise that resolves to true if the process was successfully killed.
* @throws {Error} If there is an error while attempting to kill the process.
*/
stop(): Promise<void>;
/**
* Runs a local testnet and waits for the process to be up.
* If the local node process is already running, it returns without starting the process.
*
* @returns {Promise<void>} A promise that resolves when the process is up.
*/
run(): Promise<void>;
/**
* Starts the local testnet by running the Aptos node with the specified command-line arguments.
*
* @returns {void}
*
* @throws {Error} If there is an issue starting the local testnet.
*/
start(): void;
/**
* Waits for the local testnet process to be operational within a specified maximum wait time.
* This function continuously checks if the process is up and will throw an error if it fails to start.
*
* @returns Promise<boolean> - Resolves to true if the process is up, otherwise throws an error.
*/
waitUntilProcessIsUp(): Promise<boolean>;
/**
* Checks if the local testnet is up by querying the readiness endpoint.
*
* @returns Promise<boolean> - A promise that resolves to true if the testnet is up, otherwise false.
*/
checkIfProcessIsUp(): Promise<boolean>;
}
export { LocalNode };
Выполнить команду
Для локальной разработки. Не используйте в интернете!