mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 19:47:59 +00:00
ac952532e1
* Make availability-store compile for WASM * Use --manifest-path instead * Make validation work on wasm! * Switch to Spawn trait * Migrate validation to std futures * Migrate network to std futures * Final changes to validation * Tidy up network * Tidy up validation * Switch branch * Migrate service * Get polkadot to compile via wasm! * Add browser-demo * Add initial browser file * Add browser-demo * Tidy * Temp switch back to substrate/master * tidy * Fix wasm build * Re-add release flag * Add the /ws bootnode to the chain specs * Copy changes from master * Switch branch * Switch libp2p and add wasm-timer * Switch back libp2p and add rand * Fix bootnodes PeerIds * use browser indexdb * Reduce changeset
40 lines
1018 B
HTML
40 lines
1018 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
|
<title>Polkadot node</title>
|
|
<link rel="shortcut icon" href="/favicon.png" />
|
|
<script type="module">
|
|
import { start_client, default as init } from './pkg/polkadot_cli.js';
|
|
import ws from './ws.js';
|
|
|
|
function log(msg) {
|
|
document.getElementsByTagName('body')[0].innerHTML += msg + '\n';
|
|
}
|
|
|
|
async function start() {
|
|
log('Loading WASM');
|
|
await init('./pkg/polkadot_cli_bg.wasm');
|
|
log('Successfully loaded WASM');
|
|
|
|
// Build our client.
|
|
log('Starting client');
|
|
let client = await start_client(ws());
|
|
log('Client started');
|
|
|
|
client.rpcSubscribe('{"method":"chain_subscribeNewHead","params":[],"id":1,"jsonrpc":"2.0"}',
|
|
(r) => log("New chain head: " + r));
|
|
|
|
setInterval(() => {
|
|
client
|
|
.rpcSend('{"method":"system_networkState","params":[],"id":1,"jsonrpc":"2.0"}')
|
|
.then((r) => log("Network state: " + r));
|
|
}, 20000);
|
|
}
|
|
|
|
start();
|
|
</script>
|
|
</head>
|
|
<body style="white-space: pre"></body>
|
|
</html>
|