1 line
2.5 KiB
JavaScript
1 line
2.5 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{438:function(e,t,a){"use strict";a.r(t);var s=a(46),n=Object(s.a)({},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"apipromise-examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#apipromise-examples","aria-hidden":"true"}},[e._v("#")]),e._v(" ApiPromise Examples")]),e._v(" "),a("p",[e._v("Here you will find a list of examples that takes you through the basics of connecting to a local node, retrieving data from the Node and chain and execute transactions on the chain. It uses the [[ApiPromise]] interface.")]),e._v(" "),a("h2",{attrs:{id:"prerequisites"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites","aria-hidden":"true"}},[e._v("#")]),e._v(" Prerequisites")]),e._v(" "),a("p",[e._v("For the following examples, you need a local node. It is usually convenient testing with:")]),e._v(" "),a("div",{staticClass:"language- line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("substrate --dev\n")])]),e._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[e._v("1")]),a("br")])]),a("h2",{attrs:{id:"running-the-examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#running-the-examples","aria-hidden":"true"}},[e._v("#")]),e._v(" Running the examples")]),e._v(" "),a("p",[e._v("From each folder, run "),a("code",[e._v("yarn")]),e._v(" to install the required dependencies and then run "),a("code",[e._v("yarn start")]),e._v(" to execute the example against the running node.")]),e._v(" "),a("h2",{attrs:{id:"development-accounts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#development-accounts","aria-hidden":"true"}},[e._v("#")]),e._v(" Development accounts")]),e._v(" "),a("p",[e._v("Some of the examples use the following accounts:")]),e._v(" "),a("ul",[a("li",[e._v("Alice: "),a("code",[e._v("5GoKvZWG5ZPYL1WUovuHW3zJBWBP5eT8CbqjdRY4Q6iMaDtZ")])]),e._v(" "),a("li",[e._v("Bob: "),a("code",[e._v("5Gw3s7q4QLkSWwknsiPtjujPv3XM4Trxi5d4PgKMMk3gfGTE")])])]),e._v(" "),a("p",[e._v("Those accounts are easy to add if you don't have/see them. The seed of Alice's account is "),a("code",[e._v("Alice␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣")]),e._v(" and the seed of Bob is... well you guess...")]),e._v(" "),a("p",[e._v("NOTE: Note the spaces padding Alice's key up to 32 chars.")])])},[],!1,null,null,null);t.default=n.exports}}]); |