Skip to content

Commit b1f5457

Browse files
committed
use tastora v0.1.0
1 parent e6299cd commit b1f5457

3 files changed

Lines changed: 56 additions & 22 deletions

File tree

test/docker-e2e/docker_test.go

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"github.com/cosmos/cosmos-sdk/x/auth"
2222
"github.com/cosmos/cosmos-sdk/x/bank"
2323
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
24+
dockerclient "github.com/moby/moby/client"
2425
"github.com/stretchr/testify/suite"
2526
"go.uber.org/zap/zaptest"
2627
)
@@ -46,10 +47,12 @@ func TestDockerSuite(t *testing.T) {
4647

4748
type DockerTestSuite struct {
4849
suite.Suite
49-
provider tastoratypes.Provider
50-
celestia tastoratypes.Chain
51-
daNetwork tastoratypes.DataAvailabilityNetwork
52-
rollkitChain tastoratypes.RollkitChain
50+
provider tastoratypes.Provider
51+
celestia tastoratypes.Chain
52+
daNetwork tastoratypes.DataAvailabilityNetwork
53+
rollkitChain tastoratypes.RollkitChain
54+
dockerClient *dockerclient.Client
55+
dockerNetworkID string
5356
}
5457

5558
// ConfigOption is a function type for modifying tastoradocker.Config
@@ -62,28 +65,24 @@ func (s *DockerTestSuite) CreateDockerProvider(opts ...ConfigOption) tastoratype
6265
numValidators := 1
6366
numFullNodes := 0
6467
client, network := tastoradocker.DockerSetup(t)
68+
69+
// Store client and network ID in the suite for later use
70+
s.dockerClient = client
71+
s.dockerNetworkID = network
6572

6673
cfg := tastoradocker.Config{
6774
Logger: zaptest.NewLogger(t),
6875
DockerClient: client,
6976
DockerNetworkID: network,
7077
ChainConfig: &tastoradocker.ChainConfig{
71-
ConfigFileOverrides: map[string]any{
72-
"config/app.toml": appOverrides(),
73-
"config/config.toml": configOverrides(),
74-
},
75-
Type: "celestia",
7678
Name: "celestia",
77-
Version: "v4.0.0-rc6",
7879
NumValidators: &numValidators,
7980
NumFullNodes: &numFullNodes,
8081
ChainID: testChainID,
81-
Images: []tastoradocker.DockerImage{
82-
{
83-
Repository: "ghcr.io/celestiaorg/celestia-app",
84-
Version: "v4.0.0-rc6",
85-
UIDGID: "10001:10001",
86-
},
82+
Image: tastoradocker.DockerImage{
83+
Repository: "ghcr.io/celestiaorg/celestia-app",
84+
Version: "v4.0.0-rc6",
85+
UIDGID: "10001:10001",
8786
},
8887
Bin: "celestia-appd",
8988
Bech32Prefix: "celestia",
@@ -149,13 +148,44 @@ func (s *DockerTestSuite) SetupDockerResources(opts ...ConfigOption) {
149148
s.rollkitChain = s.CreateRollkitChain()
150149
}
151150

152-
// CreateChain creates a chain using the provider.
151+
// CreateChain creates a chain using the ChainBuilder pattern.
153152
func (s *DockerTestSuite) CreateChain() tastoratypes.Chain {
154153
ctx := context.Background()
154+
t := s.T()
155+
encConfig := testutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, bank.AppModuleBasic{})
155156

156-
chain, err := s.provider.GetChain(ctx)
157-
s.Require().NoError(err)
157+
// Create chain using ChainBuilder pattern
158+
chain, err := tastoradocker.NewChainBuilder(t).
159+
WithName("celestia").
160+
WithChainID(testChainID).
161+
WithBinaryName("celestia-appd").
162+
WithBech32Prefix("celestia").
163+
WithDenom("utia").
164+
WithCoinType("118").
165+
WithGasPrices("0.025utia").
166+
WithGasAdjustment(1.3).
167+
WithEncodingConfig(&encConfig).
168+
WithImage(tastoradocker.DockerImage{
169+
Repository: "ghcr.io/celestiaorg/celestia-app",
170+
Version: "v4.0.0-rc6",
171+
UIDGID: "10001:10001",
172+
}).
173+
WithAdditionalStartArgs(
174+
"--force-no-bbr",
175+
"--grpc.enable",
176+
"--grpc.address",
177+
"0.0.0.0:9090",
178+
"--rpc.grpc_laddr=tcp://0.0.0.0:9098",
179+
"--timeout-commit", "1s",
180+
).
181+
WithDockerClient(s.dockerClient).
182+
WithDockerNetworkID(s.dockerNetworkID).
183+
WithNode(tastoradocker.NewChainNodeConfigBuilder().
184+
WithNodeType(tastoradocker.ValidatorNodeType).
185+
Build()).
186+
Build(ctx)
158187

188+
s.Require().NoError(err)
159189
return chain
160190
}
161191

test/docker-e2e/go.mod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ go 1.24.2
44

55
require github.com/celestiaorg/tastora v0.0.4
66

7+
require github.com/containerd/errdefs/pkg v0.3.0 // indirect
8+
9+
replace github.com/celestiaorg/tastora => ../../../tastora
10+
711
require (
812
github.com/golang/mock v1.6.0 // indirect
913
github.com/google/orderedcode v0.0.1 // indirect
@@ -86,7 +90,7 @@ require (
8690
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
8791
github.com/dgraph-io/ristretto v0.1.1 // indirect
8892
github.com/distribution/reference v0.6.0 // indirect
89-
github.com/docker/docker v28.3.3+incompatible // indirect
93+
github.com/docker/docker v28.3.3+incompatible
9094
github.com/docker/go-connections v0.5.0 // indirect
9195
github.com/docker/go-units v0.5.0 // indirect
9296
github.com/dustin/go-humanize v1.0.1 // indirect

test/docker-e2e/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ github.com/celestiaorg/go-square/v2 v2.2.0 h1:zJnUxCYc65S8FgUfVpyG/osDcsnjzo/JSX
125125
github.com/celestiaorg/go-square/v2 v2.2.0/go.mod h1:j8kQUqJLYtcvCQMQV6QjEhUdaF7rBTXF74g8LbkR0Co=
126126
github.com/celestiaorg/nmt v0.23.0 h1:cfYy//hL1HeDSH0ub3CPlJuox5U5xzgg4JGZrw23I/I=
127127
github.com/celestiaorg/nmt v0.23.0/go.mod h1:kYfIjRq5rmA2mJnv41GLWkxn5KyLNPlma3v5Q68rHdI=
128-
github.com/celestiaorg/tastora v0.0.4 h1:bRarVu5MZuqi4TEzjjRE8pKy4YSt2aVAPA/nbB99ZKg=
129-
github.com/celestiaorg/tastora v0.0.4/go.mod h1:A/DWauemWmg353BvhWYPCd8XbED12UCUiQsL+1sz9BU=
130128
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
131129
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
132130
github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
@@ -176,6 +174,8 @@ github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvA
176174
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
177175
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
178176
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
177+
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
178+
github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk=
179179
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
180180
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
181181
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=

0 commit comments

Comments
 (0)