Skip to content

Commit 778a78a

Browse files
authored
Merge pull request #5 from DeBankDeFi/debank-v0.4.3
merge v0.4.3
2 parents 391a6b5 + 9982e47 commit 778a78a

File tree

7 files changed

+346
-351
lines changed

7 files changed

+346
-351
lines changed

Dockerfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Separating the builder and runtime image allows the runtime image to be
66
# considerably smaller because it doesn't need to have Golang installed.
7-
ARG BUILDER_IMAGE=docker.io/golang:1.23.5-alpine
7+
ARG BUILDER_IMAGE=docker.io/golang:1.23.6-alpine
88
ARG RUNTIME_IMAGE=docker.io/alpine:3.19.1
99
ARG TARGETOS
1010
ARG TARGETARCH
@@ -42,11 +42,7 @@ ARG UID=10001
4242
ARG USER_NAME=apollo
4343
ENV APOLLO_HOME=/home/${USER_NAME}
4444

45-
ENV RPC_ADDR=""
46-
ENV RPC_PORT=""
4745
ENV AUTH_TOKEN=""
48-
ENV GAS_PRICE=""
49-
ENV GAS_MULTIPLIER=""
5046
ENV NAMESPACEID=""
5147
ENV CELESTIA_NODE_ENDPOINT=""
5248

@@ -69,4 +65,4 @@ USER ${USER_NAME}
6965

7066
# Expose ports:
7167
EXPOSE 1317 9090 26657 1095 8080 26658
72-
ENTRYPOINT ["sh", "-c", "/bin/celestia-server --enable-rpc --rpc-addr $RPC_ADDR --rpc-port $RPC_PORT --celestia.auth-token $AUTH_TOKEN --celestia.gas-price $GAS_PRICE --celestia.gas-multiplier $GAS_MULTIPLIER --celestia.namespace-id $NAMESPACEID --celestia.rpc $CELESTIA_NODE_ENDPOINT"]
68+
ENTRYPOINT ["sh", "-c", "/bin/celestia-server --celestia.auth-token $AUTH_TOKEN --celestia.namespace-id $NAMESPACEID --celestia.rpc $CELESTIA_NODE_ENDPOINT"]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ A data availability server for the Arbitrum Nitro stack, leveraging Celestia DA
88

99
## Docker
1010

11-
`FROM ghcr.io/celestiaorg/nitro-das-celestia:v0.4.0`
11+
`FROM ghcr.io/celestiaorg/nitro-das-celestia:v0.4.2`
1212

1313

1414
## Example usage
1515

1616
```
1717
./celestia-server --enable-rpc --rpc-addr $RPC_ADDR \
18-
--rpc-port $RPC_PORT --celestia.auth-token $AUTH_TOKEN \
18+
--rpc-port $RPC_PORT \
19+
--celestia.auth-token $AUTH_TOKEN \
1920
--celestia.gas-price $GAS_PRICE \
2021
--celestia.gas-multiplier $GAS_MULTIPLIER \
2122
--celestia.namespace-id $NAMESPACEID \
22-
--celestia.rpc $CELESTIA_NODE_ENDPOINT \
23-
--celestia.keyname $KEYNAME
23+
--celestia.rpc $CELESTIA_NODE_ENDPOINT
2424
```
2525

2626
## Flags

cmd/celestiadaserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type CelestiaDAServerConfig struct {
4242
}
4343

