diff --git a/packages/pusher/README.md b/packages/pusher/README.md index 096487e0..616947b0 100644 --- a/packages/pusher/README.md +++ b/packages/pusher/README.md @@ -21,7 +21,13 @@ The pusher needs a configuration in order to run. The `config` folder contains e To start the the pusher in dev mode run the following: 1. `cp pusher.example.json pusher.json` - To copy the pusher configuration from the example. Note, the `pusher.json` - file is ignored by git. + file is ignored by git. If you are using Docker Desktop, you need to change the URL from localhost to + `host.docker.internal`. For example: + + ```jsonc + "url": "http://host.docker.internal:8090" + ``` + 2. `cp secrets.example.env secrets.env` - To copy the secrets.env needed for the configuration. This file is also ignored by git. 3. Set the `NODARY_API_KEY` inside the secrets file. Ask someone from development team for the key. diff --git a/packages/pusher/src/api-requests/signed-api.ts b/packages/pusher/src/api-requests/signed-api.ts index cbd03521..7605a013 100644 --- a/packages/pusher/src/api-requests/signed-api.ts +++ b/packages/pusher/src/api-requests/signed-api.ts @@ -15,9 +15,6 @@ export const postSignedApiData = async (group: SignedApiNameUpdateDelayGroup) => } = getState(); const { signedApiName, templateIds, updateDelay } = group; const logContext = { signedApiName, updateDelay }; - logger.debug('Posting signed API data.', { group, ...logContext }); - - const provider = signedApis.find((a) => a.name === signedApiName)!; const airnode = ethers.Wallet.fromMnemonic(airnodeWalletMnemonic).address; const batchPayloadOrNull = templateIds.map((templateId): SignedApiPayload | null => { @@ -36,6 +33,9 @@ export const postSignedApiData = async (group: SignedApiNameUpdateDelayGroup) => logger.debug('No batch payload found to post. Skipping.', logContext); return { success: true, count: 0 }; } + + logger.debug('Posting signed API data.', { group, ...logContext }); + const provider = signedApis.find((a) => a.name === signedApiName)!; const goAxiosRequest = await go, AxiosError>(async () => { logger.debug('Posting batch payload.', { ...logContext, batchPayload }); const axiosResponse = await axios.post(provider.url, batchPayload, { @@ -50,7 +50,7 @@ export const postSignedApiData = async (group: SignedApiNameUpdateDelayGroup) => logger.warn( `Failed to make update signed API request.`, // See: https://axios-http.com/docs/handling_errors - { ...logContext, axiosResponse: goAxiosRequest.error.response } + { ...logContext, error: goAxiosRequest.error.response ?? goAxiosRequest.error } ); return { success: false }; }