API documentation (#253)

* Remove badges from READMEs (used inside docs)

* Expand intro

* Intro and examples for ApiRx

* examples -> examples-rpc

* Update intros with expanded example

* Don't nest subscriptions
This commit is contained in:
Jaco Greeff
2018-10-11 15:27:00 +02:00
committed by GitHub
parent 35115723e1
commit a4fc2c51e8
42 changed files with 220 additions and 100 deletions
+16
View File
@@ -0,0 +1,16 @@
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());