1. Nervos IDE Environment Configuration
This page discusses how to configure the Nervos IDE environment. The method of how to create a Nervos project, add a Godwoken network and create a Layer2 account to get test tokens is described.
To create a Nervos project, first, enter the ChainIDE entry page, and click "Try Now", you can view all files, click New Project and select Nervos to create a Nervos chain project.
Then click the new project button, select Nervos on left, and select a project template on the right to create a Nervos project.
After creating the project, click the unconnected button in the upper right corner and select the "Injected Web3 Provider button", select the MetaMask wallet and connect to the MetaMask wallet.
After entering the project, click Logger, to evoke the bottom panel, switch to the terminal panel, and click to create a terminal that creates a godwoken-kicker-dind image.
To deploy the local Godwoken Network, follow these steps:
- Clone and pull the Github repository of Godwoken-kicker. If you have already cloned the project, then skip this step.
git clone https://github.com/RetricSu/godwoken-kicker.git
- Initialize Godwoken-kicker
- Start the Godwoken Network
For a detailed startup process, please refer to http://docs.godwoken.io/deployment/
After startup, you need to pay attention to the following two-port services:
- 8024: Godwoken network Web3 RPC port
- 6101: Polyman or Polyjuice server port
After the network is successfully started, open the port forwarding panel on the left, click Add port, select the godwoken-kicker-ding image, enter 8024 and 6101 respectively, and forward these two ports so that the outside can access the above services.
After the 8024 and 6101 ports are forwarded, add the local network configured to start the wallet at the lower right. First, click to open the wallet, then click to switch network to open the network switch pop-up window.
Select Godwoken Devnet in the pop-up window, the chin id is fixed 0xfa309 (decimal 1024777), then enter the 8024 Godwoken network Web3 RPC URL forwarded above, click Switch to invoke MetaMask, and click Approve to confirm the switch.
After the network is added to the MetaMask, we also need to recharge CKB for the account address connected to the current MetaMask (create a Godwoken address for it) so that we can interact with the local chain later.
Open the wallet, click the recharge CKB button to open the pop-up window, enter the polyman service forwarded by 6101, click recharge and wait for the local network to recharge. After the recharge is successful, the pop-up window will automatically close, and you can click the refresh icon next to the balance to refresh the account balance.
First, we need to add the Godwoken V1 test network in MetaMask
Click the bottom right side to open the bottom wallet, click the switch network button in the wallet, and open the network switch pop-up window.
Select Godwoken Testnet V1 in the pop-up window, and the officially provided testnet chainid and PRC URL will be filled in by default, and directly click to switch to evoke MetaMask. Confirm the switch to the Godwoken test network in the MetaMask pop-up window. If this network has not been added to the MetaMask, MetaMask will add the network first and then switch when clicking switch.
Switch Network to Godwoken Testnet V1
After the network is successfully added, you need to recharge CKB for the currently connected Ethereum account address and create an account on the Godwoken test network (Layer 2) for it.
Click the recharge CKB button in the wallet to open the recharge pop-up window. We provide users with two ways to quickly recharge:
Click to recharge directly in the pop-up window and open the Light Godwoken website. Connect MetaMask to the website,
copy L1 wallet address and claim from faucetbutton to go to the testnet faucet to get CKB.
After the CKB of the faucet is received, go back to Light Godwoken and enter the amount of CKB to be recharged, and click Deposit to recharge the CKB for the current Ethereum account.
Light Godwoken Deposit CKB
Since the Godwoken V1 network is still under development, the follow-up deposit method may be changed
- Top-up via Nervos Godwoken Integration SDK
Nervos Godwoken Integration is an official SDK provided by Nervos related to the account operations on the Godwoken network, including creating a Layer2 account, Withdraw, Unlock, etc. We have integrated this SDK in ChainIDE. The user selects the godwoken-integration recharge method in the recharge pop-up window, clicks the recharge to invoke metamask to sign the transaction, and then waits for the successful execution of the transaction to automatically close the pop-up window and refresh the balance of the currently connected account.
It should be noted that using this method requires the user's currently connected account to have at least 470CKB on the nervos test network (400CKB will be recharged each time the SDK is called, and an additional 70CKB is required to pay the transaction fee). We show the nervos layer1 address of the account and the address of the test network faucet. Users can go to the faucet to get the test CKB.
First, we need to add Godwoken mainnet in MetaMask
Click the bottom right side to open the bottom wallet, click the switch network in the wallet, and open the network switch pop-up window.
Select Godwoken mainnet in the pop-up window, and the officially provided mainnet chainid and PRC URL will be filled in by default, and directly click to switch to evoke MetaMask. Confirm the switch to the Godwoken test network in the MetaMask window.
After the network is successfully added, you need to recharge CKB for the currently connected Ethereum account address and create an account on the Godwoken mainnet for it.
Click the recharge CKB button in the wallet to open the recharge pop-up window. Click to recharge to open CKB Tools Website.
Switch to Mainnet in the website, click the Create Layer 2 account button to open the pop-up window, you can view the layer 1 mainnet address of the currently connected Ethereum account, and the user needs to transfer CKB to this address to create an account.