# Engram Tokio

## Engram Tokio Chain Testnet

**Participants need to install Metamask Wallet and connect to our EVM chain configuration.&#x20;**<mark style="color:red;">**Please create new Wallet, save wallet address and private key.  (note 1)**</mark>

Blockchain Name: Engram Tokio Testnet\
RPC Address: <https://tokioswift.engram.tech\\>
Chain ID: 131\
Ticker: tGRAM\
Explorer: <https://tokioscan-v2.engram.tech>

Faucet: [https://faucet-tokio.engram.tech](https://faucet-tokio.engram.tech/)

## Server preparation

**Ubuntu 22.04**

**Port Required:**&#x20;

8545/tcp&#x20;

30303/tcp-udp&#x20;

8551/tcp

```
sudo apt update && apt upgrade -y
sudo apt install git curl -y
sudo apt install make clang pkg-config libssl-dev build-essential -y
```

## Install Docker

```
sudo apt install curl -y && curl -sO https://nodesync.top/docker_install && chmod +x docker_install && bash docker_install
```

### Setup Node Engram

```
git clone https://github.com/engram-network/tokio-docker.git 
cd tokio-docker
git checkout dencun
chmod +x ./scripts/*.sh
./scripts/install-asdf.sh
mkdir -p execution consensus
```

## Check `eth2-val-tools` and `ethereal`installed on your system and Validator Deposit Data

```
eth2-val-tools --help
ethereal version
```

Once everything required is fulfilled, you need to create a mnemonic phrase to prepare the deposit data. <mark style="color:blue;">**Keep your 24 words mnemonic! (note 2)**</mark>

```
eth2-val-tools mnemonic 
```

Change your info in file **validator-deposit-data.sh**

<pre><code><strong>nano scripts/validator-deposit-data.sh
</strong></code></pre>

**withdrawals-mnemonic:** your mnemonic phrase from generate eth2-val-tools.  <mark style="color:blue;">**(note 2)**</mark>

**validators-mnemonic:** your mnemonic phrase from generate eth2-val-tools. <mark style="color:blue;">**(note 2)**</mark>

**from:** address that was already funded from the faucet. <mark style="color:red;">**(note 1)**</mark>

**privatekey:** your privatekey address that has funds from the faucet. <mark style="color:red;">**(note 1)**</mark>

#### Run the following command to generate final the deposit data

You need faucet token and and check have 32 token on wallet <mark style="color:red;">**(note 1) ,**</mark> before run bellow

```
bash scripts/validator-deposit-data.sh
```

## Validator Build

```
bash scripts/validator-build.sh
```

Please choose your language \['1. العربية', '2. ελληνικά', '3. English', '4. Français', '5. Bahasa melayu', '6. Italiano', '7. 日本語', '8. 한국어', '9. Português do Brasil', '10. român', '11. Türkçe', '12. 简体中文']:&#x20;

<mark style="color:blue;">**choose 3 + enter**</mark>

Please repeat the index to confirm:

<mark style="color:blue;">**choose 0 + enter**</mark>

Please enter your mnemonic separated by spaces (" "). Note: you only need to enter the first 4 letters of each word if you'd prefer.:

<mark style="color:blue;">**Paste your 24 words mnemonic! (note 2) + enter**</mark>

Please choose the (mainnet or testnet) network/chain name \['mainnet-soon', 'devnet-1', 'devnet-3', 'devnet-4', 'devnet-5', 'testnet']: \[mainnet-soon]:

<mark style="color:blue;">**choose  testnet + enter**</mark>

<mark style="color:blue;">**Enter yourpass and enter again**</mark>

## **Configure Docker Compose**

<pre><code><strong>nano docker-compose.yml
</strong></code></pre>

Change your info by note red on bellow image

<figure><img src="https://2585830168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRzXvi3emVKzTi94K7StD%2Fuploads%2FbKdPqBKljPIWMDDkiUcv%2Fengram1.PNG?alt=media&#x26;token=14e8138e-5836-475c-a814-c52a0f7662ce" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2585830168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRzXvi3emVKzTi94K7StD%2Fuploads%2FxgQYukR5rOjf5cDOKTRe%2Fengram2.PNG?alt=media&#x26;token=3c7db967-4c20-45ac-9591-a0c801ca0393" alt=""><figcaption></figcaption></figure>

ctrl+o, enter&#x20;

ctrl +x

```
docker compose up -d
```

You see result bellow

\[+] Running 4/4&#x20;

⠿ Network tokio\_default\_default Created&#x20;

⠿ Container striatum\_init Exited&#x20;

⠿ Container striatum\_el Started&#x20;

⠿ Container lighthouse\_init Exited&#x20;

⠿ Container lighthouse\_cl Started&#x20;

⠿ Container lighthouse\_vc Started

## Check logs

```
docker logs -f striatum_el 
```

```
docker logs -f lighthouse_cl
```

View node on : <https://nodewatch.engram.tech/>

Read more: <https://github.com/engram-network/tokio-docker/wiki/Become-Validator-&-help-secure-the-future-of-Engram-Network>

## Create Contract

```
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract ERC20Token {
    string public name = "xxxxxxxx";
    string public symbol = "xxx";
    uint8 public decimals = 18;
    uint256 public totalSupply = 1000000 * 10**uint256(decimals);

    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    constructor() {
        balanceOf[msg.sender] = totalSupply;
    }

    function transfer(address to, uint256 value) public returns (bool success) {
        require(to != address(0), "Invalid address");
        require(balanceOf[msg.sender] >= value, "Insufficient balance");

        balanceOf[msg.sender] -= value;
        balanceOf[to] += value;

        emit Transfer(msg.sender, to, value);
        return true;
    }

    function approve(address spender, uint256 value) public returns (bool success) {
        require(spender != address(0), "Invalid address");

        allowance[msg.sender][spender] = value;

        emit Approval(msg.sender, spender, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value) public returns (bool success) {
        require(from != address(0), "Invalid address");
        require(to != address(0), "Invalid address");
        require(balanceOf[from] >= value, "Insufficient balance");
        require(allowance[from][msg.sender] >= value, "Allowance exceeded");

        balanceOf[from] -= value;
        balanceOf[to] += value;
        allowance[from][msg.sender] -= value;

        emit Transfer(from, to, value);
        return true;
    }
}
```
