mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
bb44f8fc24
* Squash * Fix keystore on wasm * Update utils/browser/Cargo.toml Co-Authored-By: Benjamin Kampmann <ben@gnunicorn.org> * export console functions * Use an Option<PathBuf> in keystore instead of cfg flags * Add a KeystoreConfig * Update libp2p * Bump kvdb-web version * Fix cli * Upgrade versions * Update wasm-bindgen stuff Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
40 lines
1011 B
HTML
40 lines
1011 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
|
<title>Substrate node</title>
|
|
<link rel="shortcut icon" href="/favicon.png" />
|
|
<script type="module">
|
|
import { start_client, default as init } from './pkg/node_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/node_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>
|