Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit c53be63

Browse files
committed
chore(fix): patch for testnet
1 parent 2307871 commit c53be63

File tree

3 files changed

+57
-8
lines changed

3 files changed

+57
-8
lines changed

Dockerfile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
# Build stage
2-
FROM golang:1.22 AS builder
2+
FROM golang:1.24 AS builder
33

44
# Set necessary environment variables
55
ENV CGO_ENABLED=1
66
ENV GOOS=linux
77
ENV GOARCH=amd64
8+
ARG SONIC_VERSION=v2.0.6
89

910
WORKDIR /tmp
1011

11-
RUN apt-get update && apt-get install -y --no-install-recommends make gcc g++ musl-dev git && rm -rf /var/lib/apt/lists/*
12+
RUN set -eux; \
13+
apt-get update && \
14+
apt-get install -y \
15+
ca-certificates \
16+
curl \
17+
wget \
18+
git \
19+
build-essential \
20+
&& rm -rf /var/lib/apt/lists/*
1221

13-
RUN git clone --depth 1 --branch v2.0.1 https://github.com/Fantom-foundation/Sonic.git && \
14-
cd Sonic && \
15-
make all
22+
RUN git clone --depth 1 --branch ${SONIC_VERSION} https://github.com/0xsoniclabs/sonic.git && \
23+
cd sonic && \
24+
make
1625

1726
# Final stage
1827

@@ -24,9 +33,9 @@ WORKDIR /root/.sonic
2433
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl jq && rm -rf /var/lib/apt/lists/*
2534

2635
# Copy binaries from builder stage
27-
COPY --from=builder /tmp/Sonic/build/ /usr/local/bin
36+
COPY --from=builder /tmp/sonic/build/ /usr/local/bin
2837

2938
# Expose Sonic's default ports (change if necessary)
30-
EXPOSE 18545 18546
39+
EXPOSE 18545/tcp 18546/tcp 5050/tcp 5050/udp
3140

3241
ENTRYPOINT ["sonicd"]

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
1-
# fantom-sonic-docker
1+
# Sonic-docker
2+
23
Repo that contains Dockerfile for Fantom Sonic client
4+
5+
## For Docker image in Sonic Blaze
6+
7+
```shell
8+
git clone https://github.com/0xsoniclabs/sonic.git && cd sonic
9+
git checkout v2.0.6
10+
11+
tee blaze.patch > /dev/null <<EOT
12+
diff --git a/gossip/blockproc/drivermodule/driver_txs.go b/gossip/blockproc/drivermodule/driver_txs.go
13+
index f687af6b..3106d3fa 100644
14+
--- a/gossip/blockproc/drivermodule/driver_txs.go
15+
+++ b/gossip/blockproc/drivermodule/driver_txs.go
16+
@@ -66,7 +66,7 @@ func InternalTxBuilder(statedb state.StateDB) func(calldata []byte, addr common.
17+
if nonce == math.MaxUint64 {
18+
nonce = statedb.GetNonce(common.Address{})
19+
}
20+
- tx := types.NewTransaction(nonce, addr, common.Big0, 500_000_000, common.Big0, calldata)
21+
+ tx := types.NewTransaction(nonce, addr, common.Big0, 75_000_000, common.Big0, calldata)
22+
nonce++
23+
return tx
24+
}
25+
EOT
26+
27+
git apply blaze.patch
28+
docker buildx build --platform linux/amd64 -t chainstack/sonic-labs:v2.0.6-testnet .
29+
```

blaze.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/gossip/blockproc/drivermodule/driver_txs.go b/gossip/blockproc/drivermodule/driver_txs.go
2+
index f687af6b..3106d3fa 100644
3+
--- a/gossip/blockproc/drivermodule/driver_txs.go
4+
+++ b/gossip/blockproc/drivermodule/driver_txs.go
5+
@@ -66,7 +66,7 @@ func InternalTxBuilder(statedb state.StateDB) func(calldata []byte, addr common.
6+
if nonce == math.MaxUint64 {
7+
nonce = statedb.GetNonce(common.Address{})
8+
}
9+
- tx := types.NewTransaction(nonce, addr, common.Big0, 500_000_000, common.Big0, calldata)
10+
+ tx := types.NewTransaction(nonce, addr, common.Big0, 75_000_000, common.Big0, calldata)
11+
nonce++
12+
return tx
13+
}

0 commit comments

Comments
 (0)