Sign inSign up

golimit/quilibrium

By golimit

•Updated over 1 year ago

Package the files in the node folder based on QuilibriumNetwork/ceremonyclient.

Image
Integration & delivery
1

1.8K

golimit/quilibrium repository overview

⁠update

  • 2024年10月24日 14:50:22 更新.config在/root/bin下,直接启动即可

⁠docker-compose.yml

name: quilibrium

services:
  node:
    image: golimit/quilibrium:latest
    restart: unless-stopped
    network_mode: host
    deploy:
      resources:
        limits:
          cpus: '7'
          memory: '14.5G'
    environment:
      - DEFAULT_LISTEN_GRPC_MULTIADDR=/ip4/0.0.0.0/tcp/8337
      - DEFAULT_LISTEN_REST_MULTIADDR=/ip4/0.0.0.0/tcp/8338
      - DEFAULT_STATS_MULTIADDR=/dns/stats.quilibrium.com/tcp/443
    ports:
      - '${QUILIBRIUM_P2P_PORT:-8336}:8336/udp' # p2p
      - '127.0.0.1:${QUILIBRIUM_GRPC_PORT:-8337}:8337/tcp' # gRPC
      - '127.0.0.1:${QUILIBRIUM_REST_PORT:-8338}:8338/tcp' # REST
    healthcheck:
      test: ["CMD", "grpcurl", "-plaintext", "localhost:8337", "list", "quilibrium.node.node.pb.NodeService"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 1m
    volumes:
      - ./config:/root/bin/.config
    logging:
      driver: "json-file"
      options:
        max-file: "5"
        max-size: 1024m

⁠Update bin And Dockerfile Shell

#!/bin/bash

work_dir="$(cd $(dirname $0);pwd)"

rm -rf ${work_dir}/ceremonyclient/node/node*
rm -rf ${work_dir}/ceremonyclient/node/qclient*

cd ${work_dir}/ceremonyclient/node
bash release_autorun.sh
bash down-qclient.sh

cd ${work_dir}
rm -rf ${work_dir}/bin/node*
rm -rf ${work_dir}/bin/qclient*

rsync -av -P ${work_dir}/ceremonyclient/node/* ${work_dir}/bin

node_version=$(ls ${work_dir}/ceremonyclient/node | grep -Eio node-.*-linux | sed 's/node-//g' | sed 's/-linux//g' | uniq | head -n 1)
qclient_version=$(ls ${work_dir}/ceremonyclient/node | grep -Eio qclient-.*-linux | sed 's/node-//g' | sed 's/-linux//g' | uniq | head -n 1)

cat > ${work_dir}/Dockerfile << EOF
FROM golang:1.20.14-alpine3.19 AS build
ENV GOEXPERIMENT=arenas
RUN go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest

FROM debian:latest
ARG NODE_VERSION
ARG GIT_REPO
ARG GIT_BRANCH
ARG GIT_COMMIT
ENV GOEXPERIMENT=arenas

RUN apt-get update && apt-get upgrade -y && \
    apt-get install -y ca-certificates tzdata && \
    update-ca-certificates

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && dpkg-reconfigure -f noninteractive tzdata

RUN apt-get clean && rm -rf /var/lib/apt/lists/*

COPY --from=build /go/bin/grpcurl /usr/local/bin
COPY bin /root/bin
RUN chmod -R +x /root/bin
RUN ln -s /root/bin/node-${node_version}-linux-amd64 /root/bin/node-linux-amd64
RUN ln -s /root/bin/qclient-${qclient_version}-linux-amd64 /root/bin/qclient

# 调试步骤
RUN ls -l /root/bin
RUN ldd /root/bin/node-${node_version}-linux-amd64 || true

WORKDIR /root/bin
CMD ["./node-linux-amd64"]
EOF

docker build -t golimit/quilibrium:${node_version} .
docker tag golimit/quilibrium:${node_version} golimit/quilibrium:latest
docker push golimit/quilibrium:${node_version}
docker push golimit/quilibrium:latest

⁠Dockerfile

If you want to compile it yourself, you can use a Dockerfile.

FROM golang:1.20.14-alpine3.19 AS build
ENV GOEXPERIMENT=arenas
RUN go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest

FROM debian:latest
ARG NODE_VERSION
ARG GIT_REPO
ARG GIT_BRANCH
ARG GIT_COMMIT
ENV GOEXPERIMENT=arenas

RUN apt-get update && apt-get upgrade -y &&     apt-get install -y ca-certificates tzdata &&     update-ca-certificates

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime     && dpkg-reconfigure -f noninteractive tzdata

RUN apt-get clean && rm -rf /var/lib/apt/lists/*

COPY --from=build /go/bin/grpcurl /usr/local/bin
COPY bin /root/bin
RUN chmod -R +x /root/bin
RUN ln -s /root/bin/node-2.0.1-linux-amd64 /root/bin/node-linux-amd64
RUN ln -s /root/bin/qclient-qclient-2.0.1-linux-amd64 /root/bin/qclient

# 调试步骤
RUN ls -l /root/bin
RUN ldd /root/bin/node-2.0.1-linux-amd64 || true

WORKDIR /root/bin
CMD ["./node-linux-amd64"]

⁠Check Node

docker-compose exec node /root/bin/node-linux-amd64 -node-info
docker-compose exec node /root/bin/node-linux-amd64 -balance

Tag summary

Content type

Image

Digest

sha256:c6514d8cb…

Size

520 MB

Last updated

over 1 year ago

docker pull golimit/quilibrium