├── README.md ├── logo.png ├── metadata.json └── update-port-avoid-malware.md /README.md: -------------------------------------------------------------------------------- 1 | ![Screenshot_1](https://github.com/user-attachments/assets/dd2a775b-29d0-4f60-a90b-083dd4381e29) 2 | 3 | # How to Setup an AVS Operator 4 | 5 | ## System Requirement 6 | ![Screenshot_1](https://github.com/user-attachments/assets/91ebbc59-8134-4118-8162-8e9ae827344f) 7 | 8 | 9 | ## 1. Install Dependecies 10 | ```console 11 | # Update & Install Packages 12 | sudo apt update & sudo apt upgrade -y 13 | sudo apt install ca-certificates zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev curl git wget make jq build-essential pkg-config lsb-release libssl-dev libreadline-dev libffi-dev gcc screen unzip lz4 -y 14 | 15 | # Install Docker 16 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg 17 | 18 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 19 | 20 | sudo apt-get update 21 | sudo apt-get install docker-ce docker-ce-cli containerd.io 22 | docker version 23 | 24 | # Install Docker-Compose 25 | VER=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name | cut -d '"' -f 4) 26 | 27 | curl -L "https://github.com/docker/compose/releases/download/"$VER"/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 28 | 29 | chmod +x /usr/local/bin/docker-compose 30 | docker-compose --version 31 | 32 | # Docker Permission to user 33 | sudo groupadd docker 34 | sudo usermod -aG docker $USER 35 | 36 | # Install Go 37 | sudo rm -rf /usr/local/go 38 | curl -L https://go.dev/dl/go1.22.4.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local 39 | echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile 40 | echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> $HOME/.bash_profile 41 | source .bash_profile 42 | go version 43 | ``` 44 | 45 | ## 2. Install EigenLayer CLI 46 | ```console 47 | curl -sSfL https://raw.githubusercontent.com/layr-labs/eigenlayer-cli/master/scripts/install.sh | sh -s 48 | 49 | export PATH=$PATH:~/bin 50 | 51 | eigenlayer --version 52 | ``` 53 | 54 | ## 3. Clone Chainbase AVS repo 55 | ```console 56 | git clone https://github.com/chainbase-labs/chainbase-avs-setup 57 | 58 | cd chainbase-avs-setup/holesky 59 | ``` 60 | 61 | ## 4. Create Eigenlayer wallet 62 | ### Create a new Key 63 | 64 | 1- Create operator address 65 | ```console 66 | eigenlayer operator keys create --key-type ecdsa opr 67 | ``` 68 | 2- Enter a password and press Enter 69 | * Best symbol for password is `*` , you can choose a password like this: `***123ABCabc123***` 70 | 71 | 3- Save your wallet private key 72 | 73 | ![image](https://github.com/user-attachments/assets/2fb1071a-04fd-4ceb-9d08-9cd3de1c877a) 74 | 75 | 4- `Ctrl+C+Enter+Enter` & save your wallet info 76 | 77 | ![image](https://github.com/user-attachments/assets/985845ab-9510-4afd-aa1b-76cca556094e) 78 | 79 | # 80 | 81 | ### Optional: Import an old key 82 | 83 | > Replace `PRIVATEKEY` 84 | ```console 85 | eigenlayer operator keys import --key-type ecdsa opr PRIVATEKEY 86 | ``` 87 | > Enter a password and press Enter 88 | > 89 | > Best symbol for password is `*` , you can choose a password like this: `***123ABCabc123***` 90 | # 91 | 92 | ## Fund your Eigen wallet 93 | You’ll need at least 1 Holesky ETH to cover the gas cost of the operator registration. Make sure to send at least 1 ETH to your Eigenlayer operator’s address 94 | 95 | ## 5. Config & register operator 96 | ```console 97 | eigenlayer operator config create 98 | ``` 99 | * `operator address`: Your Eigenlayer ETH address 100 | * `earnings address`: press `Enter` 101 | * `ETH rpc url`: https://ethereum-holesky-rpc.publicnode.com 102 | * `network`: holesky 103 | * `signer type`: local_keystore 104 | * `ecdsa key path:`: /root/.eigenlayer/operator_keys/opr.ecdsa.key.json 105 | 106 | ## 6. Edit metadata.json 107 | 1- Open `metadata.json` edit menu 108 | ```console 109 | nano metadata.json 110 | ``` 111 | 112 | 2- Complete your details in `metadata.json` 113 | * `logo`: Must be raw link to your operator favorite logo 114 | * Logo only supports `.png` file less than 1MB in size 115 | * Create a repositry in github and upload `.png` there 116 | * To get your logo raw link: 117 | * **1)** Navigate to the file in your repository 118 | * **2)** Click on the file name to view its contents 119 | * **3)** In the address bar of your browser 120 | * **4)** replace `blob` with `raw` in the URL 121 | * **5)** Press Enter to load the raw content view 122 | * **6)** Copy the updated URL from the address bar and paste in front of `logo` field in `metadata.json` 123 | * My example `metadata.json` file in github: https://github.com/0xmoei/chainbase-testnet/blob/main/metadata.json 124 | * `Ctrl+X+Y+Enter` to save `metadata.json` 125 | 126 | 3- Upload `metadata.json` to your github repository and get its **raw link** like previous step 127 | * You can create a metadata.json file in github with the contents of your file or you must download it from VPS using Termius or Mobaxterm ssh clients 128 | 129 | 4- Open `operator.yaml` edit menu 130 | ```console 131 | nano operator.yaml 132 | ``` 133 | 134 | 5- Add your metadata.json raw url in github in front of `metadata-url` 135 | 136 | ![Screenshot_158](https://github.com/user-attachments/assets/af8a4fe3-a5fe-48ff-a198-7e3e808ff07d) 137 | 138 | 139 | ## 7. Run Eigenlayer holesky Node 140 | ```console 141 | eigenlayer operator register operator.yaml 142 | 143 | # Check status 144 | eigenlayer operator status operator.yaml 145 | ``` 146 | 147 | ![image](https://github.com/user-attachments/assets/6b30b646-dc18-4088-a199-bcb4e01c367a) 148 | 149 | ## 8. Config Chainbase AVS 150 | **1- Create .env file** 151 | ```console 152 | # Delete old files 153 | rm -rf .env 154 | 155 | # Open Edit menu 156 | nano .env 157 | ``` 158 | 159 | **2- Paste below codes in it** 160 | * `NODE_ECDSA_KEY_PASSWORD`: Replace `***123ABCabc123***` with your Eigenlayer password 161 | * Optional: You can Change #TODO lines if needed but it should be okay by default 162 | ``` 163 | # Chainbase AVS Image 164 | MAIN_SERVICE_IMAGE=repository.chainbase.com/network/chainbase-node:testnet-v0.1.7 165 | FLINK_TASKMANAGER_IMAGE=flink:latest 166 | FLINK_JOBMANAGER_IMAGE=flink:latest 167 | PROMETHEUS_IMAGE=prom/prometheus:latest 168 | 169 | MAIN_SERVICE_NAME=chainbase-node 170 | FLINK_TASKMANAGER_NAME=flink-taskmanager 171 | FLINK_JOBMANAGER_NAME=flink-jobmanager 172 | PROMETHEUS_NAME=prometheus 173 | 174 | # FLINK CONFIG 175 | FLINK_CONNECT_ADDRESS=flink-jobmanager 176 | FLINK_JOBMANAGER_PORT=8081 177 | NODE_PROMETHEUS_PORT=9091 178 | PROMETHEUS_CONFIG_PATH=./prometheus.yml 179 | 180 | # Chainbase AVS mounted locations 181 | NODE_APP_PORT=8080 182 | NODE_ECDSA_KEY_FILE=/app/operator_keys/ecdsa_key.json 183 | NODE_LOG_DIR=/app/logs 184 | 185 | # Node logs configs 186 | NODE_LOG_LEVEL=debug 187 | NODE_LOG_FORMAT=text 188 | 189 | # Metrics specific configs 190 | NODE_ENABLE_METRICS=true 191 | NODE_METRICS_PORT=9092 192 | 193 | # holesky smart contracts 194 | AVS_CONTRACT_ADDRESS=0x5E78eFF26480A75E06cCdABe88Eb522D4D8e1C9d 195 | AVS_DIR_CONTRACT_ADDRESS=0x055733000064333CaDDbC92763c58BF0192fFeBf 196 | 197 | ############################################################################### 198 | ####### TODO: Operators please update below values for your node ############## 199 | ############################################################################### 200 | # TODO: Operators need to point this to a working chain rpc 201 | NODE_CHAIN_RPC=https://rpc.ankr.com/eth_holesky 202 | NODE_CHAIN_ID=17000 203 | 204 | # TODO: Operators need to update this to their own paths 205 | USER_HOME=$HOME 206 | EIGENLAYER_HOME=${USER_HOME}/.eigenlayer 207 | CHAINBASE_AVS_HOME=${EIGENLAYER_HOME}/chainbase/holesky 208 | 209 | NODE_LOG_PATH_HOST=${CHAINBASE_AVS_HOME}/logs 210 | 211 | # TODO: Operators need to update this to their own keys 212 | NODE_ECDSA_KEY_FILE_HOST=${EIGENLAYER_HOME}/operator_keys/opr.ecdsa.key.json 213 | 214 | # TODO: Operators need to add password to decrypt the above keys 215 | # If you have some special characters in password, make sure to use single quotes 216 | NODE_ECDSA_KEY_PASSWORD=***123ABCabc123*** 217 | ``` 218 | 219 | **3- Create `docker-compose.yml` file** 220 | ```console 221 | # Remove old file 222 | rm -rf docker-compose.yml 223 | 224 | # Open edit menu 225 | nano docker-compose.yml 226 | ``` 227 | 228 | **4- Paste below codes in it and save with CTRL+X+Y+ENTER** 229 | * You can change ports if any of them are in use: 8081, 9091, 8080, 9092 230 | * If you want to change `8081` to `35081` then just change the port on the left side like: `35081:8081` 231 | ``` 232 | services: 233 | prometheus: 234 | image: ${PROMETHEUS_IMAGE} 235 | container_name: ${PROMETHEUS_NAME} 236 | env_file: 237 | - .env 238 | volumes: 239 | - "${PROMETHEUS_CONFIG_PATH}:/etc/prometheus/prometheus.yml" 240 | command: 241 | - "--enable-feature=expand-external-labels" 242 | - "--config.file=/etc/prometheus/prometheus.yml" 243 | ports: 244 | - "9091:9090" 245 | networks: 246 | - chainbase 247 | restart: unless-stopped 248 | 249 | flink-jobmanager: 250 | image: ${FLINK_JOBMANAGER_IMAGE} 251 | container_name: ${FLINK_JOBMANAGER_NAME} 252 | env_file: 253 | - .env 254 | ports: 255 | - "8081:8081" 256 | command: jobmanager 257 | networks: 258 | - chainbase 259 | restart: unless-stopped 260 | 261 | flink-taskmanager: 262 | image: ${FLINK_JOBMANAGER_IMAGE} 263 | container_name: ${FLINK_TASKMANAGER_NAME} 264 | env_file: 265 | - .env 266 | depends_on: 267 | - flink-jobmanager 268 | command: taskmanager 269 | networks: 270 | - chainbase 271 | restart: unless-stopped 272 | 273 | chainbase-node: 274 | image: ${MAIN_SERVICE_IMAGE} 275 | container_name: ${MAIN_SERVICE_NAME} 276 | command: ["run"] 277 | env_file: 278 | - .env 279 | ports: 280 | - "8080:8080" 281 | - "9092:9092" 282 | volumes: 283 | - "${NODE_ECDSA_KEY_FILE_HOST:-./opr.ecdsa.key.json}:${NODE_ECDSA_KEY_FILE}" 284 | - "${NODE_LOG_PATH_HOST}:${NODE_LOG_DIR}:rw" 285 | depends_on: 286 | - prometheus 287 | - flink-jobmanager 288 | - flink-taskmanager 289 | networks: 290 | - chainbase 291 | restart: unless-stopped 292 | 293 | networks: 294 | chainbase: 295 | driver: bridge 296 | ``` 297 | 298 | **5- Create folders for docker** 299 | ```console 300 | source .env && mkdir -pv ${EIGENLAYER_HOME} ${CHAINBASE_AVS_HOME} ${NODE_LOG_PATH_HOST} 301 | ``` 302 | 303 | **6- Give permissions to bash script** 304 | ```console 305 | chmod +x ./chainbase-avs.sh 306 | ``` 307 | 308 | **7- update prometheus.yml** 309 | * Replace ${YOUR_OPERATOR_NAME} with your operator address 310 | ```console 311 | nano prometheus.yml 312 | ``` 313 | 314 | ![Screenshot_160](https://github.com/user-attachments/assets/ef211b71-7d62-47d5-ad67-64c39387287b) 315 | 316 | ## 9. Run Chainbase AVS 317 | 1- Register AVS 318 | ```console 319 | ./chainbase-avs.sh register 320 | ``` 321 | 322 | ![image](https://github.com/user-attachments/assets/167edddf-b49b-481c-820e-e199a15092da) 323 | 324 | 2- Run AVS 325 | ``` 326 | ./chainbase-avs.sh run 327 | ``` 328 | 329 | ![image](https://github.com/user-attachments/assets/ad1fee10-833c-4f6b-ab72-9cbcba01a3ea) 330 | 331 | ## 10. Check AVS health 332 | **Check chainbase-node logs** 333 | ```console 334 | docker compose logs chainbase-node -f 335 | ``` 336 | 337 | ![image](https://github.com/user-attachments/assets/0ae75ce6-dcdd-4e48-bbc3-8eda3e4ad40e) 338 | 339 | 340 | **Get your AVS link** 341 | ```console 342 | export PATH=$PATH:~/bin 343 | 344 | eigenlayer operator status operator.yaml 345 | ``` 346 | 347 | ![image](https://github.com/user-attachments/assets/5a1067f7-2db1-46b9-9492-f4fe53ddf530) 348 | 349 | 350 | **Check Operator Health** 351 | ```console 352 | # If your port is 8080 353 | curl -i localhost:8080/eigen/node/health 354 | ``` 355 | 356 | ![image](https://github.com/user-attachments/assets/9dfd61a6-5c60-4e12-852e-daa9973d9ee5) 357 | 358 | Check docker containers 359 | * You must have 4 new docker containers 360 | ```console 361 | Docker PS 362 | ``` 363 | 364 | ![image](https://github.com/user-attachments/assets/f2b9d3e2-8e4f-48d5-bb24-b1b5744c11d6) 365 | 366 | 367 | ## 11. Fill in the form 368 | https://forms.gle/w9h8Su87kEnDwRMA7 369 | 370 | ## 12. Post your Operator address in discord 371 | https://discord.gg/chainbase 372 | 373 | ![Screenshot_159](https://github.com/user-attachments/assets/11d73cd4-84c1-4b9d-b6d3-9ec959653656) 374 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xmoei/chainbase-testnet/4207d1ae9ca201cacf3c6ba9e330942ec9054a23/logo.png -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "0xMoei", 3 | "website": "https://github.com/0xMoei", 4 | "description": "DAO of individial stakes", 5 | "logo": "https://raw.githubusercontent.com/0xmoei/chainbase-testnet/main/logo.png", 6 | "twitter": "https://twitter.com/0xMoei" 7 | } 8 | -------------------------------------------------------------------------------- /update-port-avoid-malware.md: -------------------------------------------------------------------------------- 1 | # Some users got this **malware** in their servers 2 | 3 | ![Screenshot_175](https://github.com/user-attachments/assets/4aa40fd9-bd23-4f3b-bc0b-dea2d8eb973d) 4 | 5 | * It was because a vulnerability in port `8081` 6 | 7 | # To avoid: 8 | 9 | ### 1- Delete 2 lines in `docker-compose.yml` 10 | 11 | ![Screenshot_174](https://github.com/user-attachments/assets/d09fe310-2936-4b50-b7fd-9061f73118d3) 12 | 13 | ```console 14 | cd $HOME/chainbase-avs-setup/holesky 15 | 16 | nano docker-compose.yml 17 | 18 | # delete 2 lines in the pic 19 | ``` 20 | 21 | ### 2- Restart docker 22 | ```console 23 | docker compose up -d 24 | ``` 25 | --------------------------------------------------------------------------------