/ examples / mongo / ekubo_to_mongo.ts
ekubo_to_mongo.ts
 1  // Before running this script, you must start a local MongoDB server.
 2  // See README.md for instructions.
 3  import { updateNftOwner, filter } from "../common/ekubo.ts";
 4  
 5  // Configure indexer for streaming Starknet Goerli data starting at the specified block.
 6  export const config = {
 7    streamUrl: "https://goerli.starknet.a5a.ch",
 8    startingBlock: 835_000,
 9    network: "starknet",
10    filter,
11    sinkType: "mongo",
12    sinkOptions: {
13      database: "example",
14      collectionName: "owners",
15      entityMode: true,
16    },
17  };
18  
19  // Transform each block using the function defined in ekubo.ts.
20  export default updateNftOwner;
21