()
| 3 | import { isMacOrWindows, readIntegrationInfo, runAndHandleErrors } from '../'; |
| 4 | |
| 5 | const main = async () => { |
| 6 | const integrationInfo = readIntegrationInfo(); |
| 7 | // Import the "create-secrets" file from the chosen integration. See the respective "create-secrets.ts" file for |
| 8 | // details. |
| 9 | const createSecrets = await import(`../../integrations/${integrationInfo.integration}/create-secrets.ts`); |
| 10 | await createSecrets.default(); |
| 11 | |
| 12 | // Windows and MacOS docker users need to change the provider URL if running airnode client on localhost network. See: |
| 13 | // https://stackoverflow.com/a/24326540 for more information. |
| 14 | if (integrationInfo.network === 'localhost' && integrationInfo.airnodeType === 'local' && isMacOrWindows()) { |
| 15 | const secretsPath = join(__dirname, `../../integrations/`, integrationInfo.integration, `secrets.env`); |
| 16 | const rawSecrets = readFileSync(secretsPath).toString(); |
| 17 | writeFileSync( |
| 18 | secretsPath, |
| 19 | rawSecrets |
| 20 | .replace('PROVIDER_URL=http://127.0.0.1:8545/', 'PROVIDER_URL=http://host.docker.internal:8545') |
| 21 | .replace( |
| 22 | 'CROSS_CHAIN_PROVIDER_URL=http://127.0.0.1:8545/', |
| 23 | 'CROSS_CHAIN_PROVIDER_URL=http://host.docker.internal:8545' |
| 24 | ) |
| 25 | ); |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | runAndHandleErrors(main); |
nothing calls this directly
no test coverage detected