Skip to content

Commit bb7fd36

Browse files
committed
decreased log level to 4(debug), read chainspec from Bob, connect to Alice
1 parent 8fdb755 commit bb7fd36

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/read.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import { WsProvider } from "@polkadot/api";
66

77

88
async function main() {
9-
// const ws = new WsProvider('ws://localhost:10000');
10-
// const bobApi = await ApiPromise.create({ provider: ws });
11-
// await bobApi.isReady;
12-
9+
const ws = new WsProvider('ws://localhost:12346');
10+
const bobApi = await ApiPromise.create({ provider: ws });
11+
await bobApi.isReady;
12+
const chainSpec = (await bobApi.rpc.syncstate.genSyncSpec(true)).toString();
1313

1414
// Bob's address
15-
const provider = new WsProvider('ws://localhost:12346');
15+
const provider = new WsProvider('ws://localhost:10000');
1616
const api = await ApiPromise.create({ provider });
1717
await api.isReady;
18-
const chainSpec = (await api.rpc.syncstate.genSyncSpec(true)).toString();
18+
1919

2020
// Check if chainSpec has bootnodes
2121
const chainSpecObj = JSON.parse(chainSpec);
@@ -46,7 +46,7 @@ async function main() {
4646

4747
// Start smoldot with logging enabled
4848
const client = smoldot.start({
49-
maxLogLevel: 5, // 0=off, 1=error, 2=warn, 3=info, 4=debug, 5=trace
49+
maxLogLevel: 4, // 0=off, 1=error, 2=warn, 3=info, 4=debug, 5=trace
5050
logCallback: (level, target, message) => {
5151
const levelNames = ['ERROR', 'WARN', 'INFO', 'DEBUG', 'TRACE'];
5252
const levelName = levelNames[level - 1] || 'UNKNOWN';

0 commit comments

Comments
 (0)