telos docs
Search…
Telos EVM Controller
tevmc is a python 3.x library/command line tool to help bootstrap and managment of Telos EVM local, testnet and mainnet nodes.

COMING SOON!

Requirements

  • git
  • docker
  • python3

Quickstart

Thanks to Teo from TelosKoreaBP for this quick rundown:
1
## Need installed python version >= python 3.7
2
## Requires root at the moment.
3
4
git clone https://github.com/telosnetwork/telos-evm-docker.git
5
cd telos-evm-docker
6
7
apt-get update && apt-get install python3-venv
8
python3 -m venv .venv
9
source .venv/bin/activate
10
11
## from now on we are working in the virtual environment.
12
## just run 'deactivate' when you want to deactivate virtual environment.
13
14
pip install pip --upgrade
15
pip install -U --no-cache-dir -e . -r requirements.txt
16
17
tevmc init testnet
18
cd testnet
19
20
## Modify tevmc.json
21
## For mainnet, signer_account, signer_permission, signer_key
22
## Containers use ports of host machine so you need to check the ports if used already.
23
tevmc build --headless
24
tevmc up
25
26
# Start process to backup logs
27
tail -f tevmc.log > backup.tevmc.log &
28
29
## Wait until nodeos synced and hyperion-api activated.
30
## To stop:
31
tevmc down
Copied!

Installation

tevmc is a python installable package, and its currently available on github.
  1. 1.
    git clone [email protected]:telosnetwork/telos-evm-docker.git
  2. 2.
    cd telos-evm-docker
  3. 3.
    git checkout python_toolchain
  4. 4.
    pip install -U -e .
Once the package installation finishes, you should be able to invoke:
  • tevmc --help

Initialization

tevmc uses a specific self-contained directory structure for each individual node, to create a new node directory from template use the init sub command.
  • tevmc init {node name}
There are three templates available:
  • local: Local development testnet
  • testnet: Standard testnet node
  • mainnet: Standard mainnet node
If your node name contains any of this names the corresponding template will be selected. Examples:
  • tevmc init local-dev-1 # will use local template
  • tevmc init us-testnet-04 # will use testnet template
  • tevmc init rpc.mainnet-07 # will use mainnet template

Configuration

Inside the directory created by the init command you'll see a docker directory and the unified config file tevmc.json.
From the newly created node directory run:
tevmc build --headless
The first time you build the images tevmc will populate all the different config files in the docker directory based of the values in the unified config file. After that it will only re-create the files from templates if it detects changes on tevmc.json.

Bootstrap

With the docker images built we can launch the node:
tevmc up # launch daemon on the background
tevmc up && tevmc wait-init # launch and stream output until ready
You should eventually see control point reached! in the logs, at that point the full node stack should be up and ready to serve requests.

Where is the data?

The idea is to create self contained node directories, which can be easily moved with the stack down.
Each sub-directory inside main docker path generally contains a combination of this directories:
  • build docker build context
  • config editable configuration files, mounted to were they are needed inside the respective container.
  • data permanent storage kept between runs
  • logs log file location

Full directory structure

1
node/
2
├── docker/
3
│   ├── beats/
4
│   ├── elasticsearch/
5
│   ├── eosio/
6
│   ├── hyperion/
7
│   ├── kibana/
8
│   ├── rabbitmq/
9
│   └── redis/
10
└── tevmc.json
Copied!

Monitoring

You can stream logs from any container using the stream sub command:
tevmc stream {source}
Available sources:
  • daemon
  • redis
  • rabbitmq
  • beats
  • elasticsearch
  • kibana
  • eosio
  • hyperion-indexer
  • hyperion-api

Landing

To bring the stack down run:
tevmc down
This will perform graceful nodeos stop and bring down all containers.

FAQ

Can I use this to process and index both native & EVM transactions?

Yes, but will need to set correct producer keys on nodeos and un-whitelist eosio.evm on Hyperion config.

As soon as I launch the stack it crashes with an error like this one:

1
07:00:32:WARNING:Starting daemon.
2
07:00:32:INFO:opening redis-2122399...
3
07:00:33:INFO:running
4
07:00:33:INFO:
5
07:00:33:INFO:*** FATAL CONFIG FILE ERROR (Redis 6.2.6) ***
6
07:00:33:INFO:Reading the configuration file, at line 92
7
07:00:33:INFO:>>> 'port $redis_port'
8
07:00:33:INFO:argument couldn't be parsed into an integer
9
07:00:33:CRITICAL:container status: removing, log dump:
10
07:00:33:CRITICAL:couldn't access logs.
11
07:00:33:WARNING:Stopping daemon.
Copied!
This error usually happens when trying to launch a stack without previously running tevmc build first.

While in the process of launching the nodeos service, it crashes with an error like this one:

1
14:40:34:INFO:error 2022-02-09T14:40:34.566 nodeos main.cpp:163 main ] 3110006 plugin_config_exception: Incorrect plugin configuration
2
14:40:34:INFO:Genesis state is necessary to initialize fresh blockchain
3
state but genesis state could not be found in the blocks log. Please either
4
load from snapshot or find a blocks log that starts from genesis.
Copied!
Usually means nodeos data is corrupted due to an ungraceful stop.

Can I start indexing from a custom snapshot?

Yes set the snapshot config on nodeos section and also start_on on Hyperion section.

Stack is correctly launched but when running transactions I get an error like this one on hyperion-api logs:

1
2022-02-10T01:15:37: In raw, tx is: f86c80....
2
2022-02-10T01:15:37: transaction declares authority
3
'{"actor":"rpc.evm","permission":"rpc"}', but does not have signatures for it.
4
2022-02-10T01:15:37: RPCERROR: 2022-02-10T01:15:37.913Z -
5
{"error":{"code":3,"message":"transaction declares authority...
Copied!
Setup correct signing account on telos-evm section of Hyperion configuration.

Elastichsearch health endpoint shows high active shard usage / filebeat's index health is yellow

Change "index.number_of_replicas" value from "1" to "0"

Is kubernetes supported?

No