Skip to content

Commit 44d83bd

Browse files
authored
chore: bump tastora to v0.3.0 (#2652)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview This PR bumps tastora to v0.3.0, which included some package restructures / renames and changed the way docker resources are provisioned for app/node/evnode to all use the same builder pattern for consistency. The way hostnames and ports are now also accessed via a `NetworkInfo` type consistently across resource types. I also renamed rollkit -> evnode in variables / test names. <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> -->
1 parent 4b5b639 commit 44d83bd

File tree

6 files changed

+235
-278
lines changed

6 files changed

+235
-278
lines changed

.github/workflows/claude.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: anthropics/claude-code-action@v1
3636
with:
3737
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38-
38+
3939
# This is an optional setting that allows Claude to read CI results on PRs
4040
additional_permissions: |
4141
actions: read
@@ -47,4 +47,3 @@ jobs:
4747
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4848
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
4949
# claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'
50-

test/docker-e2e/base_test.go

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"testing"
99
"time"
1010

11-
"github.com/celestiaorg/tastora/framework/types"
11+
da "github.com/celestiaorg/tastora/framework/docker/dataavailability"
1212
"github.com/stretchr/testify/require"
1313
)
1414

@@ -17,7 +17,7 @@ func (s *DockerTestSuite) TestBasicDockerE2E() {
1717
s.SetupDockerResources()
1818

1919
var (
20-
bridgeNode types.DANode
20+
bridgeNode *da.Node
2121
)
2222

2323
s.T().Run("start celestia chain", func(t *testing.T) {
@@ -28,8 +28,9 @@ func (s *DockerTestSuite) TestBasicDockerE2E() {
2828
s.T().Run("start bridge node", func(t *testing.T) {
2929
genesisHash := s.getGenesisHash(ctx)
3030

31-
celestiaNodeHostname, err := s.celestia.GetNodes()[0].GetInternalHostName(ctx)
31+
networkInfo, err := s.celestia.GetNodes()[0].GetNetworkInfo(ctx)
3232
s.Require().NoError(err)
33+
celestiaNodeHostname := networkInfo.Internal.Hostname
3334

3435
bridgeNode = s.daNetwork.GetBridgeNodes()[0]
3536

@@ -45,32 +46,44 @@ func (s *DockerTestSuite) TestBasicDockerE2E() {
4546
})
4647

4748
s.T().Run("start evolve chain node", func(t *testing.T) {
48-
s.StartEvNode(ctx, bridgeNode, s.evNodeChain.GetNodes()[0])
49+
s.StartEVNode(ctx, bridgeNode, s.evNodeChain.GetNodes()[0])
4950
})
5051

5152
s.T().Run("submit a transaction to the evolve chain", func(t *testing.T) {
52-
rollkitNode := s.evNodeChain.GetNodes()[0]
53+
evNode := s.evNodeChain.GetNodes()[0]
5354

5455
// Debug: Check if the node is running and all ports
55-
t.Logf("Rollkit node RPC port: %s", rollkitNode.GetHostRPCPort())
56-
t.Logf("Rollkit node GRPC port: %s", rollkitNode.GetHostGRPCPort())
57-
t.Logf("Rollkit node P2P port: %s", rollkitNode.GetHostP2PPort())
56+
networkInfo, err := evNode.GetNetworkInfo(ctx)
57+
require.NoError(t, err)
58+
59+
t.Logf("EV node RPC port: %s", networkInfo.External.RPCAddress())
60+
t.Logf("EV node HTTP port: %s", networkInfo.External.HTTPAddress())
5861

5962
// The http port resolvable by the test runner.
60-
httpPortStr := rollkitNode.GetHostHTTPPort()
61-
t.Logf("Rollkit node HTTP port: %s", httpPortStr)
63+
httpPortStr := networkInfo.External.HTTPAddress()
64+
t.Logf("EV node HTTP address: %s", httpPortStr)
6265

6366
if httpPortStr == "" {
64-
t.Fatal("HTTP port is empty - this indicates the HTTP server is not running or port mapping failed")
67+
t.Fatal("HTTP address is empty - this indicates the HTTP server is not running or port mapping failed")
68+
}
69+
70+
// Extract the host and port from the address
71+
parts := strings.Split(httpPortStr, ":")
72+
if len(parts) != 2 {
73+
t.Fatalf("Invalid HTTP address format: %s", httpPortStr)
74+
}
75+
host, port := parts[0], parts[1]
76+
77+
// Use localhost since this is the external address accessible from the test host
78+
if host == "0.0.0.0" {
79+
host = "localhost"
6580
}
6681

67-
// Extract just the port number if it includes an address
68-
httpPort := strings.Split(httpPortStr, ":")[len(strings.Split(httpPortStr, ":"))-1]
69-
t.Logf("Extracted port: %s", httpPort)
82+
t.Logf("Extracted host: %s, port: %s", host, port)
7083

71-
client, err := NewClient("localhost", httpPort)
84+
client, err := NewClient(host, port)
7285
require.NoError(t, err)
73-
t.Logf("Created HTTP client with base URL: http://localhost:%s", httpPort)
86+
t.Logf("Created HTTP client with base URL: http://%s:%s", host, port)
7487

7588
key := "key1"
7689
value := "value1"

test/docker-e2e/docker_test.go

Lines changed: 66 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import (
1414
"github.com/celestiaorg/go-square/v2/share"
1515
tastoradocker "github.com/celestiaorg/tastora/framework/docker"
1616
"github.com/celestiaorg/tastora/framework/docker/container"
17+
"github.com/celestiaorg/tastora/framework/docker/cosmos"
18+
da "github.com/celestiaorg/tastora/framework/docker/dataavailability"
19+
"github.com/celestiaorg/tastora/framework/docker/evstack"
1720
"github.com/celestiaorg/tastora/framework/testutil/sdkacc"
1821
tastoratypes "github.com/celestiaorg/tastora/framework/types"
1922
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -23,7 +26,6 @@ import (
2326
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2427
dockerclient "github.com/moby/moby/client"
2528
"github.com/stretchr/testify/suite"
26-
"go.uber.org/zap/zaptest"
2729
)
2830

2931
const (
@@ -49,48 +51,21 @@ func TestDockerSuite(t *testing.T) {
4951

5052
type DockerTestSuite struct {
5153
suite.Suite
52-
provider tastoratypes.Provider
53-
celestia tastoratypes.Chain
54-
daNetwork tastoratypes.DataAvailabilityNetwork
55-
evNodeChain tastoratypes.RollkitChain
54+
celestia *cosmos.Chain
55+
daNetwork *da.Network
56+
evNodeChain *evstack.Chain
5657
dockerClient *dockerclient.Client
5758
dockerNetworkID string
5859
}
5960

60-
// ConfigOption is a function type for modifying tastoradocker.Config
61-
type ConfigOption func(*tastoradocker.Config)
62-
63-
// CreateDockerProvider creates a new tastoratypes.Provider with optional configuration modifications
64-
func (s *DockerTestSuite) CreateDockerProvider(opts ...ConfigOption) tastoratypes.Provider {
61+
// setupDockerEnvironment sets up the basic Docker environment
62+
func (s *DockerTestSuite) setupDockerEnvironment() {
6563
t := s.T()
6664
client, network := tastoradocker.DockerSetup(t)
6765

6866
// Store client and network ID in the suite for later use
6967
s.dockerClient = client
7068
s.dockerNetworkID = network
71-
72-
cfg := tastoradocker.Config{
73-
Logger: zaptest.NewLogger(t),
74-
DockerClient: client,
75-
DockerNetworkID: network,
76-
DataAvailabilityNetworkConfig: &tastoradocker.DataAvailabilityNetworkConfig{
77-
BridgeNodeCount: 1,
78-
Image: container.NewImage("ghcr.io/celestiaorg/celestia-node", "v0.25.3", "10001:10001"),
79-
},
80-
RollkitChainConfig: &tastoradocker.RollkitChainConfig{
81-
ChainID: "rollkit-test",
82-
Bin: "testapp",
83-
AggregatorPassphrase: "12345678",
84-
NumNodes: 1,
85-
Image: getEvNodeImage(),
86-
},
87-
}
88-
89-
for _, opt := range opts {
90-
opt(&cfg)
91-
}
92-
93-
return tastoradocker.NewProvider(cfg, t)
9469
}
9570

9671
// getGenesisHash returns the genesis hash of the given chain node.
@@ -108,23 +83,23 @@ func (s *DockerTestSuite) getGenesisHash(ctx context.Context) string {
10883
return genesisHash
10984
}
11085

111-
// SetupDockerResources creates a new provider and chain using the given configuration options.
86+
// SetupDockerResources creates chains using the builder pattern.
11287
// none of the resources are started.
113-
func (s *DockerTestSuite) SetupDockerResources(opts ...ConfigOption) {
114-
s.provider = s.CreateDockerProvider(opts...)
88+
func (s *DockerTestSuite) SetupDockerResources() {
89+
s.setupDockerEnvironment()
11590
s.celestia = s.CreateChain()
11691
s.daNetwork = s.CreateDANetwork()
11792
s.evNodeChain = s.CreateEvolveChain()
11893
}
11994

12095
// CreateChain creates a chain using the ChainBuilder pattern.
121-
func (s *DockerTestSuite) CreateChain() tastoratypes.Chain {
96+
func (s *DockerTestSuite) CreateChain() *cosmos.Chain {
12297
ctx := context.Background()
12398
t := s.T()
12499
encConfig := testutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, bank.AppModuleBasic{})
125100

126101
// Create chain using ChainBuilder pattern
127-
chain, err := tastoradocker.NewChainBuilder(t).
102+
chain, err := cosmos.NewChainBuilder(t).
128103
WithName("celestia").
129104
WithChainID(testChainID).
130105
WithBinaryName("celestia-appd").
@@ -145,7 +120,7 @@ func (s *DockerTestSuite) CreateChain() tastoratypes.Chain {
145120
).
146121
WithDockerClient(s.dockerClient).
147122
WithDockerNetworkID(s.dockerNetworkID).
148-
WithNode(tastoradocker.NewChainNodeConfigBuilder().
123+
WithNode(cosmos.NewChainNodeConfigBuilder().
149124
WithNodeType(tastoratypes.NodeTypeValidator).
150125
Build()).
151126
Build(ctx)
@@ -154,33 +129,56 @@ func (s *DockerTestSuite) CreateChain() tastoratypes.Chain {
154129
return chain
155130
}
156131

157-
// CreateDANetwork creates a DA network using the provider
158-
func (s *DockerTestSuite) CreateDANetwork() tastoratypes.DataAvailabilityNetwork {
132+
// CreateDANetwork creates a DA network using the builder pattern
133+
func (s *DockerTestSuite) CreateDANetwork() *da.Network {
159134
ctx := context.Background()
135+
t := s.T()
136+
137+
bridgeNodeConfig := da.NewNodeBuilder().
138+
WithNodeType(tastoratypes.BridgeNode).
139+
Build()
160140

161-
daNetwork, err := s.provider.GetDataAvailabilityNetwork(ctx)
141+
daNetwork, err := da.NewNetworkBuilder(t).
142+
WithDockerClient(s.dockerClient).
143+
WithDockerNetworkID(s.dockerNetworkID).
144+
WithImage(container.NewImage("ghcr.io/celestiaorg/celestia-node", "v0.25.3", "10001:10001")).
145+
WithNode(bridgeNodeConfig).
146+
Build(ctx)
162147
s.Require().NoError(err)
163148

164149
return daNetwork
165150
}
166151

167-
// CreateEvolveChain creates a Rollkit chain using the provider
168-
func (s *DockerTestSuite) CreateEvolveChain() tastoratypes.RollkitChain {
152+
// CreateEvolveChain creates an evstack chain using the builder pattern
153+
func (s *DockerTestSuite) CreateEvolveChain() *evstack.Chain {
169154
ctx := context.Background()
155+
t := s.T()
170156

171-
rollkitChain, err := s.provider.GetRollkitChain(ctx)
157+
aggregatorNodeConfig := evstack.NewNodeBuilder().
158+
WithAggregator(true).
159+
Build()
160+
161+
evNodeChain, err := evstack.NewChainBuilder(t).
162+
WithChainID("evchain-test").
163+
WithBinaryName("testapp").
164+
WithAggregatorPassphrase("12345678").
165+
WithImage(getEvNodeImage()).
166+
WithDockerClient(s.dockerClient).
167+
WithDockerNetworkID(s.dockerNetworkID).
168+
WithNode(aggregatorNodeConfig).
169+
Build(ctx)
172170
s.Require().NoError(err)
173171

174-
return rollkitChain
172+
return evNodeChain
175173
}
176174

177175
// StartBridgeNode initializes and starts a bridge node within the data availability network using the given parameters.
178-
func (s *DockerTestSuite) StartBridgeNode(ctx context.Context, bridgeNode tastoratypes.DANode, chainID string, genesisHash string, celestiaNodeHostname string) {
176+
func (s *DockerTestSuite) StartBridgeNode(ctx context.Context, bridgeNode *da.Node, chainID string, genesisHash string, celestiaNodeHostname string) {
179177
s.Require().Equal(tastoratypes.BridgeNode, bridgeNode.GetType())
180178
err := bridgeNode.Start(ctx,
181-
tastoratypes.WithChainID(chainID),
182-
tastoratypes.WithAdditionalStartArguments("--p2p.network", chainID, "--core.ip", celestiaNodeHostname, "--rpc.addr", "0.0.0.0"),
183-
tastoratypes.WithEnvironmentVariables(
179+
da.WithChainID(chainID),
180+
da.WithAdditionalStartArguments("--p2p.network", chainID, "--core.ip", celestiaNodeHostname, "--rpc.addr", "0.0.0.0"),
181+
da.WithEnvironmentVariables(
184182
map[string]string{
185183
"CELESTIA_CUSTOM": tastoratypes.BuildCelestiaCustomEnvVar(chainID, genesisHash, ""),
186184
"P2P_NETWORK": chainID,
@@ -191,7 +189,7 @@ func (s *DockerTestSuite) StartBridgeNode(ctx context.Context, bridgeNode tastor
191189
}
192190

193191
// FundWallet transfers the specified amount of utia from the faucet wallet to the target wallet.
194-
func (s *DockerTestSuite) FundWallet(ctx context.Context, wallet tastoratypes.Wallet, amount int64) {
192+
func (s *DockerTestSuite) FundWallet(ctx context.Context, wallet *tastoratypes.Wallet, amount int64) {
195193
fromAddress, err := sdkacc.AddressFromWallet(s.celestia.GetFaucetWallet())
196194
s.Require().NoError(err)
197195

@@ -203,53 +201,37 @@ func (s *DockerTestSuite) FundWallet(ctx context.Context, wallet tastoratypes.Wa
203201
s.Require().NoError(err)
204202
}
205203

206-
// StartEvNode initializes and starts an Ev node.
207-
func (s *DockerTestSuite) StartEvNode(ctx context.Context, bridgeNode tastoratypes.DANode, evNode tastoratypes.RollkitNode) {
208-
err := evNode.Init(ctx)
209-
s.Require().NoError(err)
210-
211-
bridgeNodeHostName, err := bridgeNode.GetInternalHostName()
212-
s.Require().NoError(err)
213-
214-
authToken, err := bridgeNode.GetAuthToken()
215-
s.Require().NoError(err)
216-
217-
daAddress := fmt.Sprintf("http://%s:26658", bridgeNodeHostName)
218-
err = evNode.Start(ctx,
219-
"--rollkit.da.address", daAddress,
220-
"--rollkit.da.gas_price", "0.025",
221-
"--rollkit.da.auth_token", authToken,
222-
"--rollkit.rpc.address", "0.0.0.0:7331", // bind to 0.0.0.0 so rpc is reachable from test host.
223-
"--rollkit.da.namespace", generateValidNamespaceHex(),
224-
"--kv-endpoint", "0.0.0.0:8080",
225-
)
226-
s.Require().NoError(err)
204+
// StartEVNode initializes and starts an Ev node.
205+
func (s *DockerTestSuite) StartEVNode(ctx context.Context, bridgeNode *da.Node, evNode *evstack.Node) {
206+
s.StartEVNodeWithNamespace(ctx, bridgeNode, evNode, "ev-header", "ev-data")
227207
}
228208

229-
// StartRollkitNodeWithNamespace initializes and starts a Rollkit node with a specific namespace.
230-
func (s *DockerTestSuite) StartRollkitNodeWithNamespace(ctx context.Context, bridgeNode tastoratypes.DANode, rollkitNode tastoratypes.RollkitNode, namespace string) {
231-
err := rollkitNode.Init(ctx)
209+
// StartEVNodeWithNamespace initializes and starts an EV node with a specific namespace.
210+
func (s *DockerTestSuite) StartEVNodeWithNamespace(ctx context.Context, bridgeNode *da.Node, evNode *evstack.Node, headerNamespace, dataNamespace string) {
211+
err := evNode.Init(ctx)
232212
s.Require().NoError(err)
233213

234-
bridgeNodeHostName, err := bridgeNode.GetInternalHostName()
214+
bridgeNetworkInfo, err := bridgeNode.GetNetworkInfo(ctx)
235215
s.Require().NoError(err)
236216

237217
authToken, err := bridgeNode.GetAuthToken()
238218
s.Require().NoError(err)
239219

240-
daAddress := fmt.Sprintf("http://%s:26658", bridgeNodeHostName)
241-
err = rollkitNode.Start(ctx,
242-
"--rollkit.da.address", daAddress,
243-
"--rollkit.da.gas_price", "0.025",
244-
"--rollkit.da.auth_token", authToken,
245-
"--rollkit.rpc.address", "0.0.0.0:7331", // bind to 0.0.0.0 so rpc is reachable from test host.
246-
"--rollkit.da.namespace", namespace,
220+
bridgeRPCAddress := bridgeNetworkInfo.Internal.RPCAddress()
221+
daAddress := fmt.Sprintf("http://%s", bridgeRPCAddress)
222+
err = evNode.Start(ctx,
223+
"--evnode.da.address", daAddress,
224+
"--evnode.da.gas_price", "0.025",
225+
"--evnode.da.auth_token", authToken,
226+
"--evnode.rpc.address", "0.0.0.0:7331", // bind to 0.0.0.0 so rpc is reachable from test host.
227+
"--evnode.da.namespace", headerNamespace,
228+
"--evnode.da.data_namespace", dataNamespace,
247229
"--kv-endpoint", "0.0.0.0:8080",
248230
)
249231
s.Require().NoError(err)
250232
}
251233

252-
// getEvNodeImage returns the Docker image configuration for Rollkit
234+
// getEvNodeImage returns the Docker image configuration for EV Node
253235
// Uses EV_NODE_IMAGE_REPO and EV_NODE_IMAGE_TAG environment variables if set
254236
// Defaults to locally built image using a unique tag to avoid registry conflicts
255237
func getEvNodeImage() container.Image {

0 commit comments

Comments
 (0)