@aaronbassett/midnight-local-devnet 0.1.2 → 0.2.1
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 +44 -5
- package/dist/cli/commands/dashboard.d.ts +3 -0
- package/dist/cli/commands/dashboard.js +20 -0
- package/dist/cli/commands/dashboard.js.map +1 -0
- package/dist/cli/commands/interactive.d.ts +3 -0
- package/dist/cli/commands/interactive.js +16 -0
- package/dist/cli/commands/interactive.js.map +1 -0
- package/dist/cli/dashboard/app.d.ts +9 -0
- package/dist/cli/dashboard/app.js +106 -0
- package/dist/cli/dashboard/app.js.map +1 -0
- package/dist/cli/dashboard/components/gauge.d.ts +9 -0
- package/dist/cli/dashboard/components/gauge.js +10 -0
- package/dist/cli/dashboard/components/gauge.js.map +1 -0
- package/dist/cli/dashboard/components/panel-box.d.ts +10 -0
- package/dist/cli/dashboard/components/panel-box.js +6 -0
- package/dist/cli/dashboard/components/panel-box.js.map +1 -0
- package/dist/cli/dashboard/components/sparkline.d.ts +9 -0
- package/dist/cli/dashboard/components/sparkline.js +25 -0
- package/dist/cli/dashboard/components/sparkline.js.map +1 -0
- package/dist/cli/dashboard/components/status-badge.d.ts +6 -0
- package/dist/cli/dashboard/components/status-badge.js +24 -0
- package/dist/cli/dashboard/components/status-badge.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-breakpoint.d.ts +7 -0
- package/dist/cli/dashboard/hooks/use-breakpoint.js +15 -0
- package/dist/cli/dashboard/hooks/use-breakpoint.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-health.d.ts +9 -0
- package/dist/cli/dashboard/hooks/use-health.js +35 -0
- package/dist/cli/dashboard/hooks/use-health.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-indexer-info.d.ts +5 -0
- package/dist/cli/dashboard/hooks/use-indexer-info.js +19 -0
- package/dist/cli/dashboard/hooks/use-indexer-info.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-logs.d.ts +19 -0
- package/dist/cli/dashboard/hooks/use-logs.js +55 -0
- package/dist/cli/dashboard/hooks/use-logs.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-node-info.d.ts +21 -0
- package/dist/cli/dashboard/hooks/use-node-info.js +49 -0
- package/dist/cli/dashboard/hooks/use-node-info.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-polling.d.ts +7 -0
- package/dist/cli/dashboard/hooks/use-polling.js +35 -0
- package/dist/cli/dashboard/hooks/use-polling.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-proof-server.d.ts +7 -0
- package/dist/cli/dashboard/hooks/use-proof-server.js +14 -0
- package/dist/cli/dashboard/hooks/use-proof-server.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-services.d.ts +3 -0
- package/dist/cli/dashboard/hooks/use-services.js +6 -0
- package/dist/cli/dashboard/hooks/use-services.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-terminal-size.d.ts +5 -0
- package/dist/cli/dashboard/hooks/use-terminal-size.js +22 -0
- package/dist/cli/dashboard/hooks/use-terminal-size.js.map +1 -0
- package/dist/cli/dashboard/hooks/use-wallet-state.d.ts +10 -0
- package/dist/cli/dashboard/hooks/use-wallet-state.js +63 -0
- package/dist/cli/dashboard/hooks/use-wallet-state.js.map +1 -0
- package/dist/cli/dashboard/layouts/large.d.ts +7 -0
- package/dist/cli/dashboard/layouts/large.js +13 -0
- package/dist/cli/dashboard/layouts/large.js.map +1 -0
- package/dist/cli/dashboard/layouts/medium.d.ts +7 -0
- package/dist/cli/dashboard/layouts/medium.js +11 -0
- package/dist/cli/dashboard/layouts/medium.js.map +1 -0
- package/dist/cli/dashboard/layouts/small.d.ts +7 -0
- package/dist/cli/dashboard/layouts/small.js +11 -0
- package/dist/cli/dashboard/layouts/small.js.map +1 -0
- package/dist/cli/dashboard/lib/log-parser.d.ts +15 -0
- package/dist/cli/dashboard/lib/log-parser.js +44 -0
- package/dist/cli/dashboard/lib/log-parser.js.map +1 -0
- package/dist/cli/dashboard/lib/proof-server-api.d.ts +15 -0
- package/dist/cli/dashboard/lib/proof-server-api.js +48 -0
- package/dist/cli/dashboard/lib/proof-server-api.js.map +1 -0
- package/dist/cli/dashboard/lib/substrate-rpc.d.ts +16 -0
- package/dist/cli/dashboard/lib/substrate-rpc.js +39 -0
- package/dist/cli/dashboard/lib/substrate-rpc.js.map +1 -0
- package/dist/cli/dashboard/panels/indexer-panel.d.ts +11 -0
- package/dist/cli/dashboard/panels/indexer-panel.js +17 -0
- package/dist/cli/dashboard/panels/indexer-panel.js.map +1 -0
- package/dist/cli/dashboard/panels/log-panel.d.ts +13 -0
- package/dist/cli/dashboard/panels/log-panel.js +27 -0
- package/dist/cli/dashboard/panels/log-panel.js.map +1 -0
- package/dist/cli/dashboard/panels/node-panel.d.ts +10 -0
- package/dist/cli/dashboard/panels/node-panel.js +17 -0
- package/dist/cli/dashboard/panels/node-panel.js.map +1 -0
- package/dist/cli/dashboard/panels/proof-panel.d.ts +10 -0
- package/dist/cli/dashboard/panels/proof-panel.js +20 -0
- package/dist/cli/dashboard/panels/proof-panel.js.map +1 -0
- package/dist/cli/dashboard/panels/response-graph.d.ts +10 -0
- package/dist/cli/dashboard/panels/response-graph.js +12 -0
- package/dist/cli/dashboard/panels/response-graph.js.map +1 -0
- package/dist/cli/dashboard/panels/wallet-panel.d.ts +9 -0
- package/dist/cli/dashboard/panels/wallet-panel.js +24 -0
- package/dist/cli/dashboard/panels/wallet-panel.js.map +1 -0
- package/dist/cli/dashboard/types.d.ts +39 -0
- package/dist/cli/dashboard/types.js +2 -0
- package/dist/cli/dashboard/types.js.map +1 -0
- package/dist/cli.js +18 -18
- package/dist/cli.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { usePolling } from './use-polling.js';
|
|
3
|
+
import { fetchSystemChain, fetchSystemName, fetchSystemVersion, fetchSystemHealth, fetchBestBlockHeader, } from '../lib/substrate-rpc.js';
|
|
4
|
+
async function fetchNodeInfo(nodeUrl) {
|
|
5
|
+
const [chainName, nodeName, version, health, header] = await Promise.all([
|
|
6
|
+
fetchSystemChain(nodeUrl),
|
|
7
|
+
fetchSystemName(nodeUrl),
|
|
8
|
+
fetchSystemVersion(nodeUrl),
|
|
9
|
+
fetchSystemHealth(nodeUrl),
|
|
10
|
+
fetchBestBlockHeader(nodeUrl),
|
|
11
|
+
]);
|
|
12
|
+
return {
|
|
13
|
+
chainName,
|
|
14
|
+
nodeName,
|
|
15
|
+
version,
|
|
16
|
+
health,
|
|
17
|
+
bestBlock: header?.number ?? null,
|
|
18
|
+
avgBlockTime: null,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function useNodeInfo(nodeUrl) {
|
|
22
|
+
const blockHistory = useRef([]);
|
|
23
|
+
const polling = usePolling(() => fetchNodeInfo(nodeUrl), 5000);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (polling.data?.bestBlock != null) {
|
|
26
|
+
const now = Date.now();
|
|
27
|
+
const history = blockHistory.current;
|
|
28
|
+
history.push({ block: polling.data.bestBlock, time: now });
|
|
29
|
+
if (history.length > 20)
|
|
30
|
+
history.shift();
|
|
31
|
+
}
|
|
32
|
+
}, [polling.data?.bestBlock]);
|
|
33
|
+
const avgBlockTime = (() => {
|
|
34
|
+
const history = blockHistory.current;
|
|
35
|
+
if (history.length < 2)
|
|
36
|
+
return null;
|
|
37
|
+
const first = history[0];
|
|
38
|
+
const last = history[history.length - 1];
|
|
39
|
+
const blockDiff = last.block - first.block;
|
|
40
|
+
if (blockDiff <= 0)
|
|
41
|
+
return null;
|
|
42
|
+
return (last.time - first.time) / blockDiff / 1000;
|
|
43
|
+
})();
|
|
44
|
+
return {
|
|
45
|
+
...polling,
|
|
46
|
+
data: polling.data ? { ...polling.data, avgBlockTime } : null,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=use-node-info.js.map
|
|
@@ -0,0 +1 @@
|
|
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EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;YAC3D,IAAI,OAAO,CAAC,MAAM,GAAG,EAAE;gBAAE,OAAO,CAAC,KAAK,EAAE,CAAC;QAC3C,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IAE9B,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE;QACzB,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;QACrC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QACpC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC3C,IAAI,SAAS,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QAChC,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IACrD,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO;QACL,GAAG,OAAO;QACV,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI;KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function createPoller<T>(fetcher: () => Promise<T>, intervalMs: number, onData: (data: T) => void, onError: (error: unknown) => void): () => void;
|
|
2
|
+
export interface PollingState<T> {
|
|
3
|
+
data: T | null;
|
|
4
|
+
error: unknown | null;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function usePolling<T>(fetcher: () => Promise<T>, intervalMs: number): PollingState<T>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useState, useEffect, useRef } from 'react';
|
|
2
|
+
export function createPoller(fetcher, intervalMs, onData, onError) {
|
|
3
|
+
let stopped = false;
|
|
4
|
+
const poll = async () => {
|
|
5
|
+
if (stopped)
|
|
6
|
+
return;
|
|
7
|
+
try {
|
|
8
|
+
const data = await fetcher();
|
|
9
|
+
if (!stopped)
|
|
10
|
+
onData(data);
|
|
11
|
+
}
|
|
12
|
+
catch (err) {
|
|
13
|
+
if (!stopped)
|
|
14
|
+
onError(err);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
// Initial fetch
|
|
18
|
+
void poll();
|
|
19
|
+
const timer = setInterval(() => void poll(), intervalMs);
|
|
20
|
+
return () => {
|
|
21
|
+
stopped = true;
|
|
22
|
+
clearInterval(timer);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function usePolling(fetcher, intervalMs) {
|
|
26
|
+
const [state, setState] = useState({ data: null, error: null, loading: true });
|
|
27
|
+
const fetcherRef = useRef(fetcher);
|
|
28
|
+
fetcherRef.current = fetcher;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const stop = createPoller(() => fetcherRef.current(), intervalMs, (data) => setState({ data, error: null, loading: false }), (error) => setState((prev) => ({ ...prev, error, loading: false })));
|
|
31
|
+
return stop;
|
|
32
|
+
}, [intervalMs]);
|
|
33
|
+
return state;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=use-polling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-polling.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/hooks/use-polling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpD,MAAM,UAAU,YAAY,CAC1B,OAAyB,EACzB,UAAkB,EAClB,MAAyB,EACzB,OAAiC;IAEjC,IAAI,OAAO,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AC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CACpE,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ProofServerReady } from '../lib/proof-server-api.js';
|
|
2
|
+
export interface ProofServerInfo {
|
|
3
|
+
version: string | null;
|
|
4
|
+
proofVersions: string[] | null;
|
|
5
|
+
ready: ProofServerReady | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function useProofServer(proofServerUrl: string): import("./use-polling.js").PollingState<ProofServerInfo>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { usePolling } from './use-polling.js';
|
|
2
|
+
import { fetchProofServerVersion, fetchProofServerReady, fetchProofVersions, } from '../lib/proof-server-api.js';
|
|
3
|
+
async function fetchAllProofServerInfo(baseUrl) {
|
|
4
|
+
const [version, ready, proofVersions] = await Promise.all([
|
|
5
|
+
fetchProofServerVersion(baseUrl),
|
|
6
|
+
fetchProofServerReady(baseUrl),
|
|
7
|
+
fetchProofVersions(baseUrl),
|
|
8
|
+
]);
|
|
9
|
+
return { version, ready, proofVersions };
|
|
10
|
+
}
|
|
11
|
+
export function useProofServer(proofServerUrl) {
|
|
12
|
+
return usePolling(() => fetchAllProofServerInfo(proofServerUrl), 10000);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=use-proof-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-proof-server.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/hooks/use-proof-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC;AAQpC,KAAK,UAAU,uBAAuB,CAAC,OAAe;IACpD,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACxD,uBAAuB,CAAC,OAAO,CAAC;QAChC,qBAAqB,CAAC,OAAO,CAAC;QAC9B,kBAAkB,CAAC,OAAO,CAAC;KAC5B,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,cAAsB;IACnD,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-services.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/hooks/use-services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,MAAM,UAAU,WAAW;IACzB,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useStdout } from 'ink';
|
|
3
|
+
export function useTerminalSize() {
|
|
4
|
+
const { stdout } = useStdout();
|
|
5
|
+
const [size, setSize] = useState({
|
|
6
|
+
columns: stdout?.columns ?? 80,
|
|
7
|
+
rows: stdout?.rows ?? 24,
|
|
8
|
+
});
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!stdout)
|
|
11
|
+
return;
|
|
12
|
+
const handleResize = () => {
|
|
13
|
+
setSize({ columns: stdout.columns, rows: stdout.rows });
|
|
14
|
+
};
|
|
15
|
+
stdout.on('resize', handleResize);
|
|
16
|
+
return () => {
|
|
17
|
+
stdout.off('resize', handleResize);
|
|
18
|
+
};
|
|
19
|
+
}, [stdout]);
|
|
20
|
+
return size;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=use-terminal-size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-terminal-size.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/hooks/use-terminal-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAOhC,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAe;QAC7C,OAAO,EAAE,MAAM,EAAE,OAAO,IAAI,EAAE;QAC9B,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE;KACzB,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM;YAAE,OAAO;QAEpB,MAAM,YAAY,GAAG,GAAG,EAAE;YACxB,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1D,CAAC,CAAC;QAEF,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAClC,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACrC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NetworkManager } from '../../../core/network-manager.js';
|
|
2
|
+
import type { WalletBalances } from '../../../core/types.js';
|
|
3
|
+
export interface WalletState {
|
|
4
|
+
connected: boolean;
|
|
5
|
+
connecting: boolean;
|
|
6
|
+
error: string | null;
|
|
7
|
+
balances: WalletBalances | null;
|
|
8
|
+
address: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function useWalletState(manager: NetworkManager): WalletState;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { getWalletBalances } from '../../../core/wallet.js';
|
|
3
|
+
export function useWalletState(manager) {
|
|
4
|
+
const [state, setState] = useState({
|
|
5
|
+
connected: false,
|
|
6
|
+
connecting: false,
|
|
7
|
+
error: null,
|
|
8
|
+
balances: null,
|
|
9
|
+
address: null,
|
|
10
|
+
});
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
let cancelled = false;
|
|
13
|
+
let timer = null;
|
|
14
|
+
const connect = async () => {
|
|
15
|
+
if (manager.getStatus() !== 'running') {
|
|
16
|
+
setState({ connected: false, connecting: false, error: 'Network not running', balances: null, address: null });
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
setState((prev) => ({ ...prev, connecting: true, error: null }));
|
|
20
|
+
try {
|
|
21
|
+
const wallet = await manager.ensureWallet();
|
|
22
|
+
if (cancelled)
|
|
23
|
+
return;
|
|
24
|
+
const balances = await getWalletBalances(wallet);
|
|
25
|
+
if (cancelled)
|
|
26
|
+
return;
|
|
27
|
+
setState({ connected: true, connecting: false, error: null, balances, address: 'master' });
|
|
28
|
+
timer = setInterval(async () => {
|
|
29
|
+
if (cancelled)
|
|
30
|
+
return;
|
|
31
|
+
try {
|
|
32
|
+
const b = await getWalletBalances(wallet);
|
|
33
|
+
if (!cancelled) {
|
|
34
|
+
setState((prev) => ({ ...prev, balances: b }));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// Ignore polling errors
|
|
39
|
+
}
|
|
40
|
+
}, 10000);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
if (!cancelled) {
|
|
44
|
+
setState({
|
|
45
|
+
connected: false,
|
|
46
|
+
connecting: false,
|
|
47
|
+
error: err instanceof Error ? err.message : 'Wallet connection failed',
|
|
48
|
+
balances: null,
|
|
49
|
+
address: null,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
void connect();
|
|
55
|
+
return () => {
|
|
56
|
+
cancelled = true;
|
|
57
|
+
if (timer)
|
|
58
|
+
clearInterval(timer);
|
|
59
|
+
};
|
|
60
|
+
}, [manager, manager.getStatus()]);
|
|
61
|
+
return state;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=use-wallet-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-wallet-state.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/hooks/use-wallet-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAU5D,MAAM,UAAU,cAAc,CAAC,OAAuB;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAc;QAC9C,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,IAAI,KAAK,GAA0C,IAAI,CAAC;QAExD,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;YACzB,IAAI,OAAO,CAAC,SAAS,EAAE,KAAK,SAAS,EAAE,CAAC;gBACtC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,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AAC,0BAA0B;wBACtE,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,IAAI;qBACd,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,KAAK,OAAO,EAAE,CAAC;QAEf,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;YACjB,IAAI,KAAK;gBAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAEnC,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from 'ink';
|
|
3
|
+
import { NodePanel } from '../panels/node-panel.js';
|
|
4
|
+
import { IndexerPanel } from '../panels/indexer-panel.js';
|
|
5
|
+
import { ProofPanel } from '../panels/proof-panel.js';
|
|
6
|
+
import { WalletPanel } from '../panels/wallet-panel.js';
|
|
7
|
+
import { LogPanel } from '../panels/log-panel.js';
|
|
8
|
+
import { ResponseGraph } from '../panels/response-graph.js';
|
|
9
|
+
export function LargeLayout({ data }) {
|
|
10
|
+
const halfWidth = Math.floor(data.columns / 2);
|
|
11
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "25%", children: _jsx(NodePanel, { data: data.node, loading: data.nodeLoading, focused: data.focusedPanel === 'node' }) }), _jsx(Box, { width: "25%", children: _jsx(IndexerPanel, { data: data.indexer, nodeBlock: data.node?.bestBlock ?? null, loading: data.indexerLoading, focused: data.focusedPanel === 'indexer' }) }), _jsx(Box, { width: "25%", children: _jsx(ProofPanel, { data: data.proofServer, loading: data.proofServerLoading, focused: data.focusedPanel === 'proof' }) }), _jsx(Box, { width: "25%", children: _jsx(WalletPanel, { wallet: data.wallet, focused: data.focusedPanel === 'wallet' }) })] }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "50%", children: _jsx(ResponseGraph, { nodeHistory: data.healthHistory.nodeHistory, indexerHistory: data.healthHistory.indexerHistory, proofServerHistory: data.healthHistory.proofServerHistory, focused: data.focusedPanel === 'graph', width: halfWidth - 4 }) }), _jsx(Box, { width: "50%", children: _jsx(LogPanel, { lines: data.logs.lines, filter: data.logs.filter, scrollOffset: data.logs.scrollOffset, maxLines: Math.max(5, data.rows - 12), focused: data.focusedPanel === 'logs', searchMode: data.searchMode, searchText: data.searchText }) })] })] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=large.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"large.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/layouts/large.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAO5D,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,EAAoB;IACpD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAE/C,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,aACtB,KAAC,GAAG,IAAC,KAAK,EAAC,KAAK,YACd,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAA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Q,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,EACrC,OAAO,EAAE,IAAI,CAAC,YAAY,KAAK,MAAM,EACrC,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,UAAU,EAAE,IAAI,CAAC,UAAU,GAC3B,GACE,IACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from 'ink';
|
|
3
|
+
import { NodePanel } from '../panels/node-panel.js';
|
|
4
|
+
import { IndexerPanel } from '../panels/indexer-panel.js';
|
|
5
|
+
import { ProofPanel } from '../panels/proof-panel.js';
|
|
6
|
+
import { WalletPanel } from '../panels/wallet-panel.js';
|
|
7
|
+
import { LogPanel } from '../panels/log-panel.js';
|
|
8
|
+
export function MediumLayout({ data }) {
|
|
9
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "50%", children: _jsx(NodePanel, { data: data.node, loading: data.nodeLoading, focused: data.focusedPanel === 'node' }) }), _jsx(Box, { width: "50%", children: _jsx(ProofPanel, { data: data.proofServer, loading: data.proofServerLoading, focused: data.focusedPanel === 'proof' }) })] }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "50%", children: _jsx(IndexerPanel, { data: data.indexer, nodeBlock: data.node?.bestBlock ?? null, loading: data.indexerLoading, focused: data.focusedPanel === 'indexer' }) }), _jsx(Box, { width: "50%", children: _jsx(WalletPanel, { wallet: data.wallet, focused: data.focusedPanel === 'wallet' }) })] }), _jsx(LogPanel, { lines: data.logs.lines, filter: data.logs.filter, scrollOffset: data.logs.scrollOffset, maxLines: Math.max(5, data.rows - 16), focused: data.focusedPanel === 'logs', searchMode: data.searchMode, searchText: data.searchText })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=medium.js.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SAAS,GAAI,GACjJ,EACN,KAAC,GAAG,IAAC,KAAK,EAAC,KAAK,YACd,KAAC,WAAW,IAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,YAAY,KAAK,QAAQ,GAAI,GACzE,IACF,EACN,KAAC,QAAQ,IACP,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EACtB,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EACxB,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EACpC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,EACrC,OAAO,EAAE,IAAI,CAAC,YAAY,KAAK,MAAM,EACrC,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,UAAU,EAAE,IAAI,CAAC,UAAU,GAC3B,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from 'ink';
|
|
3
|
+
import { NodePanel } from '../panels/node-panel.js';
|
|
4
|
+
import { IndexerPanel } from '../panels/indexer-panel.js';
|
|
5
|
+
import { ProofPanel } from '../panels/proof-panel.js';
|
|
6
|
+
import { WalletPanel } from '../panels/wallet-panel.js';
|
|
7
|
+
import { LogPanel } from '../panels/log-panel.js';
|
|
8
|
+
export function SmallLayout({ data }) {
|
|
9
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(NodePanel, { data: data.node, loading: data.nodeLoading, compact: true }), _jsx(IndexerPanel, { data: data.indexer, nodeBlock: data.node?.bestBlock ?? null, loading: data.indexerLoading, compact: true }), _jsx(ProofPanel, { data: data.proofServer, loading: data.proofServerLoading, compact: true }), _jsx(WalletPanel, { wallet: data.wallet, compact: true }), _jsx(LogPanel, { lines: data.logs.lines, filter: data.logs.filter, scrollOffset: data.logs.scrollOffset, maxLines: data.rows - 10, focused: data.focusedPanel === 'logs', searchMode: data.searchMode, searchText: data.searchText })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=small.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"small.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/layouts/small.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOlD,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,EAAoB;IACpD,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,SAAG,EACjE,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,IAAI,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,SAAG,EACnH,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,SAAG,EAChF,KAAC,WAAW,IAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,SAAG,EAC5C,KAAC,QAAQ,IACP,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EACtB,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EACxB,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EACpC,QAAQ,EAAE,IAAI,CAAC,IAAI,GAAG,EAAE,EACxB,OAAO,EAAE,IAAI,CAAC,YAAY,KAAK,MAAM,EACrC,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,UAAU,EAAE,IAAI,CAAC,UAAU,GAC3B,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ServiceName = 'node' | 'indexer' | 'proof-server' | 'unknown';
|
|
2
|
+
export type LogLevel = 'info' | 'warn' | 'error' | 'debug';
|
|
3
|
+
export interface ParsedLogLine {
|
|
4
|
+
service: ServiceName;
|
|
5
|
+
level: LogLevel;
|
|
6
|
+
message: string;
|
|
7
|
+
raw: string;
|
|
8
|
+
}
|
|
9
|
+
export interface LogFilter {
|
|
10
|
+
service?: ServiceName;
|
|
11
|
+
level?: LogLevel;
|
|
12
|
+
search?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseLogLines(raw: string): ParsedLogLine[];
|
|
15
|
+
export declare function filterLogs(lines: ParsedLogLine[], filter: LogFilter): ParsedLogLine[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const CONTAINER_MAP = {
|
|
2
|
+
'midnight-node': 'node',
|
|
3
|
+
'midnight-indexer': 'indexer',
|
|
4
|
+
'midnight-proof-server': 'proof-server',
|
|
5
|
+
};
|
|
6
|
+
function detectLevel(message) {
|
|
7
|
+
const upper = message.toUpperCase();
|
|
8
|
+
if (upper.includes('ERROR') || upper.includes('ERR '))
|
|
9
|
+
return 'error';
|
|
10
|
+
if (upper.includes('WARN'))
|
|
11
|
+
return 'warn';
|
|
12
|
+
if (upper.includes('DEBUG'))
|
|
13
|
+
return 'debug';
|
|
14
|
+
return 'info';
|
|
15
|
+
}
|
|
16
|
+
export function parseLogLines(raw) {
|
|
17
|
+
if (!raw.trim())
|
|
18
|
+
return [];
|
|
19
|
+
return raw
|
|
20
|
+
.split('\n')
|
|
21
|
+
.filter((line) => line.trim())
|
|
22
|
+
.map((line) => {
|
|
23
|
+
const pipeIndex = line.indexOf(' | ');
|
|
24
|
+
if (pipeIndex === -1) {
|
|
25
|
+
return { service: 'unknown', level: detectLevel(line), message: line.trim(), raw: line };
|
|
26
|
+
}
|
|
27
|
+
const containerRaw = line.slice(0, pipeIndex).trim();
|
|
28
|
+
const message = line.slice(pipeIndex + 3);
|
|
29
|
+
const service = CONTAINER_MAP[containerRaw] ?? 'unknown';
|
|
30
|
+
return { service, level: detectLevel(message), message, raw: line };
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export function filterLogs(lines, filter) {
|
|
34
|
+
return lines.filter((line) => {
|
|
35
|
+
if (filter.service && line.service !== filter.service)
|
|
36
|
+
return false;
|
|
37
|
+
if (filter.level && line.level !== filter.level)
|
|
38
|
+
return false;
|
|
39
|
+
if (filter.search && !line.message.toLowerCase().includes(filter.search.toLowerCase()))
|
|
40
|
+
return false;
|
|
41
|
+
return true;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=log-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-parser.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/lib/log-parser.ts"],"names":[],"mappings":"AAgBA,MAAM,aAAa,GAAgC;IACjD,eAAe,EAAE,MAAM;IACvB,kBAAkB,EAAE,SAAS;IAC7B,uBAAuB,EAAE,cAAc;CACxC,CAAC;AAEF,SAAS,WAAW,CAAC,OAAe;IAClC,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACpC,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAC;IACtE,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAC1C,IAAI,KAAK,CAAC,QAAQ,CAAC,OAA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E,IAAI,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAC9D,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YAAE,OAAO,KAAK,CAAC;QACrG,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ProofServerHealth {
|
|
2
|
+
status: string;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ProofServerReady {
|
|
6
|
+
status: 'ok' | 'busy';
|
|
7
|
+
jobsProcessing: number;
|
|
8
|
+
jobsPending: number;
|
|
9
|
+
jobCapacity: number;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function fetchProofServerHealth(baseUrl: string): Promise<ProofServerHealth | null>;
|
|
13
|
+
export declare function fetchProofServerVersion(baseUrl: string): Promise<string | null>;
|
|
14
|
+
export declare function fetchProofServerReady(baseUrl: string): Promise<ProofServerReady | null>;
|
|
15
|
+
export declare function fetchProofVersions(baseUrl: string): Promise<string[] | null>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
async function fetchJson(url) {
|
|
2
|
+
try {
|
|
3
|
+
const response = await fetch(url, { signal: AbortSignal.timeout(5000) });
|
|
4
|
+
return await response.json();
|
|
5
|
+
}
|
|
6
|
+
catch {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
async function fetchText(url) {
|
|
11
|
+
try {
|
|
12
|
+
const response = await fetch(url, { signal: AbortSignal.timeout(5000) });
|
|
13
|
+
if (!response.ok)
|
|
14
|
+
return null;
|
|
15
|
+
return await response.text();
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function fetchProofServerHealth(baseUrl) {
|
|
22
|
+
return fetchJson(`${baseUrl}/health`);
|
|
23
|
+
}
|
|
24
|
+
export async function fetchProofServerVersion(baseUrl) {
|
|
25
|
+
return fetchText(`${baseUrl}/version`);
|
|
26
|
+
}
|
|
27
|
+
export async function fetchProofServerReady(baseUrl) {
|
|
28
|
+
try {
|
|
29
|
+
const response = await fetch(`${baseUrl}/ready`, { signal: AbortSignal.timeout(5000) });
|
|
30
|
+
// /ready returns JSON even on 503
|
|
31
|
+
return await response.json();
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export async function fetchProofVersions(baseUrl) {
|
|
38
|
+
const text = await fetchText(`${baseUrl}/proof-versions`);
|
|
39
|
+
if (!text)
|
|
40
|
+
return null;
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(text);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=proof-server-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof-server-api.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/lib/proof-server-api.ts"],"names":[],"mappings":"AAaA,KAAK,UAAU,SAAS,CAAI,GAAW;IACrC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzE,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAO,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,GAAW;IAClC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAA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number;
|
|
3
|
+
isSyncing: boolean;
|
|
4
|
+
shouldHavePeers: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface BlockHeader {
|
|
7
|
+
number: number;
|
|
8
|
+
parentHash: string;
|
|
9
|
+
stateRoot: string;
|
|
10
|
+
extrinsicsRoot: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function fetchSystemChain(url: string): Promise<string | null>;
|
|
13
|
+
export declare function fetchSystemName(url: string): Promise<string | null>;
|
|
14
|
+
export declare function fetchSystemVersion(url: string): Promise<string | null>;
|
|
15
|
+
export declare function fetchSystemHealth(url: string): Promise<SystemHealth | null>;
|
|
16
|
+
export declare function fetchBestBlockHeader(url: string): Promise<BlockHeader | null>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
async function rpcCall(url, method, params = []) {
|
|
2
|
+
try {
|
|
3
|
+
const response = await fetch(url, {
|
|
4
|
+
method: 'POST',
|
|
5
|
+
headers: { 'Content-Type': 'application/json' },
|
|
6
|
+
body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),
|
|
7
|
+
signal: AbortSignal.timeout(5000),
|
|
8
|
+
});
|
|
9
|
+
const json = (await response.json());
|
|
10
|
+
return json.result;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function fetchSystemChain(url) {
|
|
17
|
+
return rpcCall(url, 'system_chain');
|
|
18
|
+
}
|
|
19
|
+
export function fetchSystemName(url) {
|
|
20
|
+
return rpcCall(url, 'system_name');
|
|
21
|
+
}
|
|
22
|
+
export function fetchSystemVersion(url) {
|
|
23
|
+
return rpcCall(url, 'system_version');
|
|
24
|
+
}
|
|
25
|
+
export function fetchSystemHealth(url) {
|
|
26
|
+
return rpcCall(url, 'system_health');
|
|
27
|
+
}
|
|
28
|
+
export async function fetchBestBlockHeader(url) {
|
|
29
|
+
const raw = await rpcCall(url, 'chain_getHeader');
|
|
30
|
+
if (!raw)
|
|
31
|
+
return null;
|
|
32
|
+
return {
|
|
33
|
+
number: parseInt(raw.number, 16),
|
|
34
|
+
parentHash: raw.parentHash,
|
|
35
|
+
stateRoot: raw.stateRoot,
|
|
36
|
+
extrinsicsRoot: raw.extrinsicsRoot,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=substrate-rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"substrate-rpc.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/lib/substrate-rpc.ts"],"names":[],"mappings":"AAaA,KAAK,UAAU,OAAO,CAAI,GAAW,EAAE,MAAc,EAAE,SAAoB,EAAE;IAC3E,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YAC/D,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;SAClC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;QACtD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,OAAO,OAAO,CAAS,GAAG,EAAE,cAAc,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,OAAO,CAAS,GAAG,EAAE,aAAa,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,OAAO,CAAS,GAAG,EAAE,gBAAgB,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,OAAO,OAAO,CAAe,GAAG,EAAE,eAAe,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,GAAW;IACpD,MAAM,GAAG,GAAG,MAAM,OAAO,CAKtB,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAC3B,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,OAAO;QACL,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;QAChC,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,cAAc,EAAE,GAAG,CAAC,cAAc;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IndexerInfo } from '../hooks/use-indexer-info.js';
|
|
3
|
+
interface IndexerPanelProps {
|
|
4
|
+
data: IndexerInfo | null;
|
|
5
|
+
nodeBlock: number | null;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
focused?: boolean;
|
|
8
|
+
compact?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function IndexerPanel({ data, nodeBlock, loading, focused, compact }: IndexerPanelProps): React.ReactElement;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from 'ink';
|
|
3
|
+
import { PanelBox } from '../components/panel-box.js';
|
|
4
|
+
import { StatusBadge } from '../components/status-badge.js';
|
|
5
|
+
export function IndexerPanel({ data, nodeBlock, loading, focused, compact }) {
|
|
6
|
+
if (loading && !data) {
|
|
7
|
+
return (_jsx(PanelBox, { title: "Indexer", focused: focused, children: _jsx(Text, { color: "gray", children: "Connecting..." }) }));
|
|
8
|
+
}
|
|
9
|
+
if (!data) {
|
|
10
|
+
return (_jsxs(PanelBox, { title: "Indexer", focused: focused, children: [_jsx(StatusBadge, { status: "stopped" }), _jsx(Text, { color: "gray", children: " Offline" })] }));
|
|
11
|
+
}
|
|
12
|
+
if (compact) {
|
|
13
|
+
return (_jsxs(Text, { children: [_jsx(StatusBadge, { status: data.ready ? 'running' : 'stopped' }), _jsx(Text, { children: " indexer :8088" })] }));
|
|
14
|
+
}
|
|
15
|
+
return (_jsxs(PanelBox, { title: "Indexer", focused: focused, children: [_jsxs(Text, { children: ["Status: ", _jsx(StatusBadge, { status: data.ready ? 'ok' : 'unhealthy' })] }), data.responseTime != null && (_jsxs(Text, { children: ["Response: ", _jsxs(Text, { color: "yellow", children: [data.responseTime, "ms"] })] }))] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=indexer-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexer-panel.js","sourceRoot":"","sources":["../../../../src/cli/dashboard/panels/indexer-panel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAW5D,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAqB;IAC5F,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;QACrB,OAAO,CACL,KAAC,QAAQ,IAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,YACxC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,8BAAqB,GAC9B,CACZ,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CACL,MAAC,QAAQ,IAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,aACxC,KAAC,WAAW,IAAC,MAAM,EAAC,SAAS,GAAG,EAChC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,yBAAgB,IACzB,CACZ,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,MAAC,IAAI,eACH,KAAC,WAAW,IAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAI,EAC3D,KAAC,IAAI,iCAAsB,IACtB,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,QAAQ,IAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,aACxC,MAAC,IAAI,2BAAS,KAAC,WAAW,IAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,GAAI,IAAO,EAC5E,IAAI,CAAC,YAAY,IAAI,IAAI,IAAI,CAC5B,MAAC,IAAI,6BAAW,MAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,aAAE,IAAI,CAAC,YAAY,UAAU,IAAO,CACzE,IACQ,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ParsedLogLine, LogFilter } from '../lib/log-parser.js';
|
|
3
|
+
interface LogPanelProps {
|
|
4
|
+
lines: ParsedLogLine[];
|
|
5
|
+
filter: LogFilter;
|
|
6
|
+
scrollOffset: number;
|
|
7
|
+
maxLines?: number;
|
|
8
|
+
focused?: boolean;
|
|
9
|
+
searchMode?: boolean;
|
|
10
|
+
searchText?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function LogPanel({ lines, filter, scrollOffset, maxLines, focused, searchMode, searchText, }: LogPanelProps): React.ReactElement;
|
|
13
|
+
export {};
|