@@ -3,6 +3,8 @@ package billing_platform_service
33import (
44 "context"
55 "fmt"
6+ "os"
7+ "strings"
68 "time"
79
810 "github.com/docker/docker/client"
@@ -90,7 +92,46 @@ func New(in *Input) (*Output, error) {
9092 ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Minute )
9193 defer cancel ()
9294
93- upErr := stack .Up (ctx )
95+ // Start the stackwith all environment variables from the host process
96+ // set development defaults for necessary environment variables and allow them to be overridden by the host process
97+ envVars := make (map [string ]string )
98+
99+ envVars ["MAINNET_WORKFLOW_REGISTRY_CHAIN_SELECTOR" ] = "7759470850252068959" // Anvil Devnet
100+ envVars ["MAINNET_WORKFLOW_REGISTRY_CONTRACT_ADDRESS" ] = "0xA15BB66138824a1c7167f5E85b957d04Dd34E468" // Deployed via Linking integration tests
101+ envVars ["MAINNET_WORKFLOW_REGISTRY_RPC_URL" ] = "http://anvil:8545" // Anvil inside Docker
102+ envVars ["MAINNET_WORKFLOW_REGISTRY_FINALITY_DEPTH" ] = "0" // Instant finality on devnet
103+ envVars ["TESTNET_WORKFLOW_REGISTRY_CHAIN_SELECTOR" ] = "10344971235874465080" // Base Sepolia
104+ envVars ["TESTNET_WORKFLOW_REGISTRY_CONTRACT_ADDRESS" ] = "0xED1D0d87706a466151d67A6a06d69534C97BE66F" // Used for Billing integration tests
105+ envVars ["TESTNET_WORKFLOW_REGISTRY_RPC_URL" ] = "http://anvil:8545" // Anvil inside Docker
106+ envVars ["TESTNET_WORKFLOW_REGISTRY_FINALITY_DEPTH" ] = "10" // Arbitrary value, adjust as needed
107+ envVars ["KMS_PROOF_SIGNING_KEY_ID" ] = "00000000-0000-0000-0000-000000000001" // provisioned via LocalStack
108+ envVars ["VERIFIER_INITIAL_INTERVAL" ] = "0s" // reduced to force verifier to start immediately in integration tests
109+ envVars ["VERIFIER_MAXIMUM_INTERVAL" ] = "1s" // reduced to force verifier to start immediately in integration tests
110+ envVars ["LINKING_REQUEST_COOLDOWN" ] = "0s" // reduced to force consequtive linking requests to be processed immediately in integration tests
111+
112+ envVars ["MAINNET_CAPABILITIES_REGISTRY_CHAIN_SELECTOR" ] = "10344971235874465080" // Base Sepolia
113+ envVars ["MAINNET_CAPABILITIES_REGISTRY_CONTRACT_ADDRESS" ] = "0x4c0a7d8f1b2e3c5f6a9b8e2d3c4f5e6b7a8b9c0d" // dummy address
114+ envVars ["MAINNET_CAPABILITIES_REGISTRY_RPC_URL" ] = "http://anvil:8545" // Anvil RPC URL
115+ envVars ["MAINNET_CAPABILITIES_REGISTRY_FINALITY_DEPTH" ] = "10" // Arbitrary value, adjust as needed
116+ envVars ["TESTNET_CAPABILITIES_REGISTRY_CHAIN_SELECTOR" ] = "10344971235874465080" // Base Sepolia
117+ envVars ["TESTNET_CAPABILITIES_REGISTRY_CONTRACT_ADDRESS" ] = "0x4c0a7d8f1b2e3c5f6a9b8e2d3c4f5e6b7a8b9c0d" // dummy address
118+ envVars ["TESTNET_CAPABILITIES_REGISTRY_RPC_URL" ] = "http://anvil:8545" // Anvil RPC URL
119+ envVars ["TESTNET_CAPABILITIES_REGISTRY_FINALITY_DEPTH" ] = "10" // Arbitrary value, adjust as needed
120+
121+ envVars ["STREAMS_API_URL" ] = ""
122+ envVars ["STREAMS_API_KEY" ] = ""
123+ envVars ["STREAMS_API_SECRET" ] = ""
124+
125+ for _ , env := range os .Environ () {
126+ pair := strings .SplitN (env , "=" , 2 )
127+ if len (pair ) == 2 {
128+ envVars [pair [0 ]] = pair [1 ]
129+ }
130+ }
131+
132+ upErr := stack .
133+ WithEnv (envVars ).
134+ Up (ctx )
94135
95136 if upErr != nil {
96137 return nil , errors .Wrap (upErr , "failed to start stack for Billing Platform Service" )
0 commit comments