Task is the foundation and core service of the easynode system and is a necessary condition for the operation of other
services.
This service is responsible for task generation, task distribution, system monitoring and other functions.
Prerequisites
- go version >=1.20
- The collect service has been deployed
Building the source
(Take linux system as an example)
-
mkdir easynode & cd easynode
-
git clone https://github.com/0xcregis/easynode.git
-
cd easynode/cmd/task
-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o easynode_task app.go
(Compiling a Linux program under Mac is an example. Please search for other cross-compilation commands by yourself)
-
./easynode_task -config ./config.json
config.json detailed explanation
{
"TaskKafka": { //basic dependency environment
"Host": "192.168.2.9",
"Port": 9092
},
"Redis": { // basic dependency environment
"Addr": "192.168.2.9",
"Port": 6379,
"DB": 0
},
"AutoCreateBlockTask": true,//automatically generate block tasks,default:false
"Chains": [
{
"Cluster": [ //fullnode url
{
"NodeHost": "https://eth-mainnet.g.alchemy.com/v2",
"NodeKey": "RzxBjjh_c4y0LVHZ7GNm8zoXEZR3HYop"
}
],
"BlockChainName": "eth", //chain name
"BlockChainCode": 200, //chain code
"BlockMin": 17325771, //min blockNumber, required
"BlockMax": 0 //max blockNumber, If this value is set to zero,easynode will get latest blockNumber from blockchain
}
]
}
``