Skip to content

Commit

Permalink
Update information on Rococo testnet (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi authored Jan 18, 2023
1 parent c63dfac commit 140e56e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 51 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,7 @@ dist
*.sqlite
*.sqlite-journal
.fuse_*
.docusaurus
.docusaurus

# Mac
.DS_Store
Binary file modified static/img/contracts-on-polkadot-js.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/img/icons/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If everything worked, `cargo contract --help` should show you the above list of

The [substrate-contracts-node](https://github.com/paritytech/substrate-contracts-node) is
a simple Substrate blockchain which is configured to include the Substrate module for
smart contract functionality the `contracts` pallet (see [How it Works](/how-it-works) for more).
smart contract functionality the `contracts` pallet (see [How it Works](/how-it-works) for more).

It's a comfortable option if you want to get a quickstart.
You can [download a binary from our releases page](https://github.com/paritytech/substrate-contracts-node/releases)
Expand Down
68 changes: 20 additions & 48 deletions versioned_docs/version-4.0.0-alpha.1/testnet/overview.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,45 @@
---
title: Overview
title: Contracts on Rococo
slug: /testnet
hide_title: true
---

## Rococo Deployment
[Rococo](https://wiki.polkadot.network/docs/build-pdk#rococo-testnet) is a testnet for
Polkadot and Kusama parachains.
We have a live testnet named `Contracts` as a parachain online there.

We have a live testnet named `Contracts` as a parachain on [Rococo](https://wiki.polkadot.network/docs/build-pdk#rococo-testnet)
a testnet for Polkadot and Kusama parachains:
<img src="/img/contracts-on-polkadot-js.png" alt="Smart contracts parachain on Rococo" />

<div class="schema">
<img src="/img/contracts-on-polkadot-js.png" alt="Smart contracts parachain on Rococo" />
</div>

You can interact with the network through Polkadot JS Apps,
[click here for a direct link to the `Contracts` parachain](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-contracts-rpc.polkadot.io#/explorer).

Our parachain uses the Rococo relay chain's native token (ROC) instead of having its own token.
Our parachain uses the Rococo relay chain's native token (`ROC`) instead of having its own token.
Due to this you'll need ROC in order to deploy contracts on our testnet.

As a first step, you should create an account. See [here](https://wiki.polkadot.network/docs/learn-account-generation)
As a first step, you should create an account. This can be done via command-line
tools or via a wallet. See [here](https://wiki.polkadot.network/docs/learn-account-generation)
for a detailed guide.

As a second step, you have to get ROC testnet tokens through the [Rococo Faucet](https://wiki.polkadot.network/docs/learn-DOT#getting-rococo-tokens).
As a second step, you have to get `ROC` testnet tokens through the [Rococo Faucet](https://wiki.polkadot.network/docs/learn-DOT#getting-rococo-tokens).
This is a chat room in which you need to write:

```
!drip YOUR_SS_58_ADDRESS:1002
```
The number `1002` is the parachain id of `Contracts` on Rococo, by supplying it the faucet will teleport ROC
tokens directly to your account on the parachain.

If everything worked out, the teleported ROC tokens will show up under
[the "Accounts" tab for `Contracts`](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-contracts-rpc.polkadot.io#/accounts).
The number `1002` is the parachain id of `Contracts` on Rococo, by supplying it the
faucet will teleport `ROC` tokens directly to your account on the parachain.

Once you have ROC on `Contracts` you can deploy a contract as you would normally.
If you're unsure about this, our [guided tutorial](https://docs.substrate.io/tutorials/smart-contracts/)
will clarify that for you in no time.
If everything worked out, the teleported `ROC` tokens will show up in your account.
In case you are using the `polkadot-js` fronted, you can see them under
[the "Accounts" tab for `Contracts`](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-contracts-rpc.polkadot.io#/accounts).

Once you have `ROC` on `Contracts` you can deploy a contract _nearly_ as you would with
a local developer node.
The only difference is that you can't use pre-endowed accounts like `Alice` or `Bob`.

## What is the `Contracts` parachain?

It's a [Substrate](https://github.com/paritytech/substrate)
parachain for smart contracts.
We configured it to use Substrate's smart contracts module the
[`contracts`](https://github.com/paritytech/substrate/tree/master/frame/contracts) pallet in
We configured it to use Substrate's smart contracts module the
[`contracts`](https://github.com/paritytech/substrate/tree/master/frame/contracts) pallet in
a default configuration.

The code for this parachain can be found [in the `cumulus` repository](https://github.com/paritytech/cumulus/tree/master/parachains/runtimes/contracts/contracts-rococo).

The `pallet-contracts` takes smart contracts as WebAssembly blobs and defines an API
for everything a smart contract needs (storage access, …).
As long as a programming language compiles to WebAssembly and there exists an implementation
of this API in it, you can write a smart contract for this pallet ‒ and thus for our the `Contracts`
parachain ‒ in that language.

This is a list of languages you can currently choose from:

* [Parity's ink!](https://github.com/paritytech/ink) for Rust
* [ask!](https://github.com/patractlabs/ask) for Assembly Script
* The [Solang](https://github.com/hyperledger-labs/solang) compiler for Solidity

The following graphic depicts the idea:

<div class="schema">
<img src="/img/pallet-contracts-overview.svg" alt="`pallet-contracts` Overview" />
</div>

There are also different user interfaces and command-line tools you can use to deploy
or interact with contracts:

* [Contracts UI](https://contracts-ui.substrate.io/)
* [polkadot-js](https://polkadot.js.org/apps/)
2 changes: 1 addition & 1 deletion versioned_sidebars/version-4.0.0-alpha.1-sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"Testnet": [
"testnet/overview"
],
"Third Party Tools": [
"Third Party Tools & Libraries": [
"third-party-tools/openbrush"
],
"FAQ": [
Expand Down

0 comments on commit 140e56e

Please sign in to comment.