Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion indexer/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DATABASE_URL="file:./dev.db"
# DATABASE_URL="file:./dev.db"
DATABASE_URL="postgresql://postgres:cWiSgoSVm8I6tkkEqfbh@containers-us-west-48.railway.app:5958/railway"
NODE_ENV="development"
MUMBAI_RPC_PROVIDER="https://polygon-mumbai.g.alchemy.com/v2/nwCEWjd7yikmP8BLQGEv7J89qEj2FnIg"
API_ENDPOINT="http://localhost:3000/api/webhooks/indexerWebhooks/"
Expand Down
8 changes: 4 additions & 4 deletions indexer/src/client/generate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const config = {
"value": "prisma-client-js"
},
"output": {
"value": "/Users/alex/Desktop/disrup3/fromme/indexer/src/client/generate",
"value": "C:\\Users\\Fuet\\OneDrive\\Desktop\\disrup3_repo\\sprint2\\fromme\\indexer\\src\\client\\generate",
"fromEnvVar": null
},
"config": {
Expand All @@ -135,7 +135,7 @@ const config = {
"binaryTargets": [
{
"fromEnvVar": null,
"value": "darwin-arm64",
"value": "windows",
"native": true
}
],
Expand Down Expand Up @@ -183,7 +183,7 @@ const PrismaClient = getPrismaClient(config)
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)

path.join(__dirname, "libquery_engine-darwin-arm64.dylib.node");
path.join(process.cwd(), "src/client/generate/libquery_engine-darwin-arm64.dylib.node")
path.join(__dirname, "query_engine-windows.dll.node");
path.join(process.cwd(), "src/client/generate/query_engine-windows.dll.node")
path.join(__dirname, "schema.prisma");
path.join(process.cwd(), "src/client/generate/schema.prisma")
9 changes: 6 additions & 3 deletions indexer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const connect = async () => {

const trackContractCallback = async () => {
const lastBlocks = await prisma.tracker_State.findMany();
await processFactoryTrackerEvents(lastBlocks[0].lastBlockProcessed, prisma);
await processNftMarketplaceEvents(lastBlocks[0].lastBlockProcessed, prisma);
// await processFactoryTrackerEvents(lastBlocks[0].lastBlockProcessed, prisma);
// await processNftMarketplaceEvents(lastBlocks[0].lastBlockProcessed, prisma);
await processDeadEvents();
setTimeout(() => trackContractCallback(), 2000); // Recursividad de trackeo
};
Expand All @@ -34,7 +34,10 @@ const connect = async () => {

const processDeadEvents = async () => {
// checkear si hay eventos muertos
const deadEvents = await prisma.dead_events_queue.findMany();
const deadEventsOriginal = await prisma.dead_events_queue.findMany();

const deadEvents = deadEventsOriginal.slice(7,8)
console.log(deadEvents)

if(!deadEvents.length) return console.log("No hay que recuperar");
// de ser asi, llamar a callApi con esos datos
Expand Down
6 changes: 3 additions & 3 deletions indexer/src/utils/apiUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import axios from "axios";

export const callApi = async (endpoint: string, data: any, isDead = false) => {
try {
console.log("endpoint:", endpoint);
const x =await axios.post(`${process.env.API_ENDPOINT}${endpoint}`, data);
console.log(x.data)
console.log("endpoint:", endpoint, ' : ', `${process.env.API_ENDPOINT}${endpoint}`);
const x = await axios.post(`${process.env.API_ENDPOINT}${endpoint}`, data);
console.log('DATA :: ', x.data)
console.log("callapi success");
return true
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion t3/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""

# Contract address
NFT_FACTORY = "0xBB645BdAFD93Ca5D91B457709e55C0318a6f5449" # No need to delete from .env.example
NEXT_PUBLIC_NFT_STORAGE_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDY4ZGUxM2E5OUE0YTkyRDdEMTFDNDMxQ0IzNDc2NDZBOWJCZkRCMzQiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY4Njc3MjAwNjM4OCwibmFtZSI6ImZyb21tZS1kZXYifQ.C-6OrEBBh64q1IowVo_bfRphCq5qo388DMwEcoyfyjg

# URL Provider
NEXT_PUBLIC_URL_MUMBAI=""

# Private keys
NEXT_PUBLIC_PRIVATE_KEY=""

NEXTAUTH_SECRET='Required'
2 changes: 1 addition & 1 deletion t3/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ await import("./src/env.mjs");
/** @type {import("next").NextConfig} */
const config = {
images: {
domains: ["ipfs.io"],
domains: ["ipfs.io", "encrypted-tbn0.gstatic.com"],
},
reactStrictMode: true,
webpack: (config) => {
Expand Down
Loading