|
| 1 | +const fs = require("fs"); |
| 2 | + |
| 3 | +const configPath = process.env.DOTENV_CONFIG_PATH; |
| 4 | + |
| 5 | +if (fs.existsSync(configPath)) { |
| 6 | + console.log("Environment configuration:"); |
| 7 | + |
| 8 | + // Bitcoin HD keys with address funded during environment set-up. |
| 9 | + // Used to initialize Bitcoin wallets with funds. |
| 10 | + console.log("Bitcoin HD keys:"); |
| 11 | + console.log("1. ", process.env.BITCOIN_HD_KEY_0); |
| 12 | + console.log("2. ", process.env.BITCOIN_HD_KEY_1); |
| 13 | + |
| 14 | + // The URI of the regtest Bitcoin node created during environment set-up. |
| 15 | + // Used to initialize Bitcoin wallets connected to the correct local network. |
| 16 | + console.log("Bitcoin node P2P URI: ", process.env.BITCOIN_P2P_URI); |
| 17 | + |
| 18 | + // Ethereum private keys with address funded during environment set-up. |
| 19 | + // Used to initialize Ethereum wallets with funds. |
| 20 | + console.log("Ethereum private keys:"); |
| 21 | + console.log("1. ", process.env.ETHEREUM_KEY_0); |
| 22 | + console.log("2. ", process.env.ETHEREUM_KEY_1); |
| 23 | + |
| 24 | + // The URL for the HTTP API of the regtest Ethereum node created during environment set-up. |
| 25 | + // Used to initialize Ethereum wallets connected to the correct local network. |
| 26 | + console.log("Ethereum node HTTP URL: ", process.env.ETHEREUM_NODE_HTTP_URL); |
| 27 | + |
| 28 | + // The contract address of the ERC20 token deployed on the regtest network during environment set-up. |
| 29 | + // Used to identify the ERC20 token when performing swaps. |
| 30 | + console.log( |
| 31 | + "ERC20 token contract address: ", |
| 32 | + process.env.ERC20_CONTRACT_ADDRESS |
| 33 | + ); |
| 34 | + |
| 35 | + // HTTP API URLs for the instances of cnd created during environment set-up. |
| 36 | + // Used to interact with said instances of cnd. In particular, it allows for |
| 37 | + // instantiating `ComitClient`s when using `comit-sdk`. |
| 38 | + console.log("cnd HTTP API URLs:"); |
| 39 | + console.log("1. ", process.env.HTTP_URL_CND_0); |
| 40 | + console.log("2. ", process.env.HTTP_URL_CND_1); |
| 41 | +} else { |
| 42 | + console.log( |
| 43 | + "Could not find file %s. Did you run `yarn create comit-app start-env`?", |
| 44 | + configPath |
| 45 | + ); |
| 46 | +} |
0 commit comments