chainsaw massacre

This commit is contained in:
Para Dox
2025-04-11 13:21:07 +07:00
parent 00997f8bc0
commit e4296a117c
410 changed files with 1285 additions and 1356241 deletions

View File

@@ -1,27 +0,0 @@
FROM golang:1.22 as builder
ARG VERSION
RUN apt-get update && apt-get install -y git musl-dev make
RUN cd /go && git clone https://github.com/0xsoniclabs/sonic.git && cd sonic && git fetch --tags && git checkout -b ${VERSION} tags/${VERSION}
WORKDIR /go/sonic
ARG GOPROXY
RUN go mod download
RUN make all
FROM golang:1.22
COPY --from=builder /go/sonic/build/sonicd /usr/local/bin/
COPY --from=builder /go/sonic/build/sonictool /usr/local/bin/
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 18545 18546 5050 5050/udp
VOLUME /var/sonic
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@@ -1,28 +0,0 @@
FROM golang:1.22 as builder
ARG VERSION
ARG REPO
RUN apt-get update && apt-get install -y git musl-dev make
RUN cd /go && git clone ${REPO:-https://github.com/0xsoniclabs/sonic.git} sonic && cd sonic && git fetch --tags && git checkout -b ${VERSION} tags/${VERSION}
WORKDIR /go/sonic
ARG GOPROXY
RUN go mod download
RUN make all
FROM golang:1.22
COPY --from=builder /go/sonic/build/sonicd /usr/local/bin/
COPY --from=builder /go/sonic/build/sonictool /usr/local/bin/
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 18545 18546 5050 5050/udp
VOLUME /var/sonic
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@@ -1,27 +0,0 @@
#!/bin/bash
datadir=/var/sonic
if [ ! -f "$datadir/initialized" ]; then
echo "Initializing Sonic..."
url="${GENESIS:-https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic.g}"
filename=$(basename "$url")
wget -P "$datadir" "$url"
GOMEMLIMIT="${CACHE_GB}GiB" sonictool --datadir "$datadir" --cache "${CACHE_GB}000" genesis "$datadir/$filename"
rm "$datadir/$filename"
touch "$datadir/initialized"
echo "Initialization complete."
else
echo "Sonic is already initialized."
fi
echo "Generating new Geth node key..."
#openssl rand 32 | xxd -p -c 32 | tr -d '\n' > "$datadir/nodekey"
#exec sonicd --nodekey "$datadir/nodekey" --cache "${CACHE_GB}000" --datadir "$datadir" "$@"
exec sonicd --cache "${CACHE_GB}000" --datadir "$datadir" "$@"

View File

@@ -1,27 +0,0 @@
#!/bin/bash
datadir=/var/sonic
if [ ! -f "$datadir/initialized" ]; then
echo "Initializing Sonic..."
url="${GENESIS:-https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic.g}"
filename=$(basename "$url")
wget -P "$datadir" "$url"
GOMEMLIMIT="${CACHE_GB}GiB" sonictool --datadir "$datadir" --cache "${CACHE_GB}000" genesis "$datadir/$filename"
rm "$datadir/$filename"
touch "$datadir/initialized"
echo "Initialization complete."
else
echo "Sonic is already initialized."
fi
echo "Generating new Geth node key..."
#openssl rand 32 | xxd -p -c 32 | tr -d '\n' > "$datadir/nodekey"
#exec sonicd --nodekey "$datadir/nodekey" --cache "${CACHE_GB}000" --datadir "$datadir" "$@"
exec sonicd --cache "${CACHE_GB}000" --datadir "$datadir" "$@"

View File

@@ -1,28 +0,0 @@
FROM golang:1.22 as builder
ARG VERSION
ARG REPO
RUN apt-get update && apt-get install -y git musl-dev make
RUN cd /go && git clone ${REPO:-https://github.com/0xsoniclabs/sonic.git} sonic && cd sonic && git fetch --tags && git checkout -b ${VERSION} tags/${VERSION}
WORKDIR /go/sonic
ARG GOPROXY
RUN go mod download
RUN make all
FROM golang:1.22
COPY --from=builder /go/sonic/build/sonicd /usr/local/bin/
COPY --from=builder /go/sonic/build/sonictool /usr/local/bin/
COPY ./scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 18545 18546 5050 5050/udp
VOLUME /var/sonic
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]