Skip to content
This repository was archived by the owner on Aug 20, 2020. It is now read-only.

Commit 5c7ee98

Browse files
author
Dan Forbes
authored
Create Your First Chain Tutorial Should Use Front-End Template (#49)
1 parent 06e0e3f commit 5c7ee98

File tree

8 files changed

+63
-24
lines changed

8 files changed

+63
-24
lines changed
Loading
Binary file not shown.
Loading
Loading
Loading
Loading

tuts/create-your-first-substrate-chain/v2.0.0-rc2/interact.md

+53-22
Original file line numberDiff line numberDiff line change
@@ -61,41 +61,72 @@ $ ./target/release/node-template --dev
6161
If the number after `finalized:` is increasing, your blockchain is producing new blocks and reaching
6262
consensus about the state they describe!
6363

64-
## Start the Front End
64+
## Start the Front-End
6565

66-
To interact with the local node we will use the Polkadot-js Apps user interface, often known as
67-
"Apps" for short. Despite the name, Apps will work with any Substrate-based blockchain including
68-
ours, not just Polkadot.
66+
To interact with your local node, we will use
67+
[the Substrate Developer Hub Front-End Template](https://github.com/substrate-developer-hub/substrate-front-end-template),
68+
which is a collection of UI components that have been designed with common use cases in mind.
6969

70-
In your web browser, navigate to
71-
[https://polkadot.js.org/apps](https://polkadot.js.org/apps/#/settings?rpc=ws://127.0.0.1:9944).
70+
To get started with the Front-End Template, clone its repository and
71+
[follow the simple steps to run it locally](https://github.com/substrate-developer-hub/substrate-front-end-template#using-the-template).
7272

73-
On the `Settings` tab ensure that you are connected to a `Local Node` or `ws://127.0.0.1:9944`.
73+
## Interact
7474

75-
> Some browsers, notably Firefox, will not connect to a local node from an https website. An easy
76-
> work around is to try another browser, like Chromium. Another option is to
77-
> [host this interface locally](https://github.com/polkadot-js/apps#development).
75+
Once the Front-End Template is running and loaded in your browser at
76+
[http://localhost:8000/](http://localhost:8000/), take a moment to explore its components. At the
77+
top, you will find lots of helpful information about the chain to which you're connected as well as
78+
an account selector that will let you control the account you use to perform on-chain operations.
7879

79-
## Interact
80+
![Chain Data & Account Selector](../assets/chain-data.png)
8081

81-
Select the **Accounts** tab, you will see test accounts that you have access to. Some, like Alice
82-
and Bob, already have funds!
82+
There is also a table that lists
83+
[the well-known test accounts](/kb/integrate/subkey#well-known-keys) that you have access to. Some,
84+
like Alice and Bob, already have funds!
8385

84-
![Apps UI with pre-funded accounts](../assets/apps-prefunded.png)
86+
![Account Table](../assets/accts-prefunded.png)
8587

86-
You can try to transfer some funds from Alice to Charlie by clicking the "send" button.
88+
Beneath the account table there is a Transfer component that you can use to transfer funds from
89+
one account to another. Take note of the info box that describes the precision used by the Front-End
90+
Template; you should transfer at least `1000000000000` to make it easy for you to observe the
91+
changes you're making.
8792

8893
![Balance Transfer](../assets/apps-transfer.png)
8994

90-
If everything went successfully, you should see some popup notifications claiming "Extrinsic
91-
Success", and of course Charlie's balance will increase.
95+
Notice that the table of accounts is dynamic and that the account balances are updated as soon as
96+
the transfer is processed.
97+
98+
### Runtime Metadata
99+
100+
The Front-End Template exposes many helpful features and you should explore all of them while you're
101+
connected to a local development node. One good way to get started is by clicking the "Show
102+
Metadata" button at the top of the template page and reviewing
103+
[the metadata that your runtime exposes](https://www.substrate.io/kb/runtime/metadata).
104+
105+
![Metadata JSON](../assets/metadata.png)
106+
107+
### Pallet Interactor & Events
108+
109+
You can use the runtime metadata to discover a runtime's capabilities. The Front-End Template
110+
provides a helpful Pallet Interactor component that provides several mechanisms for interacting with
111+
a Substrate runtime.
112+
113+
![Pallet Interactor & Events](../assets/interactor-events.png)
114+
115+
[Extrinsics](/kb/learn-substrate/extrinsics) are the runtime's callable functions; if you are
116+
already familiar with blockchain concepts, you can think of them as transactions for now. The Pallet
117+
Interactor allows you to submit [unsigned](/kb/learn-substrate/extrinsics#unsigned-transactions) or
118+
[signed](/kb/learn-substrate/extrinsics#signed-transactions) extrinsics and also provides a button
119+
that makes it easy to invoke an extrinsic by way of
120+
[the `sudo` function from the Sudo pallet](https://substrate.dev/rustdocs/v2.0.0-rc2/pallet_sudo/enum.Call.html#variant.sudo).
92121

93-
## Create Your Own Account
122+
You can select Query interactions to read
123+
[the values present in your runtime's storage](/kb/runtime/storage). The RPC and Constant options
124+
provide additional mechanisms for runtime interaction.
94125

95-
You can create your own account by selecting the `+ Add Account` button. It won't have any tokens
96-
yet, but you can send some from Alice or any other pre-funded account. Only you (and your browser)
97-
will know the private key for your own account which means nobody can transfer those tokens except
98-
you.
126+
Like many blockchains, Substrate chains use [events](/kb/runtime/events) to report the results of
127+
asynchronous operations. If you have already used the Front-End Template to perform a balance
128+
transfer as described above, you should see an event for the transfer in the Event component next to
129+
the Pallet Interactor.
99130

100131
## Next Steps
101132

tuts/create-your-first-substrate-chain/v2.0.0-rc2/setup.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,13 @@ Node Template serves as a good starting point for building on Substrate.
7979
cargo build --release
8080
```
8181

82-
This final compilation can take up to 25 minutes depending on your hardware. In that time, read the
83-
next section to learn more about Substrate.
82+
This final compilation can take up to 25 minutes depending on your hardware. So don't wait before
83+
moving on to the next steps.
84+
85+
## Front-End
86+
87+
In order to interact with your node, you will be running a local instance of
88+
[the Substrate Developer Hub Front-End Template](https://github.com/substrate-developer-hub/substrate-front-end-template),
89+
which requires you to have [Node.js](https://nodejs.org/) installed on your computer. You may want
90+
to use the time that your node is compiling to ensure that your development environment is prepared
91+
with these dependencies.

0 commit comments

Comments
 (0)