node-cli 2.0.0

Generic Tetcore node implementation in Rust.
<!DOCTYPE html>
<html>
  <head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<title>Tetcore node</title>
	<link rel="shortcut icon" href="/favicon.png" />
	<script type="module">
import { start_client, default as init } from './pkg/node_cli.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('Fetching chain spec');
	const chain_spec_response = await fetch("https://raw.githubusercontent.com/tetcoin/tetcore/master/bin/node/cli/res/flaming-fir.json");
	const chain_spec_text = await chain_spec_response.text();

	// Build our client.
	let client = await start_client(chain_spec_text, 'info');
	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>