feat(store-js): only mount store protocol

This commit is contained in:
fryorcraken.eth 2022-11-18 14:05:09 +11:00
parent eb98ef7f1c
commit 4fbdae63e1
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 9 additions and 2 deletions

View File

@ -13,8 +13,9 @@
<div id='timestamp'></div>
<script type='module'>
import {createLightNode} from 'https://unpkg.com/@waku/create@0.0.4/bundle/index.js'
import {defaultLibp2p, defaultPeerDiscovery} from 'https://unpkg.com/@waku/create@0.0.4/bundle/index.js'
import {waitForRemotePeer} from 'https://unpkg.com/@waku/core@0.0.6/bundle/lib/wait_for_remote_peer.js'
import {wakuStore, WakuNode} from 'https://unpkg.com/@waku/core@0.0.6/bundle/index.js'
import {DecoderV0} from 'https://unpkg.com/@waku/core@0.0.6/bundle/lib/waku_message/version_0.js'
/**
@ -27,7 +28,13 @@
const timestampDiv = document.getElementById('timestamp');
timestampDiv.innerHTML = '<p>Creating waku.</p>';
const node = await createLightNode({defaultBootstrap: true});
const libp2p = await defaultLibp2p(
undefined,
{peerDiscovery: [defaultPeerDiscovery()]},
);
const store = wakuStore();
const node = new WakuNode({}, libp2p, store,);
timestampDiv.innerHTML = '<p>Starting waku.</p>';
await node.start();