@cfxdevkit/devnode 0.1.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/README.md +35 -0
- package/dist/index.cjs +1033 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +234 -0
- package/dist/index.d.ts +234 -0
- package/dist/index.js +998 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.cjs +1026 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.cts +54 -0
- package/dist/plugin.d.ts +54 -0
- package/dist/plugin.js +993 -0
- package/dist/plugin.js.map +1 -0
- package/dist/types.cjs +42 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +72 -0
- package/dist/types.d.ts +72 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/package.json +90 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @cfxdevkit/devnode
|
|
2
|
+
|
|
3
|
+
Programmatic wrapper around `@xcfx/node` for running a local Conflux Core + eSpace dev environment.
|
|
4
|
+
|
|
5
|
+
## What's inside
|
|
6
|
+
|
|
7
|
+
- `ServerManager` — start/stop the local node, mine blocks, fund accounts
|
|
8
|
+
- Configuration defaults tuned for the DevKit workspace (chainId 2029, evmChainId 2030)
|
|
9
|
+
- Helpers for mining, genesis accounts, and RPC URL resolution
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { ServerManager } from '@cfxdevkit/devnode';
|
|
15
|
+
|
|
16
|
+
const node = new ServerManager();
|
|
17
|
+
await node.start();
|
|
18
|
+
|
|
19
|
+
const accounts = node.getAccounts(); // pre-funded genesis accounts
|
|
20
|
+
await node.mine(5); // mine 5 blocks
|
|
21
|
+
await node.startMining(500); // auto-mine every 500 ms
|
|
22
|
+
await node.stop();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Running
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm --filter @cfxdevkit/devnode build
|
|
29
|
+
pnpm --filter @cfxdevkit/devnode test
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## When to use
|
|
33
|
+
|
|
34
|
+
Import `ServerManager` from `@cfxdevkit/devnode` to control a local Conflux node in automated tests,
|
|
35
|
+
CI pipelines, or from the `conflux-devkit` backend.
|