mirror of
https://github.com/waku-org/examples.waku.org.git
synced 2025-02-24 03:38:12 +00:00
Updates
This commit is contained in:
parent
6d6a7833cf
commit
9647b73341
@ -1,7 +1,7 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/eth-pm/static/css/main.0350996a.css",
|
||||
"main.js": "/eth-pm/static/js/main.464438a8.js",
|
||||
"main.js": "/eth-pm/static/js/main.6bd9ffb8.js",
|
||||
"static/media/roboto-all-400-normal.woff": "/eth-pm/static/media/roboto-all-400-normal.b5a0a0df312d3423493b.woff",
|
||||
"static/media/rpc.cjs": "/eth-pm/static/media/rpc.93e8f6196bd2c425bf03.cjs",
|
||||
"static/media/roboto-latin-400-normal.woff2": "/eth-pm/static/media/roboto-latin-400-normal.176f8f5bd5f02b3abfcf.woff2",
|
||||
@ -13,10 +13,10 @@
|
||||
"static/media/roboto-greek-ext-400-normal.woff2": "/eth-pm/static/media/roboto-greek-ext-400-normal.bc7ace6e50c7d9d4d959.woff2",
|
||||
"index.html": "/eth-pm/index.html",
|
||||
"main.0350996a.css.map": "/eth-pm/static/css/main.0350996a.css.map",
|
||||
"main.464438a8.js.map": "/eth-pm/static/js/main.464438a8.js.map"
|
||||
"main.6bd9ffb8.js.map": "/eth-pm/static/js/main.6bd9ffb8.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.0350996a.css",
|
||||
"static/js/main.464438a8.js"
|
||||
"static/js/main.6bd9ffb8.js"
|
||||
]
|
||||
}
|
@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/eth-pm/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/eth-pm/logo192.png"/><link rel="manifest" href="/eth-pm/manifest.json"/><title>React App</title><script defer="defer" src="/eth-pm/static/js/main.464438a8.js"></script><link href="/eth-pm/static/css/main.0350996a.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/eth-pm/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/eth-pm/logo192.png"/><link rel="manifest" href="/eth-pm/manifest.json"/><title>React App</title><script defer="defer" src="/eth-pm/static/js/main.6bd9ffb8.js"></script><link href="/eth-pm/static/css/main.0350996a.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3
eth-pm/static/js/main.6bd9ffb8.js
Normal file
3
eth-pm/static/js/main.6bd9ffb8.js
Normal file
File diff suppressed because one or more lines are too long
1
eth-pm/static/js/main.6bd9ffb8.js.map
Normal file
1
eth-pm/static/js/main.6bd9ffb8.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -18,16 +18,18 @@
|
||||
<div><h2>Remote Peer Id</h2></div>
|
||||
<div id='remote-peer-id'></div>
|
||||
|
||||
<label for='remote-multiaddr'>Remote peer's multiaddr</label>
|
||||
<input id='remote-multiaddr'
|
||||
type='text'
|
||||
value="/dns4/node-01.ac-cn-hongkong-c.wakuv2.test.statusim.net/tcp/443/wss/p2p/16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm">
|
||||
<button id='dial' type='button'>Dial</button>
|
||||
<br/>
|
||||
<button id='subscribe' type='button'>Subscribe</button>
|
||||
<button id='unsubscribe' type='button'>Unsubscribe</button>
|
||||
<button id='subscribe' type='button'>Subscribe with Filter</button>
|
||||
<button id='unsubscribe' type='button'>Unsubscribe with Filter</button>
|
||||
<br/>
|
||||
<label for='textInput'>Message text</label>
|
||||
<input id='textInput' placeholder='Type your message here' type='text'>
|
||||
<button id='sendButton' type='button'>Send Message</button>
|
||||
<button id='sendButton' type='button'>Send message using Light Push</button>
|
||||
<br/>
|
||||
<div id="messages"></div>
|
||||
|
||||
@ -35,13 +37,13 @@
|
||||
import {
|
||||
utils,
|
||||
WakuMessage
|
||||
} from 'https://unpkg.com/js-waku@0.27.0/bundle/index.js';
|
||||
} from 'https://unpkg.com/js-waku@0.28.0/bundle/index.js';
|
||||
import {
|
||||
createLightNode
|
||||
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/create_waku.js'
|
||||
} from 'https://unpkg.com/js-waku@0.28.0/bundle/lib/create_waku.js'
|
||||
import {
|
||||
waitForRemotePeer
|
||||
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/wait_for_remote_peer.js'
|
||||
} from 'https://unpkg.com/js-waku@0.28.0/bundle/lib/wait_for_remote_peer.js'
|
||||
|
||||
const peerIdDiv = document.getElementById('peer-id');
|
||||
const remotePeerIdDiv = document.getElementById('remote-peer-id');
|
||||
|
@ -7,6 +7,6 @@
|
||||
<link rel="stylesheet" href="styles.ef46db3751d8e999.css"></head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
<script src="runtime.85abfe8aa64fdd33.js" type="module"></script><script src="main.5bb44346dd9a0067.js" type="module"></script>
|
||||
<script src="runtime.85abfe8aa64fdd33.js" type="module"></script><script src="main.19e54953c2b04148.js" type="module"></script>
|
||||
|
||||
</body></html>
|
1
relay-angular-chat/main.19e54953c2b04148.js
Normal file
1
relay-angular-chat/main.19e54953c2b04148.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -12,9 +12,9 @@
|
||||
<div><h1>Waku Node Status</h1></div>
|
||||
<div id='status'></div>
|
||||
|
||||
<label for='textInput'>Message text</label>
|
||||
<input id='textInput' placeholder='Type your message here' type='text'>
|
||||
<button id='sendButton' type='button'>Send Message
|
||||
</button>
|
||||
<button id='sendButton' type='button'>Send Message using Relay</button>
|
||||
|
||||
<div><h1>Messages</h1></div>
|
||||
<div id='messages'></div>
|
||||
@ -28,13 +28,13 @@
|
||||
|
||||
import {
|
||||
WakuMessage
|
||||
} from 'https://unpkg.com/js-waku@0.27.0/bundle/index.js';
|
||||
} from 'https://unpkg.com/js-waku@0.28.0/bundle/index.js';
|
||||
import {
|
||||
createWaku
|
||||
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/create_waku.js'
|
||||
createPrivacyNode
|
||||
} from 'https://unpkg.com/js-waku@0.28.0/bundle/lib/create_waku.js'
|
||||
import {
|
||||
waitForRemotePeer
|
||||
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/wait_for_remote_peer.js'
|
||||
} from 'https://unpkg.com/js-waku@0.28.0/bundle/lib/wait_for_remote_peer.js'
|
||||
|
||||
const statusDiv = document.getElementById('status');
|
||||
const messagesDiv = document.getElementById('messages');
|
||||
@ -60,7 +60,7 @@
|
||||
// We are currently working on migrating this method to DNS Discovery.
|
||||
//
|
||||
// https://js-waku.wakuconnect.dev/classes/waku.Waku.html#create
|
||||
const waku = await createWaku({defaultBootstrap: true});
|
||||
const waku = await createPrivacyNode({defaultBootstrap: true});
|
||||
await waku.start();
|
||||
|
||||
// Had a hook to process all incoming messages on a specified content topic.
|
||||
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/relay-reactjs-chat/static/css/main.e6c13ad2.css",
|
||||
"main.js": "/relay-reactjs-chat/static/js/main.5b10365d.js",
|
||||
"main.js": "/relay-reactjs-chat/static/js/main.8a4afe82.js",
|
||||
"index.html": "/relay-reactjs-chat/index.html",
|
||||
"main.e6c13ad2.css.map": "/relay-reactjs-chat/static/css/main.e6c13ad2.css.map",
|
||||
"main.5b10365d.js.map": "/relay-reactjs-chat/static/js/main.5b10365d.js.map"
|
||||
"main.8a4afe82.js.map": "/relay-reactjs-chat/static/js/main.8a4afe82.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.e6c13ad2.css",
|
||||
"static/js/main.5b10365d.js"
|
||||
"static/js/main.8a4afe82.js"
|
||||
]
|
||||
}
|
@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/relay-reactjs-chat/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/relay-reactjs-chat/logo192.png"/><link rel="manifest" href="/relay-reactjs-chat/manifest.json"/><title>React App</title><script defer="defer" src="/relay-reactjs-chat/static/js/main.5b10365d.js"></script><link href="/relay-reactjs-chat/static/css/main.e6c13ad2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/relay-reactjs-chat/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/relay-reactjs-chat/logo192.png"/><link rel="manifest" href="/relay-reactjs-chat/manifest.json"/><title>React App</title><script defer="defer" src="/relay-reactjs-chat/static/js/main.8a4afe82.js"></script><link href="/relay-reactjs-chat/static/css/main.e6c13ad2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
relay-reactjs-chat/static/js/main.8a4afe82.js.map
Normal file
1
relay-reactjs-chat/static/js/main.8a4afe82.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -2,39 +2,38 @@
|
||||
<html lang='en'>
|
||||
|
||||
<head>
|
||||
<meta charset='UTF-8' />
|
||||
<meta content='width=device-width, initial-scale=1.0' name='viewport' />
|
||||
<title>JS-Waku store script tag example</title>
|
||||
<meta charset='UTF-8'/>
|
||||
<meta content='width=device-width, initial-scale=1.0' name='viewport'/>
|
||||
<title>JS-Waku store script tag example</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div><h1>Timestamp of latest message seen in store</h1></div>
|
||||
<div><h1>Timestamp of the latest message seen in store</h1></div>
|
||||
<div id='timestamp'></div>
|
||||
|
||||
<script type='module'>
|
||||
import {
|
||||
Protocols
|
||||
} from 'https://unpkg.com/js-waku@0.27.0/bundle/index.js';
|
||||
import {
|
||||
createWaku
|
||||
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/create_waku.js'
|
||||
import {
|
||||
waitForRemotePeer
|
||||
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/wait_for_remote_peer.js'
|
||||
import {
|
||||
Protocols
|
||||
} from 'https://unpkg.com/js-waku@0.28.0/bundle/index.js';
|
||||
import {
|
||||
createWaku
|
||||
} from 'https://unpkg.com/js-waku@0.28.0/bundle/lib/create_waku.js'
|
||||
import {
|
||||
waitForRemotePeer
|
||||
} from 'https://unpkg.com/js-waku@0.28.0/bundle/lib/wait_for_remote_peer.js'
|
||||
|
||||
/**
|
||||
* This example demonstrates how to use the js-waku minified bundle
|
||||
* available on unpkg.com.
|
||||
*
|
||||
* It is a simple script that uses Waku Store to retrieve ping relay messages
|
||||
* and displays the timestamp of the most recent ping relay message.
|
||||
*/
|
||||
const timestampDiv = document.getElementById('timestamp');
|
||||
/**
|
||||
* This example demonstrates how to use the js-waku minified bundle
|
||||
* available on unpkg.com.
|
||||
*
|
||||
* It is a simple script that uses Waku Store to retrieve ping relay messages
|
||||
* and displays the timestamp of the most recent ping relay message.
|
||||
*/
|
||||
const timestampDiv = document.getElementById('timestamp');
|
||||
|
||||
try {
|
||||
timestampDiv.innerHTML = '<p>Creating waku.</p>';
|
||||
const node = await createWaku({ defaultBootstrap: true });
|
||||
const node = await createWaku({defaultBootstrap: true});
|
||||
|
||||
timestampDiv.innerHTML = '<p>Starting waku.</p>';
|
||||
await node.start();
|
||||
@ -43,40 +42,34 @@
|
||||
await waitForRemotePeer(node, [Protocols.Store]);
|
||||
|
||||
timestampDiv.innerHTML = '<p>Retrieving messages.</p>';
|
||||
const callback = (wakuMessages) => {
|
||||
// Messages are ordered with oldest first
|
||||
// even with page direction `backward`
|
||||
const latestFirst = wakuMessages.reverse();
|
||||
const latestMessage = latestFirst[0];
|
||||
if (latestMessage) {
|
||||
timestampDiv.innerHTML = latestMessage.timestamp;
|
||||
} else {
|
||||
timestampDiv.innerHTML = '<p>No message available, go to <a href="https://js-waku.wakuconnect.dev/examples/web-chat/">web-chat</a> to send a message</p>';
|
||||
}
|
||||
const callback = (wakuMessage) => {
|
||||
// When `backward` direction is passed, first message is the most recent
|
||||
timestampDiv.innerHTML = wakuMessage.timestamp;
|
||||
|
||||
// When returning true, `queryHistory` stops retrieving pages
|
||||
// In our case, we only want one message, hence one page.
|
||||
return true;
|
||||
// When returning true, `queryHistory` stops retrieving pages
|
||||
// In our case, we only want one message, hence one page.
|
||||
return true;
|
||||
};
|
||||
|
||||
const startTime = new Date();
|
||||
// Only retrieve a week of messages
|
||||
startTime.setTime(Date.now() - 7 * 24 * 60 * 60 * 1000);
|
||||
|
||||
|
||||
await node.store
|
||||
.queryHistory([], {
|
||||
callback,
|
||||
pageDirection: 'backward',
|
||||
pageSize: 1,
|
||||
timeFilter: {
|
||||
startTime,
|
||||
endTime: new Date()
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
timestampDiv.innerHTML = 'Error encountered: ' + e.toString();
|
||||
}
|
||||
try {
|
||||
await node.store
|
||||
.queryOrderedCallback([],
|
||||
callback,
|
||||
{
|
||||
pageDirection: 'backward',
|
||||
pageSize: 1,
|
||||
timeFilter: {
|
||||
startTime,
|
||||
endTime: new Date()
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
// Known issue: https://github.com/status-im/nwaku/issues/1157
|
||||
console.log(e)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/store-reactjs-chat/static/css/main.e6c13ad2.css",
|
||||
"main.js": "/store-reactjs-chat/static/js/main.a3acd42e.js",
|
||||
"main.js": "/store-reactjs-chat/static/js/main.20f61a60.js",
|
||||
"static/media/rpc.cjs": "/store-reactjs-chat/static/media/rpc.93e8f6196bd2c425bf03.cjs",
|
||||
"index.html": "/store-reactjs-chat/index.html",
|
||||
"main.e6c13ad2.css.map": "/store-reactjs-chat/static/css/main.e6c13ad2.css.map",
|
||||
"main.a3acd42e.js.map": "/store-reactjs-chat/static/js/main.a3acd42e.js.map"
|
||||
"main.20f61a60.js.map": "/store-reactjs-chat/static/js/main.20f61a60.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.e6c13ad2.css",
|
||||
"static/js/main.a3acd42e.js"
|
||||
"static/js/main.20f61a60.js"
|
||||
]
|
||||
}
|
@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/store-reactjs-chat/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/store-reactjs-chat/logo192.png"/><link rel="manifest" href="/store-reactjs-chat/manifest.json"/><title>React App</title><script defer="defer" src="/store-reactjs-chat/static/js/main.a3acd42e.js"></script><link href="/store-reactjs-chat/static/css/main.e6c13ad2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/store-reactjs-chat/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/store-reactjs-chat/logo192.png"/><link rel="manifest" href="/store-reactjs-chat/manifest.json"/><title>React App</title><script defer="defer" src="/store-reactjs-chat/static/js/main.20f61a60.js"></script><link href="/store-reactjs-chat/static/css/main.e6c13ad2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
File diff suppressed because one or more lines are too long
1
store-reactjs-chat/static/js/main.20f61a60.js.map
Normal file
1
store-reactjs-chat/static/js/main.20f61a60.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,14 +1,14 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/web-chat/static/css/main.b267dcda.css",
|
||||
"main.js": "/web-chat/static/js/main.ebc4cf11.js",
|
||||
"main.js": "/web-chat/static/js/main.187a950f.js",
|
||||
"static/media/rpc.cjs": "/web-chat/static/media/rpc.93e8f6196bd2c425bf03.cjs",
|
||||
"index.html": "/web-chat/index.html",
|
||||
"main.b267dcda.css.map": "/web-chat/static/css/main.b267dcda.css.map",
|
||||
"main.ebc4cf11.js.map": "/web-chat/static/js/main.ebc4cf11.js.map"
|
||||
"main.187a950f.js.map": "/web-chat/static/js/main.187a950f.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.b267dcda.css",
|
||||
"static/js/main.ebc4cf11.js"
|
||||
"static/js/main.187a950f.js"
|
||||
]
|
||||
}
|
@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><meta name="description" content="Chat app powered by js-waku"/><link rel="manifest" href="/web-chat/manifest.json"/><title>Waku v2 chat app</title><script defer="defer" src="/web-chat/static/js/main.ebc4cf11.js"></script><link href="/web-chat/static/css/main.b267dcda.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><meta name="description" content="Chat app powered by js-waku"/><link rel="manifest" href="/web-chat/manifest.json"/><title>Waku v2 chat app</title><script defer="defer" src="/web-chat/static/js/main.187a950f.js"></script><link href="/web-chat/static/css/main.b267dcda.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
File diff suppressed because one or more lines are too long
1
web-chat/static/js/main.187a950f.js.map
Normal file
1
web-chat/static/js/main.187a950f.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user