Skip to content

Commit 081139c

Browse files
authored
Log API data only for base feed beacons (#432)
* Log API data only for base feed beacons * Update README
1 parent feb36ec commit 081139c

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

packages/signed-api/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ The API provides the following endpoints:
4848
step.
4949
- `GET /{endpoint-name}/{airnode}`: Retrieve signed data for the Airnode respecting the endpoint configuration.
5050
- Returns the freshest signed data available for the given Airnode, respecting the configured endpoint delay.
51-
- `GET /`: Retrieve list of all available Airnode address.
51+
- `GET /airnodes`: Retrieve list of all available Airnode address.
5252
- Returns all Airnode addresses for which there is signed data. It is possible that this data cannot be shown by the
5353
delayed endpoints (in case the data is too fresh and there is not an older alternative).
54+
- `GET /`: Retrieve system status information.
55+
- Returns current system configuration details including deployment stage, version, current timestamp, deployment
56+
timestamp, configuration hash, and certified Airnode addresses.
5457

5558
## Deployment
5659

@@ -117,6 +120,10 @@ curl --location 'http://localhost:8090/real-time/0xc52EeA00154B4fF1EbbF8Ba39FDe3
117120
--header 'Content-Type: application/json'
118121

119122
# List available airnode addresses (HTTP GET)
120-
curl --location 'http://localhost:8090' \
123+
curl --location 'http://localhost:8090/airnodes' \
124+
--header 'Content-Type: application/json'
125+
126+
# Get system status (HTTP GET)
127+
curl --location 'http://localhost:8090/' \
121128
--header 'Content-Type: application/json'
122129
```

packages/signed-api/src/handlers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ export const batchInsertData = async (
113113

114114
const env = loadEnv();
115115
if (env.LOG_API_DATA) {
116-
// Log only the required fields to use less space, do not log the signature for security reasons.
117-
const sanitizedData = batchSignedData.map((data) =>
118-
pick(data, ['airnode', 'encodedValue', 'templateId', 'timestamp'])
119-
);
116+
// Log data for base feed beacons, including only the required fields to save space. For security reasons, do not log the signature.
117+
const sanitizedData = batchSignedData
118+
.filter(({ isOevBeacon }) => !isOevBeacon)
119+
.map((data) => pick(data, ['airnode', 'encodedValue', 'templateId', 'timestamp']));
120120
logger.info('Received valid signed data.', { data: sanitizedData });
121121
}
122122

0 commit comments

Comments
 (0)