* Pull in latest @polkadot/dev, cleanup existing *.html * Cleanups (old gitbook interfaces) * Bump, WIP * Ready for testing * Update examples * Include source * Cleanup links * Adjust links * Add typedoc exclusions * Default classes from class files * Adjust imports * Adjust config * Re-add types split * Update links to substrate interfaces * Anchors for metadata * Adjust links * Restore HTML (to be deleted on CI) * Bump deps * Re-gen yarn.lock * Remove a in links * Adjust interfaces
23 lines
699 B
JavaScript
Executable File
23 lines
699 B
JavaScript
Executable File
// @ts-check
|
|
// Required imports
|
|
const { ApiPromise, WsProvider } = require('@polkadot/api');
|
|
|
|
async function main () {
|
|
// Initialise the provider to connect to the local node
|
|
const provider = new WsProvider('ws://127.0.0.1:9944');
|
|
|
|
// Create the API and wait until ready
|
|
const api = await ApiPromise.create(provider);
|
|
|
|
// Retrieve the chain & node information information via rpc calls
|
|
const [chain, nodeName, nodeVersion] = await Promise.all([
|
|
api.rpc.system.chain(),
|
|
api.rpc.system.name(),
|
|
api.rpc.system.version()
|
|
]);
|
|
|
|
console.log(`You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`);
|
|
}
|
|
|
|
main().catch(console.error).finally(() => process.exit());
|