config.json cat config.json { "validator": { "name": "ZXConnect", "evm_address": "0xea5972905B98D55e819b3540877d111228bee83b" }, "network": { "rpc_url": "https://rpc.zxconnect.io", "chain_id": 1 }, "node": { "private_key": "pr"> config.json cat config.json { "validator": { "name": "ZXConnect", "evm_address": "0xea5972905B98D55e819b3540877d111228bee83b" }, "network": { "rpc_url": "https://rpc.zxconnect.io", "chain_id": 1 }, "node": { "private_key": "pr"> config.json cat config.json { "validator": { "name": "ZXConnect", "evm_address": "0xea5972905B98D55e819b3540877d111228bee83b" }, "network": { "rpc_url": "https://rpc.zxconnect.io", "chain_id": 1 }, "node": { "private_key": "pr">
git clone <https://github.com/0glabs/0g-node.git>
cd 0g-node

Cloning into '0g-node'...
remote: Enumerating objects: 1050, done.
remote: Counting objects: 100% (1050/1050), done.
remote: Compressing objects: 100% (642/642), done.
Receiving objects: 100% (1050/1050), 2.45 MiB | 3.00 MiB/s, done.
Resolving deltas: 100% (400/400), done.

npm install

added 1205 packages from 854 contributors and audited 1205 packages in 23.456s
found 0 vulnerabilities

echo '{
  "validator": {
    "name": "ZXConnect",
    "evm_address": "0xea5972905B98D55e819b3540877d111228bee83b"
  },
  "network": {
    "rpc_url": "<https://rpc.zxconnect.io>",
    "chain_id": 1
  },
  "node": {
    "private_key": "priv_key",
    "ip": "0.0.0.0",
    "port": 30303
  }
}' > config.json

cat config.json
{
  "validator": {
    "name": "ZXConnect",
    "evm_address": "0xea5972905B98D55e819b3540877d111228bee83b"
  },
  "network": {
    "rpc_url": "<https://rpc.zxconnect.io>",
    "chain_id": 1
  },
  "node": {
    "private_key": "priv_key",
    "ip": "0.0.0.0",
    "port": 30303
  }

npm start -- --config ./config.json

> [email protected] start /path/to/0g-node
> node index.js --config ./config.json

[INFO] Validator ZXConnect (0xea5972905B98D55e819b3540877d111228bee83b) is starting...
[INFO] Connecting to network with RPC URL <https://rpc.zxconnect.io>
[INFO] Node is running at 0.0.0.0:30303

FROM node:14

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
COPY package*.json ./

RUN npm install

# Bundle app source
COPY . .

EXPOSE 30303

CMD [ "npm", "start", "--", "--config", "./config.json" ]

docker build -t 0g-node .

Sending build context to Docker daemon  75.26MB
Step 1/7 : FROM node:14
 ---> a3bdb1234567
Step 2/7 : WORKDIR /usr/src/app
 ---> Using cache
 ---> e89cba98d123
Step 3/7 : COPY package*.json ./
 ---> Using cache
 ---> 1234abcd5678
Step 4/7 : RUN npm install
 ---> Using cache
 ---> 5678cdef1234
Step 5/7 : COPY . .
 ---> 1234abcd5678
Step 6/7 : EXPOSE 30303
 ---> Running in 7890ab12cde3
Removing intermediate container 7890ab12cde3
 ---> 1234abcd5678
Step 7/7 : CMD [ "npm", "start", "--", "--config", "./config.json" ]
 ---> Running in 7890ab12cde3
Removing intermediate container 7890ab12cde3
 ---> 1234abcd5678
Successfully built 1234abcd5678
Successfully tagged 0g-node:latest

docker run -d --name 0g-node -p 30303:30303 0g-node

b6a09a1a8df23456789cdef1234abcd5678cdef1234abcd5678cdef1234abcd5678

npm logs

docker logs -f 0g-node

[INFO] Validator ZXConnect (0xea5972905B98D55e819b3540877d111228bee83b) is starting...
[INFO] Connecting to network with RPC URL <https://rpc.zxconnect.io>
[INFO] Node is running at 0.0.0.0:30303

git pull origin main
npm install

docker build -t 0g-node .
docker stop 0g-node
docker rm 0g-node
docker run -d --name 0g-node -p 30303:30303 0g-node