[CI Skip] 0.29.11

This commit is contained in:
Travis CI
2018-09-26 05:30:33 +00:00
parent f399bb6fd6
commit 7eb2b29201
56 changed files with 292 additions and 298 deletions
+9 -9
View File
@@ -371,22 +371,22 @@
<h1 id="simple-connect">Simple Connect</h1>
<p>The following example shows how to instantiate a Polkadot API object and use it to connect to a node.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> Api = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;@polkadot/api&apos;</span>).default
<span class="hljs-keyword">const</span> WsProvider = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;@polkadot/api-provider/ws&apos;</span>).default
<span class="hljs-keyword">const</span> provider = <span class="hljs-keyword">new</span> WsProvider(<span class="hljs-string">&apos;ws://127.0.0.1:9944&apos;</span>)
<span class="hljs-keyword">const</span> api = <span class="hljs-keyword">new</span> Api(provider)
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> Api = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;@polkadot/api&apos;</span>).default;
<span class="hljs-keyword">const</span> WsProvider = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;@polkadot/api-provider/ws&apos;</span>).default;
<span class="hljs-keyword">const</span> provider = <span class="hljs-keyword">new</span> WsProvider(<span class="hljs-string">&apos;ws://127.0.0.1:9944&apos;</span>);
<span class="hljs-keyword">const</span> api = <span class="hljs-keyword">new</span> Api(provider);
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getChain</span> (<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">return</span> api.system.chain()
<span class="hljs-keyword">return</span> api.system.chain();
}
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span> (<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">const</span> chain = <span class="hljs-keyword">await</span> getChain()
<span class="hljs-keyword">const</span> chain = <span class="hljs-keyword">await</span> getChain();
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;You are connected to chain:&apos;</span>, chain)
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;You are connected to chain:&apos;</span>, chain);
}
main().finally(_ =&gt; process.exit())
main().finally(_ =&gt; process.exit());
</code></pre>
@@ -431,7 +431,7 @@ main().finally(_ =&gt; process.exit())
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Simple connect","level":"2.2","depth":1,"next":{"title":"Listen to blocks","level":"2.3","depth":1,"path":"examples/02_listen_to_blocks/README.md","ref":"examples/02_listen_to_blocks/README.md","articles":[]},"previous":{"title":"Overview","level":"2.1","depth":1,"path":"examples/README.md","ref":"examples/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock"],"root":"docs","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"examples/01_simple_connect/README.md","mtime":"2018-09-25T16:22:52.654Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-25T16:27:51.734Z"},"basePath":"../..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Simple connect","level":"2.2","depth":1,"next":{"title":"Listen to blocks","level":"2.3","depth":1,"path":"examples/02_listen_to_blocks/README.md","ref":"examples/02_listen_to_blocks/README.md","articles":[]},"previous":{"title":"Overview","level":"2.1","depth":1,"path":"examples/README.md","ref":"examples/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock"],"root":"docs","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"examples/01_simple_connect/README.md","mtime":"2018-09-26T05:25:07.927Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-26T05:30:25.997Z"},"basePath":"../..","book":{"language":""}});
});
</script>
</div>