diff --git a/.changeset/beige-houses-shout.md b/.changeset/beige-houses-shout.md new file mode 100644 index 0000000..1debf47 --- /dev/null +++ b/.changeset/beige-houses-shout.md @@ -0,0 +1,5 @@ +--- +'uhttp-exit-app': patch +--- + +Log domain no quota reporting diff --git a/package.json b/package.json index 1c35b12..cb9f197 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "typescript": "^5.4.5" }, "dependencies": { - "@hoprnet/uhttp-lib": "^3.0.2", + "@hoprnet/uhttp-lib": "^3.3.0", "debug": "^4.3.4", "sqlite3": "^5.1.7", "ws": "^8.18.0" diff --git a/src/index.ts b/src/index.ts index 99d88b6..82e1d6f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -545,12 +545,16 @@ async function reportToDiscoveryPlatform({ }) { const lastReqSeg = cacheEntry.segments.get(cacheEntry.count - 1) as Segment.Segment; const rpcMethod = determineRPCmethod(reqPayload.body); + const url = new URL(reqPayload.endpoint); + const domain = url.hostname; + const quotaRequest: DpApi.QuotaParams = { clientId: reqPayload.clientId, rpcMethod, segmentCount: cacheEntry.count, lastSegmentLength: lastReqSeg.body.length, chainId: reqPayload.chainId, + domain, type: 'request', }; @@ -561,6 +565,7 @@ async function reportToDiscoveryPlatform({ segmentCount: segments.length, lastSegmentLength: lastRespSeg.body.length, chainId: reqPayload.chainId, + domain, type: 'response', }; diff --git a/yarn.lock b/yarn.lock index 092206a..9907651 100644 --- a/yarn.lock +++ b/yarn.lock @@ -573,10 +573,10 @@ "@noble/curves" "^1.3.0" "@noble/hashes" "^1.3.3" -"@hoprnet/uhttp-lib@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@hoprnet/uhttp-lib/-/uhttp-lib-3.0.2.tgz#5ad0f5fd0771cb1b1ff895d23fe3c5678c5a1b43" - integrity sha512-J2LDSH0Fu7DlH/e3Iv1NKW9JTb7Y7xXD1LxkuHI9hyDm3cePSG3g1f6DR1p+rJLldRFgVqnuJENOaz/kRPmx6g== +"@hoprnet/uhttp-lib@^3.3.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@hoprnet/uhttp-lib/-/uhttp-lib-3.3.0.tgz#11ab38f3da1bd6dca6ecc93e19e582fc827ab313" + integrity sha512-oFw+eCSO2uyaCmp48JazzyilPSZ8Z2SW7JAoq40YpKbiilG7rqWW+sdVWHegjqdN2RNJJnNFonXT+7UWdE0mSw== dependencies: "@hoprnet/uhttp-crypto" "^1.0.1" debug "^4.3.4"