├── logo.png ├── logo1.png ├── metadata.json ├── metadata3.json ├── metadata1.json ├── README.md └── chainbase-setup.sh /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArgonStark/Chainbase/HEAD/logo.png -------------------------------------------------------------------------------- /logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArgonStark/Chainbase/HEAD/logo1.png -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "random", 3 | "website": "https://github.com/random", 4 | "description": "DAO of individial stakes", 5 | "logo": "https://raw.githubusercontent.com/ArgonStark/Chainbase/main/logo.png", 6 | "twitter": "https://twitter.com/random" 7 | } 8 | -------------------------------------------------------------------------------- /metadata3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Heros", 3 | "website": "https://github.com/Heros", 4 | "description": "DAO of individial Heros", 5 | "logo": "https://raw.githubusercontent.com/ArgonStark/Chainbase/main/logo.png", 6 | "twitter": "https://twitter.com/HeroesHQ" 7 | } 8 | -------------------------------------------------------------------------------- /metadata1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Argon Stark", 3 | "website": "https://argonstark.xyz", 4 | "description": "DAO of individial stakes", 5 | "logo": "https://raw.githubusercontent.com/ArgonStark/Chainbase/main/logo1.png", 6 | "twitter": "https://twitter.com/0xargonstark" 7 | } 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chainbase 2 | 3 | ### Run this command in your terminal to Setup an AVS Operator for Chainbase : 4 | 5 | ``` 6 | wget https://raw.githubusercontent.com/ArgonStark/Chainbase/main/chainbase-setup.sh && chmod +x chainbase-setup.sh && ./chainbase-setup.sh 7 | ``` 8 | 9 | ## Config & register operator 10 | 11 | 12 | - `operator address`: Your Eigenlayer ETH address 13 | - `earnings address`: press `Enter` 14 | - `ETH rpc url`: https://ethereum-holesky-rpc.publicnode.com 15 | - `network`: holesky 16 | - `signer type`: local_keystore 17 | - `ecdsa key path:`: /root/.eigenlayer/operator_keys/opr.ecdsa.key.json `or` /root/.eigenlayer/operator_keys/myEigenDAKey.ecdsa.key.json 18 | 19 | ## Check Operator Health 20 | 21 | #### Check chainbase-node logs 22 | ``` 23 | docker logs chainbase-node -f 24 | ``` 25 | #### Check Operator Health 26 | ``` 27 | curl -i localhost:8080/eigen/node/health 28 | ``` 29 | 30 | #### Check docker containers 31 | 32 | - You must have 4 new docker containers 33 | 34 | ```console 35 | docker ps 36 | ``` 37 | 38 | ### Fill this the form 39 | 40 | https://forms.gle/w9h8Su87kEnDwRMA7 41 | 42 | ### Send your Operator address in discord 43 | 44 | https://discord.gg/chainbase 45 | 46 | -------------------------------------------------------------------------------- /chainbase-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Define colors 4 | RED='\033[0;31m' 5 | GREEN='\033[0;32m' 6 | YELLOW='\033[1;33m' 7 | BLUE='\033[0;34m' 8 | NC='\033[0m' # No Color 9 | 10 | # Display logo 11 | echo -e "${BLUE}" 12 | cat << "EOF" 13 | _____ _ _ 14 | /\ / ____| | | | | 15 | / \ _ __ __ _ ___ _ __ | (___ | |_ __ _ _ __ | | __ 16 | / /\ \ | '__| / _ | / _ \ | '_ \ \___ \ | __| / _ | | '__| | |/ / 17 | / ____ \ | | | (_| | | (_) | | | | | ____) | | |_ | (_| | | | | < 18 | /_/ \_\ |_| \__, | \___/ |_| |_| |_____/ \__| \__,_| |_| |_|\_\ 19 | __/ | 20 | |___/ 21 | EOF 22 | 23 | sleep 3 24 | 25 | echo -e "${NC}" 26 | 27 | # Print startup message 28 | echo -e "${GREEN}Running chainbase AVS Operator...${NC}" 29 | 30 | # Install Dependencies 31 | echo -e "${YELLOW}Installing Dependencies...${NC}" 32 | sudo apt update && sudo apt upgrade -y 33 | 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 34 | 35 | # Install Docker 36 | echo -e "${YELLOW}Installing Docker...${NC}" 37 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg 38 | 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 39 | sudo apt-get update 40 | sudo apt-get install docker-ce docker-ce-cli containerd.io -y 41 | docker version 42 | 43 | # Install Docker-Compose 44 | echo -e "${YELLOW}Installing Docker-Compose...${NC}" 45 | VER=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name | cut -d '"' -f 4) 46 | curl -L "https://github.com/docker/compose/releases/download/$VER/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 47 | chmod +x /usr/local/bin/docker-compose 48 | docker-compose --version 49 | 50 | # Docker Permission to user 51 | sudo groupadd docker 52 | sudo usermod -aG docker $USER 53 | 54 | # Install Go 55 | echo -e "${YELLOW}Installing Go...${NC}" 56 | sudo rm -rf /usr/local/go 57 | curl -L https://go.dev/dl/go1.22.4.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local 58 | echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile 59 | echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> $HOME/.bash_profile 60 | source $HOME/.bash_profile 61 | go version 62 | 63 | #!/bin/bash 64 | 65 | # Check if 'eigenlayer' exists and delete it 66 | if [ -e "eigenlayer" ]; then 67 | echo -e "${YELLOW}Found 'eigenlayer'. Deleting...${NC}" 68 | rm -rf eigenlayer 69 | echo -e "${GREEN}'eigenlayer' deleted successfully.${NC}" 70 | else 71 | echo -e "${CYAN}'eigenlayer' not found. Skipping deletion.${NC}" 72 | fi 73 | 74 | # Check if '.eigenlayer' exists and delete it 75 | if [ -d ".eigenlayer" ]; then 76 | echo -e "${YELLOW}Found '.eigenlayer'. Deleting...${NC}" 77 | rm -rf .eigenlayer 78 | echo -e "${GREEN}'.eigenlayer' deleted successfully.${NC}" 79 | else 80 | echo -e "${CYAN}'.eigenlayer' not found. Skipping deletion.${NC}" 81 | fi 82 | 83 | # Check if eigenlayer exists 84 | echo -e "${YELLOW}Installing EigenLayer CLI...${NC}" 85 | curl -sSfL https://raw.githubusercontent.com/layr-labs/eigenlayer-cli/master/scripts/install.sh | sh -s 86 | export PATH=$PATH:~/bin 87 | eigenlayer --version 88 | 89 | 90 | # Cloning Chainbase AVS repo 91 | echo -e "${YELLOW}Cloning Chainbase AVS repository...${NC}" 92 | git clone https://github.com/chainbase-labs/chainbase-avs-setup 93 | cd chainbase-avs-setup/holesky 94 | 95 | # Key Management 96 | echo -e "${BLUE}Do you want to Import keys, Create new keys, or have you already Imported?${NC}" 97 | select option in "Import" "Create" "Already Imported"; do 98 | case $option in 99 | Import) 100 | read -p "Enter your private key: " PRIVATEKEY 101 | eigenlayer operator keys import --key-type ecdsa opr "$PRIVATEKEY" 102 | break 103 | ;; 104 | Create) 105 | eigenlayer operator keys create --key-type ecdsa opr 106 | read -p "Have you backed up your keys? (yes/no): " backup 107 | if [ "$backup" != "yes" ]; then 108 | echo -e "${RED}Please back up your keys before proceeding.${NC}" 109 | exit 1 110 | fi 111 | break 112 | ;; 113 | "Already Imported") 114 | echo -e "${GREEN}Skipping key creation/import...${NC}" 115 | break 116 | ;; 117 | *) 118 | echo -e "${RED}Invalid option. Please choose 1, 2, or 3.${NC}" 119 | ;; 120 | esac 121 | done 122 | 123 | 124 | # Funding EigenLayer Ethereum Address 125 | echo -e "${BLUE}You need to fund your Eigenlayer address with at least 1 Holesky ETH . Did you fund your address (yes/no)${NC}" 126 | read -p "Choice: " fund_choice 127 | if [ "$fund_choice" == "yes" ]; then 128 | echo -e "${YELLOW}Please fund your address before continuing.${NC}" 129 | fi 130 | 131 | # Configure & Register Operator 132 | echo -e "${YELLOW}Configuring & registering operator...${NC}" 133 | eigenlayer operator config create 134 | 135 | # Edit metadata.json 136 | echo -e "${YELLOW}Please provide the following information to metadata.json and after that copy the your provided data and create a metadata file on your github !:${NC}" 137 | read -p "Name: " name 138 | read -p "Website: " website 139 | read -p "Description: " description 140 | read -p "Logo URL: " logo 141 | read -p "Twitter: " twitter 142 | cat << EOF > metadata.json 143 | { 144 | "name": "$name", 145 | "website": "$website", 146 | "description": "$description", 147 | "logo": "$logo", 148 | "twitter": "$twitter" 149 | } 150 | EOF 151 | 152 | # Upload metadata file to GitHub and edit operator.yaml 153 | echo -e "${YELLOW}Upload the metadata file to your GitHub profile and provide the link:${NC}" 154 | read -p "GitHub Metadata URL: " metadata_url 155 | sed -i "s|metadata_url:.*|metadata_url: \"$metadata_url\"|" operator.yaml 156 | 157 | # Running Eigenlayer Holesky Node 158 | echo -e "${YELLOW}Running Eigenlayer Holesky Node...${NC}" 159 | eigenlayer operator register operator.yaml 160 | eigenlayer operator status operator.yaml 161 | 162 | # Config Chainbase AVS and Edit .env File 163 | echo -e "${GREEN}Configuring Chainbase AVS...${NC}" 164 | 165 | echo -e "${CYAN}Please enter your Eigenlayer password:${NC}" 166 | read -s eigenlayer_password 167 | cat <> .env 168 | # Chainbase AVS Image 169 | MAIN_SERVICE_IMAGE=repository.chainbase.com/network/chainbase-node:testnet-v0.1.7 170 | FLINK_TASKMANAGER_IMAGE=flink:latest 171 | FLINK_JOBMANAGER_IMAGE=flink:latest 172 | PROMETHEUS_IMAGE=prom/prometheus:latest 173 | 174 | MAIN_SERVICE_NAME=chainbase-node 175 | FLINK_TASKMANAGER_NAME=flink-taskmanager 176 | FLINK_JOBMANAGER_NAME=flink-jobmanager 177 | PROMETHEUS_NAME=prometheus 178 | 179 | # FLINK CONFIG 180 | FLINK_CONNECT_ADDRESS=flink-jobmanager 181 | FLINK_JOBMANAGER_PORT=8081 182 | NODE_PROMETHEUS_PORT=9091 183 | PROMETHEUS_CONFIG_PATH=./prometheus.yml 184 | 185 | # Chainbase AVS mounted locations 186 | NODE_APP_PORT=8080 187 | NODE_ECDSA_KEY_FILE=/app/operator_keys/ecdsa_key.json 188 | NODE_LOG_DIR=/app/logs 189 | 190 | # Node logs configs 191 | NODE_LOG_LEVEL=debug 192 | NODE_LOG_FORMAT=text 193 | 194 | # Metrics specific configs 195 | NODE_ENABLE_METRICS=true 196 | NODE_METRICS_PORT=9092 197 | 198 | # holesky smart contracts 199 | AVS_CONTRACT_ADDRESS=0x5E78eFF26480A75E06cCdABe88Eb522D4D8e1C9d 200 | AVS_DIR_CONTRACT_ADDRESS=0x055733000064333CaDDbC92763c58BF0192fFeBf 201 | 202 | # TODO: Operators need to point this to a working chain rpc 203 | NODE_CHAIN_RPC=https://rpc.ankr.com/eth_holesky 204 | NODE_CHAIN_ID=17000 205 | 206 | # TODO: Operators need to update this to their own paths 207 | USER_HOME=\$HOME 208 | EIGENLAYER_HOME=\${USER_HOME}/.eigenlayer 209 | CHAINBASE_AVS_HOME=\${EIGENLAYER_HOME}/chainbase/holesky 210 | 211 | NODE_LOG_PATH_HOST=\${CHAINBASE_AVS_HOME}/logs 212 | 213 | # TODO: Operators need to update this to their own keys 214 | NODE_ECDSA_KEY_FILE_HOST=\${EIGENLAYER_HOME}/operator_keys/opr.ecdsa.key.json 215 | 216 | # TODO: Operators need to add password to decrypt the above keys 217 | # If you have some special characters in password, make sure to use single quotes 218 | NODE_ECDSA_KEY_PASSWORD=${eigenlayer_password} 219 | EOL 220 | 221 | # Create docker-compose.yml file 222 | echo -e "${GREEN}Creating docker-compose.yml file...${NC}" 223 | 224 | rm -rf docker-compose.yml 225 | 226 | cat < docker-compose.yml 227 | services: 228 | prometheus: 229 | image: \${PROMETHEUS_IMAGE} 230 | container_name: \${PROMETHEUS_NAME} 231 | env_file: 232 | - .env 233 | volumes: 234 | - "\${PROMETHEUS_CONFIG_PATH}:/etc/prometheus/prometheus.yml" 235 | command: 236 | - "--enable-feature=expand-external-labels" 237 | - "--config.file=/etc/prometheus/prometheus.yml" 238 | ports: 239 | - "9091:9090" 240 | networks: 241 | - chainbase 242 | restart: unless-stopped 243 | 244 | flink-jobmanager: 245 | image: \${FLINK_JOBMANAGER_IMAGE} 246 | container_name: \${FLINK_JOBMANAGER_NAME} 247 | env_file: 248 | - .env 249 | ports: 250 | - "8081:8081" 251 | command: jobmanager 252 | networks: 253 | - chainbase 254 | restart: unless-stopped 255 | 256 | flink-taskmanager: 257 | image: \${FLINK_JOBMANAGER_IMAGE} 258 | container_name: \${FLINK_TASKMANAGER_NAME} 259 | env_file: 260 | - .env 261 | depends_on: 262 | - flink-jobmanager 263 | command: taskmanager 264 | networks: 265 | - chainbase 266 | restart: unless-stopped 267 | 268 | chainbase-node: 269 | image: \${MAIN_SERVICE_IMAGE} 270 | container_name: \${MAIN_SERVICE_NAME} 271 | command: ["run"] 272 | env_file: 273 | - .env 274 | ports: 275 | - "8080:8080" 276 | - "9092:9092" 277 | volumes: 278 | - "\${NODE_ECDSA_KEY_FILE_HOST:-./opr.ecdsa.key.json}:\${NODE_ECDSA_KEY_FILE}" 279 | - "\${NODE_LOG_PATH_HOST}:\${NODE_LOG_DIR}:rw" 280 | depends_on: 281 | - prometheus 282 | - flink-jobmanager 283 | - flink-taskmanager 284 | networks: 285 | - chainbase 286 | restart: unless-stopped 287 | 288 | networks: 289 | chainbase: 290 | driver: bridge 291 | EOL 292 | 293 | # Create folders for docker 294 | echo -e "${GREEN}Creating necessary folders for Docker...${NC}" 295 | source .env && mkdir -pv ${EIGENLAYER_HOME} ${CHAINBASE_AVS_HOME} ${NODE_LOG_PATH_HOST} 296 | 297 | # Function to update docker compose command in script 298 | fix_docker_compose() { 299 | FILE="chainbase-avs.sh" 300 | echo -e "${RED}Detected 'unknown shorthand flag: d in -d' error. Updating 'docker compose' to 'docker-compose' in $FILE...${NC}" 301 | 302 | # Replace 'docker compose' with 'docker-compose' using sed 303 | sed -i 's/docker compose/docker-compose/g' "$FILE" 304 | 305 | echo -e "${GREEN}Update completed. Retrying...${NC}" 306 | } 307 | 308 | # Starting docker to prevent problems 309 | echo -e "${GREEN}Starting Docker ...${NC}" 310 | systemctl start docker 311 | 312 | # Give permissions to bash script 313 | echo -e "${GREEN}Giving execute permissions to chainbase-avs.sh...${NC}" 314 | chmod +x ./chainbase-avs.sh 315 | 316 | # Update prometheus.yml 317 | echo -e "${CYAN}Please enter your operator address for Prometheus configuration:${NC}" 318 | read operator_address 319 | 320 | echo -e "${GREEN}Updating prometheus.yml...${NC}" 321 | 322 | cat < prometheus.yml 323 | global: 324 | scrape_interval: 15s 325 | evaluation_interval: 15s 326 | external_labels: 327 | operator: "${operator_address}" 328 | 329 | remote_write: 330 | - url: http://testnet-metrics.chainbase.com:9090/api/v1/write 331 | write_relabel_configs: 332 | - source_labels: [job] 333 | regex: "chainbase-avs" 334 | action: keep 335 | 336 | scrape_configs: 337 | - job_name: "chainbase-avs" 338 | metrics_path: /metrics 339 | static_configs: 340 | - targets: ["chainbase-node:9092"] 341 | EOL 342 | 343 | # Update docker compose command before running AVS 344 | fix_docker_compose 345 | 346 | # Run Chainbase AVS 347 | echo -e "${GREEN}Registering AVS...${NC}" 348 | ./chainbase-avs.sh register 349 | 350 | echo -e "${GREEN}Running AVS...${NC}" 351 | ./chainbase-avs.sh run 352 | 353 | # AVS running successfully message 354 | echo -e "${GREEN}AVS running successfully!${NC}" 355 | 356 | # Get AVS link 357 | echo -e "${GREEN}Fetching AVS link...${NC}" 358 | export PATH=$PATH:~/bin 359 | eigenlayer operator status operator.yaml 360 | 361 | # Checking Operator Health 362 | sleep 2 363 | echo -e "${YELLOW}Checking operator health on port 8080...${NC}" 364 | curl -i localhost:8080/eigen/node/health 365 | 366 | # Checking the docker containers 367 | echo -e "${YELLOW}Checking Docker containers...${NC}" 368 | docker ps 369 | 370 | echo -e "${GREEN}Setup complete!${NC}" 371 | 372 | --------------------------------------------------------------------------------