Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tsachiherman committed Sep 6, 2024
1 parent 2909538 commit dec668f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
8 changes: 5 additions & 3 deletions tests/antithesis/avalanchego/gencomposeconfig/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ import (
"log"

"github.com/ava-labs/avalanchego/tests/antithesis"
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
)

const baseImageName = "antithesis-avalanchego"
const (
baseImageName = "antithesis-avalanchego"
NumNodes = 6
)

// Creates docker-compose.yml and its associated volumes in the target path.
func main() {
network := tmpnet.LocalNetworkOrPanic()
network := antithesis.CreateNetwork(NumNodes)
if err := antithesis.GenerateComposeConfig(network, baseImageName, "" /* runtimePluginDir */); err != nil {
log.Fatalf("failed to generate compose config: %v", err)
}
Expand Down
15 changes: 15 additions & 0 deletions tests/antithesis/network.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package antithesis

import (
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
)

// Creates a network with the given number of nodes.
func CreateNetwork(nodesCount int) *tmpnet.Network {
network := tmpnet.NewDefaultNetwork("antithesis-network")
network.Nodes = tmpnet.NewNodesOrPanic(nodesCount)
return network
}
7 changes: 5 additions & 2 deletions tests/antithesis/xsvm/gencomposeconfig/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ import (
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
)

const baseImageName = "antithesis-xsvm"
const (
baseImageName = "antithesis-xsvm"
NumNodes = 6
)

// Creates docker-compose.yml and its associated volumes in the target path.
func main() {
network := tmpnet.LocalNetworkOrPanic()
network := antithesis.CreateNetwork(NumNodes)
network.Subnets = []*tmpnet.Subnet{
subnet.NewXSVMOrPanic("xsvm", genesis.VMRQKey, network.Nodes...),
}
Expand Down

0 comments on commit dec668f

Please sign in to comment.