Telos EVM Docker
Requirements
gitdockerpython3
Quickstart
## Need installed python version >= python 3.8
git clone https://github.com/telosnetwork/telos-evm-docker.git -b v1.5.0-rc2
cd telos-evm-docker
# Two posibilities:
# 1) Recommended: Install poetry python package manager dependecy to /usr/local (REQUIRES SUDO)
sudo ./install.sh
# 2) Install dependency to another $DIRECTORY that is already on $PATH
./install.sh $DIRECTORY
source ./activate.sh
## from now on we are working in the virtual environment.
## just run 'deactivate' when you want to deactivate virtual environment.
tevmc init testnet
cd testnet
## Modify tevmc.json
## For mainnet, signer_account, signer_permission, signer_key
## Containers use ports of host machine so you need to check the ports if used already.
tevmc build
## Launch and store logs, also detach from session
nohup tevmc up 2>&1 > tevmc.log &
## Wait until synced and evm-rpc activated.
## To stop:
tevmc down
Installation
tevmc is a python installable package, and its currently available on github.
git clone git@github.com:telosnetwork/telos-evm-docker.gitcd telos-evm-dockergit checkout v1.5.0-rc2sudo ./install.sh
To load the virtual environment (and make tevmc command line available):
source ./activate.sh
tevmc can be used as a command line utiliy to manually manage Telos EVM nodes, but is usable as a library.
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 testnettestnet: Standard testnet nodemainnet: 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 templatetevmc init us-testnet-04 # will use testnet templatetevmc 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
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 as foreground process Ctrl+C to exit
nohup tevmc up 2>&1 > tevmc.log & # launch as background process
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:
builddocker build contextconfigeditable configuration files, mounted to were they are needed inside the respective container.datapermanent storage kept between runslogslog file location
Full directory structure
node/
├── docker/
│ ├── beats/
│ ├── elasticsearch/
│ ├── leap/
│ ├── telosevm-translator/
│ ├── telos-evm-rpc/
│ ├── kibana/
│ └── redis/
└── tevmc.json
Monitoring
You can stream logs from any container using the stream sub command:
tevmc stream {source}
Available sources:
daemonredisbeatselasticsearchkibananodeosindexerrpc
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 Zero & EVM transactions?
Yes, but will need to set correct producer keys on
nodeosand un-whitelisteosio.evmon Hyperion config.
As soon as I launch the stack it crashes with an error like this one:
07:00:32:WARNING:Starting daemon.
07:00:32:INFO:opening redis-2122399...
07:00:33:INFO:running
07:00:33:INFO:
07:00:33:INFO:*** FATAL CONFIG FILE ERROR (Redis 6.2.6) ***
07:00:33:INFO:Reading the configuration file, at line 92
07:00:33:INFO:>>> 'port $redis_port'
07:00:33:INFO:argument couldn't be parsed into an integer
07:00:33:CRITICAL:container status: removing, log dump:
07:00:33:CRITICAL:couldn't access logs.
07:00:33:WARNING:Stopping daemon.
This error usually happens when trying to launch a stack without previously running
tevmc buildfirst.
While in the process of launching the nodeos service, it crashes with an error like this one:
warn 2023-08-20T19:22:30.845 nodeos chain_plugin.cpp:1085 plugin_initialize ] 13 N5boost10wrapexceptINSt3__112sy
stem_errorEEE: Database dirty flag set
rethrow Database dirty flag set:
{"what":"Database dirty flag set"}
nodeos chain_plugin.cpp:1085 plugin_initialize
error 2023-08-20T19:22:30.845 nodeos main.cpp:157 main ] database dirty flag set (likely du
e to unclean shutdown): replay required
Usually means
nodeosdata is corrupted due to an ungraceful stop. Runtevmc repairfrom the node directory with the stack down to repair data.
Can I start indexing from a custom snapshot?
Yes set the
snapshotconfig onnodeossection and alsostart_blockonevm-rpcsection.
Stack is correctly launched but when running transactions I get an error like this one on hyperion-api logs:
2022-02-10T01:15:37: In raw, tx is: f86c80....
2022-02-10T01:15:37: transaction declares authority
'{"actor":"rpc.evm","permission":"rpc"}', but does not have signatures for it.
2022-02-10T01:15:37: RPCERROR: 2022-02-10T01:15:37.913Z -
{"error":{"code":3,"message":"transaction declares authority...
Setup correct signing account on
telos-evmsection ofevm-rpcconfiguration.
Is kubernetes supported?
No