---
# System prepended metadata

title: EOS smart contract demo

---

# EOS smart contract demo

## Genesis

[eos连接主网配置文件解析](https://www.jianshu.com/p/7984d65d3c7d)

https://github.com/espritblock/eos/blob/master/config.ini

## Init

docker

```shell=
docker run -d -it -p 8881:8080/tcp -p 8821:22/tcp --name eos1 tony92151/eos_lab:v3
```

```shell=
docker run -d -it -p 8882:8080/tcp -p 8822:22/tcp --name eos2 tony92151/eos_lab:v3
```

```shell=
docker run -d -it -p 8883:8080/tcp -p 8823:22/tcp --name eos3 tony92151/eos_lab:v3
```

```shell=
docker run -d -it -p 8884:8080/tcp -p 8824:22/tcp --name eos4 tony92151/eos_lab:v3
```
Go to http://localhost:8881 and login with Password "eospc"

```shell=
sh -c "echo \"alias cleos='/usr/bin/cleos -u https://api.testnet.eos.io'\" >> ~/.bashrc"
source ~/.bashrc
```
```shell=
cleos wallet list
cleos wallet create -n tony --file tony.txt

cleos wallet import -n tony
# enter your owner private key from eostestnet

cleos get account [your account's name]
```
![](https://i.imgur.com/kTMLTyh.png)

prepair another account

```shell=
cleos push action eosio.token transfer '[ "vdqfllefkglk", "ozjkloygsxzk", "1.0000 TNT", "m" ]' -p vdqfllefkglk
```

![](https://i.imgur.com/HKjUoMK.png)

balance from `vdqfllefkglk` are reduced

![](https://i.imgur.com/xd5IoFB.png)


## Web monitor

[EOS Jungle2.0 Testnet Monitor](https://monitor.jungletestnet.io/)

[CryptoLions/EOS-Network-monitor](https://github.com/CryptoLions/EOS-Network-monitor) :+1: 

[EOS-Monitor](https://github.com/cryptokylin/EOS-Monitor)


in **CryptoLions/EOS-Network-monitor**

[Backend repo](https://github.com/CryptoLions/EOS-Network-Monitor-back)
[Frontend repo](https://github.com/CryptoLions/EOS-Network-Monitor-front) :+1: 


[EOS-Network-Monitor-front/app/constants.js **L16**](https://github.com/CryptoLions/EOS-Network-Monitor-front/blob/ccaa9d2831e475117b4dad9b5ae4013d20ab9d15/app/constants.js#L16)

```javascript=
import EosApi from 'eosjs-api';

export const CHAIN_ID = 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906';

export const THROTTLE_TIMEOUT = 600;

export const API_KEY = 'AIzaSyBJrgbdsOfzPMKQFcsnXJHtbwxlVglXkVw';

// how many transaction do we keep in the reducer
export const TRANSACTIONS_LIMIT = 50;

export const HISTORY_ITEMS_PER_PAGE = 10;

// Eos API
export const EOS = EosApi({
  httpEndpoint: 'https://bp.cryptolions.io',
});
```

