Skip to content

Commit

Permalink
docs(#10,#12): add EVM++ docs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xDevVoyager committed Dec 10, 2024
1 parent 1912167 commit a2e9af5
Show file tree
Hide file tree
Showing 5 changed files with 584 additions and 0 deletions.
106 changes: 106 additions & 0 deletions md/Deploying a contract on EVM++ Chain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Deploying a Contract on EVM++ Chain

This guide explains how to deploy a smart contract to the Artela EVM++ chain using Remix. Follow these steps to ensure a smooth deployment.

---

## Prerequisites

Before starting, make sure you have:

1. **MetaMask Wallet**
- Installed and configured.
- Connected to the Artela EVM++ chain with the correct RPC endpoint.

Example configuration:
- Network Name: `Artela EVM++`
- RPC URL: `https://rpc.artela.network`
- Chain ID: `11820` (Note that the chain ID of the artela EVM++ chain is the middle part of the chain ID in the configured cosmos format, such as 11820 of artroll_11820-1)
- Currency Symbol: `ART`

2. **Remix IDE**
- Accessible at [https://remix.ethereum.org](https://remix.ethereum.org).
- Installed browser extensions if needed for better performance.

3. **Test Funds**
- Acquire ART tokens for gas fees via the Artela faucet or other sources.

---

## Step 1: Write or Import Your Contract

1. Open Remix IDE.
2. In the "File Explorer" panel, create a new file or import an existing contract. For example, a simple `HelloWorld.sol` contract:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract HelloWorld {
string public message;
constructor(string memory _message) {
message = _message;
}
function updateMessage(string memory _newMessage) public {
message = _newMessage;
}
}
```

3. Save the file.

---

## Step 2: Compile the Contract

1. Go to the "Solidity Compiler" plugin in Remix.
2. Select the appropriate compiler version (e.g., `0.8.0`) to match your contract's pragma.
3. Click "Compile HelloWorld.sol."
- Ensure there are no errors before proceeding.

---

## Step 3: Connect MetaMask to Remix

1. Open the "Deploy & Run Transactions" plugin in Remix.
2. Under the "Environment" dropdown, select "Injected Provider - MetaMask."
3. MetaMask will prompt you to connect to Remix. Approve the connection.

---

## Step 4: Deploy the Contract

1. Verify the "Account" dropdown in Remix shows your MetaMask account.
2. Select the compiled contract from the "Contract" dropdown (e.g., `HelloWorld`).
3. Provide any constructor arguments in the input field, if required.
- For the `HelloWorld` contract, you can enter `"Hello, Artela!"`.
4. Click "Deploy."

MetaMask will display a transaction confirmation dialog. Review the details and confirm the transaction.

---

## Step 5: Verify Deployment

1. After deployment, the contract address will appear in the Remix "Deployed Contracts" section.
2. Copy the contract address and verify it using Artela's blockchain explorer (e.g., Blockscout).
- Visit [Artela Explorer](https://explorer.artela.network) and search for the contract address.

---

## Step 6: Interact with the Contract

1. In Remix, expand the deployed contract.
2. Use the available functions to interact with the contract. For example:
- Call `message()` to view the current message.
- Call `updateMessage("New message")` to update the message.

---

## Troubleshooting

- **Gas Errors**: Ensure your wallet has enough ART tokens.
- **Compilation Errors**: Check for syntax or version mismatches in the Solidity code.
- **RPC Errors**: Verify your MetaMask network configuration matches the Artela EVM++ settings.
200 changes: 200 additions & 0 deletions md/Launching a Hyperlane bridge on EVM++ Chain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# Hyperlane Setup Guide for ArtRollkit Test Bridging

This guide explains how to use Hyperlane to set up test bridging on ArtRollkit. We will start with environment preparation and gradually complete the bridge setup and testing.
Refer to the documentation: [Hyperlane Documentation](https://docs.hyperlane.xyz/docs/intro)

---

## 1. Environment Preparation

### 1.1 Install Necessary Tools

Before starting, make sure the following tools are installed:

- Node.js (recommended version: 22.10.0)
- npm (version 10.9.0 or higher)
- `hyperlane` CLI tool
- jq (installed at `/usr/bin/jq`)

Ensure the testnet or local network is running and you have the following artifacts and assets available:

- Metadata:
- Chain name, e.g., `artroll1`
- Chain ID, e.g., `11820`
- RPC URL, e.g., `https://rpc.artroll1.com`
- A deployer wallet/EOA private key or seed phrase. This EOA should be funded on your custom chain and any chain you will be passing messages to and from.

If you need to deploy ArtRollkit locally, follow these steps:

1. Clone the ArtRollkit repository:

```bash
git clone https://github.com/artela-network/artela-rollkit.git
cd artela-rollkit
```

2. Start the local test network:

```bash
docker compose up -d
```

Verify the node is running successfully:

```bash
curl http://localhost:26657/status
```

### 1.2 Ensure Hyperlane CLI is Properly Installed

Verify that the Hyperlane CLI is installed correctly:

```bash
hyperlane --version
```

If it is not installed, run the following commands:

```bash
npm install -g @hyperlane-xyz/cli
# Or uninstall old versions
npm uninstall -g @hyperlane-xyz/cli
```

Ensure the `hyperlane` executable is in the correct path:

```bash
echo $PATH
```

### 1.3 Set Up Working Directory

Create a directory for Hyperlane configuration and operations:

```bash
mkdir -p ~/.artroll/hyperlane-bridge && cd ~/.artroll/hyperlane-bridge
```

---

## 3. Configure New Chain

### 1. Download the Registry

```bash
git clone https://github.com/hyperlane-xyz/hyperlane-registry.git
```

### 2. Create a Custom Chain Configuration

Run the following command to initialize the configuration file:

```bash
hyperlane registry init --registry /your/path/to/hyperlane-registry
```

The configuration file is located at `$HOME/.hyperlane/chains/metadata.yaml`.

### 3. Configure, Deploy, and Test Core Contracts

Set an environment variable for the private key of the EOA funded on your custom chain:

```bash
export HYP_KEY='<YOUR_PRIVATE_KEY>'
```

Initialize the core contract configuration:

```bash
hyperlane core init --registry /your/path/to/hyperlane-registry
```

Deploy the contracts:

```bash
hyperlane core deploy --registry /your/path/to/hyperlane-registry
```

### 4. Run a Test Relayer

Run a relayer between your custom chain and Sepolia:

```bash
hyperlane relayer --chains yourchain,sepolia
```

### 5. Send a Test Message

```bash
hyperlane send message --relay
```

---

## 4. Deploy a Warp Route and Bridge a Token

During the deployment of the Warp Router, continue using the `HYP_KEY` for signing transactions:

```bash
export HYP_KEY='<YOUR_PRIVATE_KEY>'
```

### 1. Create Warp Route Configuration File

```bash
hyperlane warp init --registry /your/path/to/hyperlane-registry
```

For Warp Router configuration options, refer to the [deployment config schema](https://docs.hyperlane.xyz/docs/guides/deploy-warp-route#deployment-config-schema).

### 2. Deploy the Warp Route

Deploy the Warp Router to your custom chain and target chain:

```bash
hyperlane warp deploy
```

### 3. Test the Warp Route

```bash
hyperlane warp send --relay --symbol TOKEN --registry /your/path/to/hyperlane-registry
```

---

## 5. Run Local Bridge UI

Build the registry:

```bash
cd /your/path/to/hyperlane-registry
yarn build
```

Clone the UI source code:

```bash
git clone https://github.com/hyperlane-xyz/hyperlane-warp-ui-template.git
cd hyperlane-warp-ui-template
```

Replace the registry package path in `package.json`:

```json
"@hyperlane-xyz/registry": "4.11.1",
```

Change to:

```json
"@hyperlane-xyz/registry": "file:/your/path/to/hyperlane-registry",
```

Build the source and run:

```bash
yarn install && yarn build && yarn start
```

Then, in the opened browser page, you should see the newly added token pair and custom chain.
Loading

0 comments on commit a2e9af5

Please sign in to comment.