Skip to content

Commit

Permalink
Replace tracker with @ensdomains/server-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
makoto committed Jan 25, 2024
1 parent fd1eed5 commit c6ac180
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 242 deletions.
1 change: 1 addition & 0 deletions arb-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@chainlink/ccip-read-server": "^0.2.1",
"@cloudflare/workers-types": "^4.20240117.0",
"@ensdomains/evm-gateway": "^0.1.0",
"@ensdomains/server-analytics": "0.0.1-alpha.2",
"@ethereumjs/block": "^5.0.0",
"@nomicfoundation/ethereumjs-block": "^5.0.2",
"commander": "^11.0.0",
Expand Down
117 changes: 0 additions & 117 deletions arb-gateway/src/tracker.ts

This file was deleted.

9 changes: 3 additions & 6 deletions arb-gateway/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { Request as CFWRequest } from '@cloudflare/workers-types';
import { Server } from '@ensdomains/ccip-read-cf-worker';
import type { Router } from '@ensdomains/evm-gateway';
import { InMemoryBlockCache } from './blockCache/InMemoryBlockCache.js';
// Importing this Tracker throws `✘ [ERROR] A request to the Cloudflare API (/accounts/**/workers/scripts/arb-sepolia-gateway-worker) failed.` error
import { Tracker } from '@ensdomains/evm-gateway';
// Importing this Tracker works
// import { Tracker } from './tracker.js';
import { Tracker } from '@ensdomains/server-analytics';
interface Env {
L1_PROVIDER_URL: string;
L2_PROVIDER_URL: string;
Expand All @@ -30,8 +27,8 @@ const logResult = async (
const logResult:any = await new Response(streamForLog).json();
const logResultData = logResult.data.substring(0, 200);
await tracker.trackEvent(
'result',
request,
'result',
{ props: { result: logResultData } },
true
);
Expand Down Expand Up @@ -67,7 +64,7 @@ async function fetch(request: CFWRequest, env: Env) {
app = server.makeApp('/');
}
await tracker.trackEvent(
'request', request,{},true
request, 'request',{},true
);

return app.handle(request).then(logResult.bind(null, request));
Expand Down
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion evm-gateway/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export { EVMGateway, StorageLayout } from './EVMGateway.js';
export { EVMProofHelper, type StateProof } from './EVMProofHelper.js';
export type { IProofService, ProvableBlock } from './IProofService.js';
export { Tracker } from './tracker.js';
export type { Router } from './utils.js';
117 changes: 0 additions & 117 deletions evm-gateway/src/tracker.ts

This file was deleted.

1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"ES2022", // By using ES2022 we get access to the `.cause` property on `Error` instances.
"DOM" // For `btoa` and `atob`.
],
"types": ["@cloudflare/workers-types"],
// Skip type checking for node modules
"skipLibCheck": true
}
Expand Down

0 comments on commit c6ac180

Please sign in to comment.