* Docs renames (& removal for re-gen) * Rename api, api-provider & api-rx * Apoi -> Rpc, RxApi -> RpcRx (classes) * Add .nodoc * Bump version * Link updates (summary) * Cleanup deleted (master version) * Deleted re-instated * More... ;) * Types... * Revert .nodoc
17 lines
418 B
JavaScript
Executable File
17 lines
418 B
JavaScript
Executable File
const Rpc = require('@polkadot/rpc-core').default;
|
|
const WsProvider = require('@polkadot/rpc-provider/ws').default;
|
|
const provider = new WsProvider('ws://127.0.0.1:9944');
|
|
const api = new Rpc(provider);
|
|
|
|
async function getChain () {
|
|
return api.system.chain();
|
|
}
|
|
|
|
async function main () {
|
|
const chain = await getChain();
|
|
|
|
console.log('You are connected to chain:', chain);
|
|
}
|
|
|
|
main().finally(_ => process.exit());
|