Skip to content

Commit cdaa393

Browse files
authored
Merge pull request #16 from celestiaorg/mocha-v0.25.2
celestia-node 0.25.3
2 parents 1b98cb9 + 3201919 commit cdaa393

File tree

6 files changed

+691
-1955
lines changed

6 files changed

+691
-1955
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
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.6-alpine
7+
ARG BUILDER_IMAGE=docker.io/golang:1.24.6-alpine
88
ARG RUNTIME_IMAGE=docker.io/alpine:3.19.1
99
ARG TARGETOS
1010
ARG TARGETARCH

cmd/celestiadaserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var DefaultCelestiaDAServerConfig = CelestiaDAServerConfig{
5454
RPCPort: 9876,
5555
RPCServerTimeouts: genericconf.HTTPServerTimeoutConfigDefault,
5656
RPCServerBodyLimit: genericconf.HTTPServerBodyLimitDefault,
57-
FallbackEnabled: true,
57+
FallbackEnabled: false,
5858
LogLevel: "INFO",
5959
LogType: "plaintext",
6060
Metrics: false,

daserver/celestia.go

Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212
"sync"
1313
"time"
1414

15-
node "github.com/celestiaorg/celestia-node/api/rpc/client"
15+
txclient "github.com/celestiaorg/celestia-node/api/client"
1616
"github.com/celestiaorg/celestia-node/blob"
17+
"github.com/celestiaorg/celestia-node/nodebuilder/p2p"
1718
"github.com/celestiaorg/celestia-node/state"
1819
libshare "github.com/celestiaorg/go-square/v2/share"
1920
"github.com/celestiaorg/nitro-das-celestia/celestiagen"
@@ -38,7 +39,15 @@ type DAConfig struct {
3839
NamespaceId string `koanf:"namespace-id" `
3940
AuthToken string `koanf:"auth-token" reload:"hot"`
4041
ReadAuthToken string `koanf:"read-auth-token" reload:"hot"`
42+
CoreToken string `koanf:"core-token" reload:"hot"`
43+
CoreURL string `koanf:"core-url" reload:"hot"`
44+
CoreNetwork string `koanf:"core-network" reload:"hot"`
45+
KeyName string `koanf:"key-name" reload:"hot"`
46+
KeyPath string `koanf:"key-path" reload:"hot"`
47+
BackendName string `koanf:"backend-name" reload:"hot"`
4148
NoopWriter bool `koanf:"noop-writer" reload:"hot"`
49+
EnableDATLS bool `koanf:"enable-da-tls" reload:"hot"`
50+
EnableCoreTLS bool `koanf:"enable-core-tls" reload:"hot"`
4251
ValidatorConfig ValidatorConfig `koanf:"validator-config" reload:"hot"`
4352
ReorgOnReadFailure bool `koanf:"dangerous-reorg-on-read-failure"`
4453
CacheCleanupTime time.Duration `koanf:"cache-time"`
@@ -87,8 +96,8 @@ func IsCelestiaMessageHeaderByte(header byte) bool {
8796

8897
type CelestiaDA struct {
8998
Cfg *DAConfig
90-
Client *node.Client
91-
ReadClient *node.Client
99+
Client *txclient.Client
100+
ReadClient *txclient.Client
92101

93102
Namespace *libshare.Namespace
94103

@@ -104,6 +113,14 @@ func CelestiaDAConfigAddOptions(prefix string, f *pflag.FlagSet) {
104113
f.String(prefix+".namespace-id", "", "Celestia Namespace to post data to")
105114
f.String(prefix+".auth-token", "", "Auth token for Celestia Node")
106115
f.String(prefix+".read-auth-token", "", "Auth token for Celestia Node")
116+
f.String(prefix+".core-token", "", "Auth token for Core Celestia Node Endpoint")
117+
f.String(prefix+".core-url", "", "URL to Celestia Core endpoint")
118+
f.String(prefix+".core-network", "celestia", "Celestia Network to use")
119+
f.String(prefix+".key-name", "my_key", "key name to use")
120+
f.String(prefix+".key-path", "./keys", "key path to use")
121+
f.String(prefix+".backend-name", "test", "keyring backend to use")
122+
f.Bool(prefix+".enable-da-tls", false, "enable TLS for DA node")
123+
f.Bool(prefix+".enable-core-tls", false, "enable TLS for Core node")
107124
f.Bool(prefix+".noop-writer", false, "Noop writer (disable posting to celestia)")
108125
f.String(prefix+".validator-config"+".eth-rpc", "", "Parent chain connection, only used for validation")
109126
f.String(prefix+".validator-config"+".blobstream", "", "Blobstream address, only used for validation")
@@ -116,19 +133,53 @@ func NewCelestiaDA(cfg *DAConfig) (*CelestiaDA, error) {
116133
if cfg == nil {
117134
return nil, errors.New("celestia cfg cannot be blank")
118135
}
119-
daClient, err := node.NewClient(context.Background(), cfg.Rpc, cfg.AuthToken)
136+
// Create a keyring
137+
kr, err := txclient.KeyringWithNewKey(txclient.KeyringConfig{
138+
KeyName: cfg.KeyName,
139+
BackendName: cfg.BackendName,
140+
}, cfg.KeyPath)
120141
if err != nil {
121142
return nil, err
122143
}
123144

124-
var readClient *node.Client
145+
// Configure the client
146+
clientCfg := txclient.Config{
147+
ReadConfig: txclient.ReadConfig{
148+
BridgeDAAddr: cfg.Rpc,
149+
DAAuthToken: cfg.AuthToken,
150+
EnableDATLS: cfg.EnableDATLS,
151+
},
152+
SubmitConfig: txclient.SubmitConfig{
153+
DefaultKeyName: cfg.KeyName,
154+
Network: p2p.Network(cfg.CoreNetwork),
155+
CoreGRPCConfig: txclient.CoreGRPCConfig{
156+
Addr: cfg.CoreURL,
157+
TLSEnabled: cfg.EnableCoreTLS,
158+
AuthToken: cfg.CoreToken,
159+
},
160+
},
161+
}
162+
163+
celestiaClient, err := txclient.New(context.Background(), clientCfg, kr)
164+
if err != nil {
165+
return nil, err
166+
}
167+
168+
var readClient *txclient.Client
125169
if cfg.ReadRpc != "" && cfg.ReadAuthToken != "" {
126-
readClient, err = node.NewClient(context.Background(), cfg.ReadRpc, cfg.ReadAuthToken)
170+
readClientCfg := txclient.Config{
171+
ReadConfig: txclient.ReadConfig{
172+
BridgeDAAddr: cfg.ReadRpc,
173+
DAAuthToken: cfg.ReadAuthToken,
174+
EnableDATLS: cfg.EnableDATLS,
175+
},
176+
}
177+
readClient, err = txclient.New(context.Background(), readClientCfg, kr)
127178
if err != nil {
128179
return nil, err
129180
}
130181
} else {
131-
readClient = daClient
182+
readClient = celestiaClient
132183
}
133184

134185
if cfg.NamespaceId == "" {
@@ -146,7 +197,7 @@ func NewCelestiaDA(cfg *DAConfig) (*CelestiaDA, error) {
146197

147198
da := &CelestiaDA{
148199
Cfg: cfg,
149-
Client: daClient,
200+
Client: celestiaClient,
150201
ReadClient: readClient,
151202
Namespace: &namespace,
152203
}

daserver/proof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"math/big"
55

66
"github.com/celestiaorg/celestia-node/nodebuilder/blobstream"
7-
"github.com/tendermint/tendermint/crypto/merkle"
7+
"github.com/cometbft/cometbft/crypto/merkle"
88
)
99

1010
type Namespace struct {

0 commit comments

Comments
 (0)