4444
var DefaultCelestiaDAServerConfig = CelestiaDAServerConfig{
45-
EnableRPC: false,
45+
EnableRPC: true,
4646
RPCAddr: "localhost",
4747
RPCPort: 9876,
4848
RPCServerTimeouts: genericconf.HTTPServerTimeoutConfigDefault,

das/celestia.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ var (
5555
celestiaSuccessCounter = metrics.NewRegisteredCounter("celestia/action/celestia_success", nil)
5656
celestiaFailureCounter = metrics.NewRegisteredCounter("celestia/action/celestia_failure", nil)
5757
celestiaGasRetries = metrics.NewRegisteredCounter("celestia/action/gas_retries", nil)
58-
celestiaBlobInclusionRetries = metrics.NewRegisteredCounter("celestia/action/inclusion_retries", nil)
5958

6059
celestiaValidationLastSuccesfulActionGauge = metrics.NewRegisteredGauge("celestia/validation/last_success", nil)
6160
celestiaValidationSuccessCounter = metrics.NewRegisteredCounter("celestia/validation/blobstream_success", nil)
@@ -241,33 +240,6 @@ func (c *CelestiaDA) Store(ctx context.Context, message []byte) ([]byte, error)
241240
celestiaLastNonDefaultGasprice.Update(gasPrice)
242241
}
243242

244-
proofs, err := c.ReadClient.Blob.GetProof(ctx, height, *c.Namespace, dataBlob.Commitment)
245-
if err != nil {
246-
celestiaFailureCounter.Inc(1)
247-
log.Warn("Error retrieving proof", "err", err)
248-
return nil, err
249-
}
250-
251-
proofRetries := 0
252-
for proofs == nil {
253-
log.Warn("Retrieved empty proof from GetProof, fetching again...", "proofRetries", proofRetries)
254-
time.Sleep(time.Millisecond * 100)
255-
proofs, err = c.ReadClient.Blob.GetProof(ctx, height, *c.Namespace, dataBlob.Commitment)
256-
if err != nil {
257-
celestiaFailureCounter.Inc(1)
258-
log.Warn("Error retrieving proof", "err", err)
259-
return nil, err
260-
}
261-
proofRetries++
262-
celestiaBlobInclusionRetries.Inc(1)
263-
}
264-
265-
included, err := c.ReadClient.Blob.Included(ctx, height, *c.Namespace, proofs, dataBlob.Commitment)
266-
if err != nil || !included {
267-
celestiaFailureCounter.Inc(1)
268-
log.Warn("Error checking for inclusion", "err", err, "proof", proofs)
269-
return nil, err
270-
}
271243
log.Info("Succesfully posted blob", "height", height, "commitment", hex.EncodeToString(dataBlob.Commitment))
272244

273245
// we fetch the blob so that we can get the correct start index in the square
@@ -363,13 +335,6 @@ func (c *CelestiaDA) Store(ctx context.Context, message []byte) ([]byte, error)
363335
}
364336

365337
func (c *CelestiaDA) Read(ctx context.Context, blobPointer *BlobPointer) (*ReadResult, error) {
366-
// Wait until our client is synced
367-
err := c.ReadClient.Header.SyncWait(ctx)
368-
if err != nil {
369-
log.Error("trouble with client sync", "err", err)
370-
return nil, err
371-
}
372-
373338
header, err := c.ReadClient.Header.GetByHeight(ctx, blobPointer.BlockHeight)
374339
if err != nil {
375340
log.Error("could not fetch header", "err", err)

docker-compose.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
services:
2+
celestia:
3+
image: ghcr.io/celestiaorg/celestia-node:v0.21.9
4+
container_name: 'celestia'
5+
environment:
6+
- NODE_TYPE=light
7+
- P2P_NETWORK=mocha
8+
- RPC_URL=rpc-mocha.pops.one
9+
- RPC_PORT=9090
10+
- NETWORK=mocha
11+
command:
12+
- "celestia"
13+
- "light" # node type: light, bridge, or full
14+
- "start"
15+
- "--core.ip"
16+
- "consensus-full-mocha-4.celestia-mocha.com"
17+
- "--core.port"
18+
- "9090"
19+
- "--p2p.network"
20+
- "mocha"
21+
- "--rpc.skip-auth"
22+
- "--rpc.addr"
23+
- "0.0.0.0"
24+
ports:
25+
- "2121:2121"
26+
- "26658:26658"
27+
volumes:
28+
- ${HOME}/.celestia-light-mocha-4:/home/celestia
29+
30+
celestia-server-mocha:
31+
image: celestia-server:latest
32+
container_name: celestia-server
33+
environment:
34+
- CELESTIA_AUTH_TOKEN=${CELESTIA_AUTH_TOKEN:-}
35+
entrypoint: ["/bin/celestia-server", "--celestia.auth-token", \"$CELESTIA_AUTH_TOKEN\", "--celestia.namespace-id", "000008e5f679bf7116cb", "--celestia.rpc", "http://celestia:26658"]
36+
ports:
37+
- "1317:1317"
38+
- "9090:9090"
39+
- "26657:26657"
40+
- "1095:1095"
41+
- "8080:8080"
42+
depends_on:
43+
- celestia

0 commit comments

Comments
 (0)