@@ -96,7 +96,10 @@ func initComposeConfig(
96
96
targetPath string ,
97
97
) error {
98
98
// Generate a compose project for the specified network
99
- project := newComposeProject (network , nodeImageName , workloadImageName )
99
+ project , err := newComposeProject (network , nodeImageName , workloadImageName )
100
+ if err != nil {
101
+ return err
102
+ }
100
103
101
104
absPath , err := filepath .Abs (targetPath )
102
105
if err != nil {
@@ -131,7 +134,7 @@ func initComposeConfig(
131
134
132
135
// Create a new docker compose project for an antithesis test setup
133
136
// for the provided network configuration.
134
- func newComposeProject (network * tmpnet.Network , nodeImageName string , workloadImageName string ) * types.Project {
137
+ func newComposeProject (network * tmpnet.Network , nodeImageName string , workloadImageName string ) ( * types.Project , error ) {
135
138
networkName := "avalanche-testnet"
136
139
baseNetworkAddress := "10.0.20"
137
140
@@ -141,6 +144,20 @@ func newComposeProject(network *tmpnet.Network, nodeImageName string, workloadIm
141
144
bootstrapIP string
142
145
bootstrapIDs string
143
146
)
147
+
148
+ if network .PrimaryChainConfigs == nil {
149
+ network .PrimaryChainConfigs = make (map [string ]tmpnet.ConfigMap )
150
+ }
151
+ if network .PrimaryChainConfigs ["C" ] == nil {
152
+ network .PrimaryChainConfigs ["C" ] = make (tmpnet.ConfigMap )
153
+ }
154
+ network .PrimaryChainConfigs ["C" ]["log-json-format" ] = true
155
+
156
+ chainConfigContent , err := network .GetChainConfigContent ()
157
+ if err != nil {
158
+ return nil , fmt .Errorf ("failed to get chain config content: %w" , err )
159
+ }
160
+
144
161
for i , node := range network .Nodes {
145
162
address := fmt .Sprintf ("%s.%d" , baseNetworkAddress , 3 + i )
146
163
@@ -158,6 +175,7 @@ func newComposeProject(network *tmpnet.Network, nodeImageName string, workloadIm
158
175
config .StakingTLSKeyContentKey : tlsKey ,
159
176
config .StakingCertContentKey : tlsCert ,
160
177
config .StakingSignerKeyContentKey : signerKey ,
178
+ config .ChainConfigContentKey : chainConfigContent ,
161
179
}
162
180
163
181
// Apply configuration appropriate to a test network
@@ -259,7 +277,7 @@ func newComposeProject(network *tmpnet.Network, nodeImageName string, workloadIm
259
277
},
260
278
},
261
279
Services : services ,
262
- }
280
+ }, nil
263
281
}
264
282
265
283
// Convert a mapping of avalanche config keys to a mapping of env vars
0 commit comments