Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve DS doc for devs + fix JP doc #619

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
130 changes: 121 additions & 9 deletions docs/use/dapp-staking/for-devs/register-dapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,139 @@ import Figure from "/src/components/figure"

Once you have been approved by the Astar Council under Astar governance, you can take the following steps:

## Step 1
## Step 1: Native wallet & Verified Smart-contract

Before you can register your dApp or project, make sure you have :

- An [Astar Native developer wallet](/docs/use/manage-wallets/create-wallet) with some tokens to cover gas fee;
- Deploy a smart contract in our ecosystem and verify the contract in an explorer. The smart contract can be on Astar Native (WASM) or Astar EVM. For the explorer, you can use [Subscan](https://astar.subscan.io/) for Native or [Blockscout](https://astar.blockscout.com/) for EVM.
#### 1. An [Astar Native developer wallet](/docs/use/manage-wallets/create-wallet) with some tokens to cover gas fee. *No Ledger hardware wallet or EVM wallet.*

:::info
You can use one of the following wallets:

- The first option is to use one of your own smart contracts and verify it.
- The second option is only for those who don't deal with smart contracts. Deploy our `helloworld.sol` contract and provide all the information in the header of the contract. [Template contract](https://github.com/AstarNetwork/builders-program/blob/main/hellowold.sol).
<details>
<summary>**[Polkadot.js](https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd?hl=en)** *(Recommended)*</summary>

:::
The Polkadot\{.js\} plugin provides a reasonable balance of security and usability. It provides a separate local mechanism to generate your address and interact with the Astar portal. We recommend users who are new to our ecosystem and want to create an Astar native address use this wallet. If you don't have the Polkadot JS extension you will receive a popup in our portal when you try to connect your wallet.

Once the vote is passed, you can share your **developer address** and the **verified smart-contract address** in the discussion of your dApp Staking application on the Astar Forum;
### Install the Browser Plugin

The browser plugin is available for both [Google Chrome](https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd?hl=en) (and Chromium-based browsers like Brave) and [Firefox](https://addons.mozilla.org/en-US/firefox/addon/polkadot-js-extension). After installing the plugin, you should see the orange and white Polkadot\{.js\} logo in your browser menu bar.

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Polkadotjs_1.png').default } width="75%" />

### Create Account

Open the Polkadot\{.js\} browser extension by clicking the logo on the top bar of your browser. You will see a browser popup.

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Polkadotjs_2.png').default } width="70%" />

Click the big plus button `Create new account`. The Polkadot\{.js\} plugin will then use system randomness to make a new seed for you and display it to you in the form of twelve words.

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Polkadotjs_3.png').default } width="70%" />

You should back up these words. Please, store the seed somewhere safe, secret, and secure. If you cannot access your account via Polkadot\{.js\} for some reason, you can re-enter your seed through the `Add account menu` by selecting `Import account from pre-existing seed`.

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Polkadotjs_4.png').default } width="70%" />

Best to create an account that is allowed on any chain in the Polkadot ecosystem including Astar or Shiden Network. Your account will automatically change format when connected to a chain.

A **descriptive name** is arbitrary and for your use only. It is not stored on the blockchain and will not be visible to other users who look at your address via a block explorer. If you're juggling multiple accounts, it helps to make this as descriptive and detailed as needed.

The **password** will be used to encrypt this account's information. You will need to re-enter it when using the account for any kind of outgoing transaction or when using it to cryptographically sign a message.

After clicking on `Add the account with the generated seed`, your account is created. We recommend also saving your account as json file somewhere safe.

</details>

<details>
<summary>**[Talisman](https://www.talisman.xyz/)**</summary>

### Install the Browser Extension

The extension is available on [chrome](https://chromewebstore.google.com/detail/talisman-ethereum-and-pol/fijngjgcjhjmmpcmkeiomlglpeiijkld?hl=en-GB) and [firefox](https://addons.mozilla.org/en-US/firefox/addon/talisman-wallet-extension/).


### Create a New Account

Once the extension is downloaded you can proceed to setup your account.

1. In order to set up a wallet, click `New wallet`.

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Talisman_1.webp').default } width="90%" />

2. Add a password for your account and click `Continue`.

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Talisman_2.webp').default } width="70%" />

3. Last step is to decide on allowing anonymous information to help talisman improve the wallet. Click any option and the setup is finished!

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Talisman_3.webp').default } width="70%" />

### Create a new account in video

<p align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/JevNbPem3gQ?si=WzEGaZZ5cy4dcVkZ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe></p>

**Don't forget to Back Up Your Secret Phrase! Consult [this guide](https://docs.talisman.xyz/talisman/start/installing-talisman/back-up-your-secret-phrase) if necessary.**

</details>

<details>
<summary>**[Subwallet](https://www.subwallet.app/)**</summary>

### Install the Browser Extension

The extension is available on [chrome](https://chromewebstore.google.com/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn) and [firefox](https://addons.mozilla.org/en-US/firefox/addon/subwallet/).

### Create a New Account

1. After installing SubWallet extension, open the wallet and choose `Create a new account`;

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Subwallet_1.webp').default } width="30%" />

2. Create a master password and click `Continue`;

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Subwallet_2.webp').default } width="30%" />

3. Keep your recovery phrase (also known as seed phrase or secret phrase) in a safe place;

<Figure src={require('/docs/use/dapp-staking/for-devs/img/Subwallet_3.png').default } width="30%" />

4. Your account has been successfully set up. Click `Exit` to get to Homepage;

### Create a new account in video

<p align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/WPZvZixXz3k?si=LdWnrFfkdJVZa3-m" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe></p>

</details>

#### Connect your wallet to Astar Portal

Visit the [Astar Portal](https://portal.astar.network/astar/assets) and connect your wallet. Once signed in, you'll see your native Astar address on the home page.

Format: `YQnbw3oWxBnCUarnbePrjFcrSgVPP2jqTZYzWcccmN8fXhd`

#### 2. Deploy a Smart-Contract in our ecosystem and verify the contract in an explorer.

1. The first option is to use one of your **own smart contracts** and verify it.

2. The second option is reserved for those who don't handle smart contracts. Deploy our `helloworld.sol` contract and provide all the information in the header of the contract. [Template contract](https://github.com/AstarNetwork/builders-program/blob/main/hellowold.sol).

The smart contract can be on Astar Native (WASM), Astar EVM or Astar zkEVM.

For the explorer, you can use:
- [Subscan](https://astar.subscan.io/) for Astar Native;
- [Blockscout EVM](https://astar.blockscout.com/) for EVM;
- [Astar zkEVM explorer](https://astar-zkevm.explorer.startale.com/) for Astar zkEVM.

#### 3. Once the vote is passed, share your addresses with the Astar Foundation.

You can share your **Astar native address** and the **verified smart-contract address** in the discussion of your dApp Staking application on the [Astar Forum](https://forum.astar.network/);

The Astar Foundation will whitelist your addresses for dApp Staking registration and inform you that you can proceed to step 2.

## Step 2
## Step 2: Register your dApp on the Astar Portal

After whitelisting, visit the dApp Staking page on the [Astar portal](https://portal.astar.network/astar/dapp-staking/discover).

Connect your wallet and choose the network on which you are going to register for dApp Staking *(Astar Network or Shiden Network)*;

<Figure src={require('/docs/use/dapp-staking/for-stakers/img/Networks.png').default } width="90%" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ sidebar_label: ローカル環境における zkNode のセットアップ

現在のバージョンの環境におけるチュートリアルには、前もってコンピューターに `go`、`docker`、`docker-compose`がインストールされている必要があります。 インストールされていない場合は、以下のリンクを確認してください:

-
- [https://go.dev/doc/install](https://go.dev/doc/install)
- [https://www.docker.com/get-started](https://www.docker.com/get-started)
- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)

### システム要件

Expand All @@ -47,11 +49,13 @@ sidebar_label: ローカル環境における zkNode のセットアップ
zkEVMノードのセットアップを開始する前に、Polygon zkEVM Githubから[公式のzkNodeリポジトリ](https://github.com/0xPolygonHermez/zkevm-node)をクローンする必要があります。

```bash
git clone https://github.com/0xPolygonHermez/zkevm-node.git
```

`zkevm-node` docker イメージは、少なくとも1回、加えてコードが変更されるたびにビルドする必要があります。 `zkevm-node`イメージをまだビルドしていない場合は、以下のコマンドを実行する必要があります:

```bash
make build-docker
```

:::caution Docker イメージのビルド
Expand All @@ -75,21 +79,25 @@ zkEVMノードのセットアップを開始する前に、Polygon zkEVM Github
`test/`ディレクトリには、開発とデバッグのためのスクリプトとファイルが含まれています。 ローカルマシンの作業ディレクトリを `test/` に移動します。

```bash
cd test/
```

ここで、zkNode 環境を実行します:

```bash
make run
```

zkNodeを停止するには:

```bash
make stop
```

zkNode 環境全体を再起動するには:

```bash
make restart
```

## 設定パラメーター
Expand Down Expand Up @@ -150,3 +158,4 @@ MetaMaskを設定している間、ネットワークが動作している必要
8. **保存**をクリックします

これで、ローカルのzkEVMネットワークとやり取りし、MetaMaskウォレットからトランザクションに署名できるようになりました。

Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ DAppプロジェクトは、公共インフラに頼らず、必要なブロッ
ネットワークが拡大するにつれて、ストレージスペースの要件が増大します。
:::

-
- 16GB RAM
- 4コアのCPU
- 100GBのストレージ (時間の経過とともに増加します)

### Prerequisites

このチュートリアルでは、コンピューターに `docker` と `docker-compose` がインストールされている必要があります。 インストールされていない場合は、以下のリンクを確認してください:

-
-
- [https://www.docker.com/get-started](https://www.docker.com/get-started)
- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)

### イーサリアムRPCノード

Expand All @@ -43,11 +43,11 @@ Ethereum RPCの実行には2つのオプションがあります:

このセクションでは、**Astar zkEVM** RPCノードの機能に必要な5つのコンテナを起動します。

-
-
-
-
-
- zkevm-rpc
- zkevm-sync
- zkevm-state-db
- zkevm-pool-db
- zkevm-prover

このDocsの執筆時点で、**zKatana testnet** は **Astar zkEVM** に利用可能な唯一のネットワークです。 そしてL1のイーサリアム**セポリアテストネット**に接続されています。

Expand All @@ -56,46 +56,72 @@ zKatana testnet上で開発していきましょう。
設定、インストール、およびデータ専用のディレクトリをそれぞれ作成します。

```bash
sudo mkdir -p /etc/zkevm/{install,config} && sudo chown -R $USER:$USER /etc/zkevm
sudo mkdir -p /var/lib/zkevm/{statedb,pooldb} && sudo chown -R $USER:$USER /var/lib/zkevm/
```

ローカル変数を設定します。

```
# define installation and config path
ZKEVM_NET=testnet
ZKEVM_DIR=/etc/zkevm/install
ZKEVM_CONFIG_DIR=/etc/zkevm/config
```

アーティファクトをダウンロードし、抽出します。

```bash
wget https://shared-assets.astar.network/files/zkevm/zkatana/zkatana.tar.gz
tar -xf zkatana.tar.gz -C $ZKEVM_DIR && rm zkatana.tar.gz
```

envファイルをコピーし、L1のRPCのURLを編集します。

```bash
cp $ZKEVM_DIR/$ZKEVM_NET/example.env $ZKEVM_CONFIG_DIR/.env
nano $ZKEVM_CONFIG_DIR/.env
```

パラメータを変更します。

```bash
# Use your own Sepolia RPC URL here!!
ZKEVM_NODE_ETHERMAN_URL = "https://eth-sepolia-public.unifra.io"
```

ノードの設定ファイルを編集します。

```bash
nano $ZKEVM_DIR/$ZKEVM_NET/config/environments/$ZKEVM_NET/node.config.toml
```

次のパラメータを変更します。セキュリティを強化するために、データベースのデフォルトのユーザーおよびパスワードを変更することもできます。

```
[Etherman]
# Set your own Sepolia RPC URL
URL = "https://eth-sepolia-public.unifra.io"

# Enable if you want to exploit metrics from nodes
[Metrics]
Enabled = true
```

コンテナを起動します。

```bash

# start all the containers
sudo docker compose --env-file $ZKEVM_CONFIG_DIR/.env -f $ZKEVM_DIR/$ZKEVM_NET/docker-compose.yml up -d
# or start containers on by one
sudo docker compose --env-file $ZKEVM_CONFIG_DIR/.env -f $ZKEVM_DIR/$ZKEVM_NET/docker-compose.yml up -d <container-name>
```

すべてのコンテナが起動し、動作していることを確認します。ステータスがUpになっているコンテナが5つ表示されるはずです。

```bash
sudo docker ps
```

これで**Astar zkEVM** RPCノードがポート8545上で動作するようになりました。あとは同期するのを待つだけです。
Expand All @@ -111,11 +137,18 @@ sudo docker logs -fn30 <container-name>
RPCリクエストをテストします。

```bash
# Get the chain Id
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "eth_chainId", "params": []}' http://localhost:8545
# Expected response
{"jsonrpc":"2.0","id":1,"result":"0x133e40"}
# Get the latest block
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "eth_getBlockByNumber", "params": ["latest", false]}' http://localhost:8545
```

コンテナを停止します。

```bash
sudo docker compose --env-file $ZKEVM_CONFIG_DIR/.env -f $ZKEVM_DIR/$ZKEVM_NET/docker-compose.yml down
```

## その他
Expand All @@ -125,6 +158,7 @@ RPCリクエストをテストします。
RPCでトレース機能(`debug`と`txpool`モジュール)を有効にするには、`docker-compose`ファイルの`zkevm-rpc`コンテナに次のコマンドを追加します:

```
--http.api=eth,net,debug,zkevm,txpool,web3
```

### 外部からのアクセス
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sidebar_position: 4
title: Astar zkEVM Faucet
sidebar_label: Faucet
title: Astar zkEVM 蛇口
sidebar_label: 蛇口
---
import sepolia from '/docs/build/zkEVM/img/metamask-sepolia-select.png'
import useBaseUrl from '@docusaurus/useBaseUrl';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,5 @@
---
sidebar_position: 0
---
{
"label": "使用",
"position": 3
}

# Polkadot.jsでdApp Staking報酬を手動で請求する

Astar PortalでdApp Staking報酬を請求する際に問題がある場合は、Polkadot.jsのウェブサイトで手動で請求することができます。 以下の手順に従ってください。

***

**ステップ 1: あなたがステーキングしているコントラクトアドレスを確認する**

1. [Astar Portal](https://portal.astar.network/)にアクセスし、希望のネットワークに接続してください。
2. dApp Stakingに移動し、「Re-Stake after claiming」をオフにします。
3. 「My dApps」に移動します。
4. あなたがステーキングしているdAppsのリストを見ることができます。
5. ステーキングしている各dAppの情報に移動し、コントラクトアドレスを見ることができます。
6. 次のステップの参照としてコントラクトアドレスをメモ帳等に保存しておきます。

***

**ステップ 2: Polkadot.jsで報酬を受け取る**

1. 新しいブラウザタブを開き、[Polkadot.Js web appl](https://polkadot.js.org/apps/#/extrinsics)を開きます。
2. 正しいチェーン(Astar/Shiden/Shibuya) に接続していることを確認してください。
3. 正しいウォレットで接続していることを確認してください。
4. 「Developer 」の「Extrinsics」をクリックします。
5. 左のドロップダウンメニューで「dappsStaking」を選択します。
6. 右のドロップダウンメニューで、 「claimStaker」を選択します。
7. 「EVM: H160」に、あなたがメモ帳に記録していたコントラクトアドレスを貼り付けます。例:「0xaab44542c72f88f7b98fffda418e3efe94bc13af」
8. 「Submit Transaction」をクリックし、トランザクションにサインをする前にチップを追加します。
9. 大量の未請求の報酬がある場合は、すべての報酬が請求されるまで何度もこの手順を繰り返す必要があります。
10. 一度に一つのERAを請求しなければなりません。
11. すべての報酬を請求した後、Portalに戻って「Re-Stake after claiming」をオンにすることができます。

***

以上です。 上記のいずれを実施しても解決出来ない場合は、 <a href="https://discord.gg/2FGq5KqwBh">Discord</a> にてチームメンバーまたはエコシステムエージェントに連絡してください。