diff --git a/indexer/docker-compose.yml b/indexer/docker-compose.yml index 1d7018fb..1ccbe8b6 100644 --- a/indexer/docker-compose.yml +++ b/indexer/docker-compose.yml @@ -23,6 +23,11 @@ services: - --address=0.0.0.0:7171 environment: - XDG_DATA_HOME=/data + - APIBARA_STREAM_URL=http://art-peace-apibara-1:7171 + - TARGET_URL=http://art-peace-backend-1:8080/consumeIndexerMsg + - LOCALHOST_STREAM_URL=http://localhost:7171 + - LOCALHOST_TARGET_URL=http://localhost:8080/consumeIndexerMsg + volumes: - dna:/data ports: diff --git a/indexer/docker-script.js b/indexer/docker-script.js index 017ac4c4..90828993 100644 --- a/indexer/docker-script.js +++ b/indexer/docker-script.js @@ -1,5 +1,6 @@ export const config = { - streamUrl: "http://art-peace-apibara-1:7171", + streamUrl: + Deno.env.get("APIBARA_STREAM_URL") || Deno.env.get("LOCALHOST_STREAM_URL"), startingBlock: 0, network: "starknet", finality: "DATA_STATUS_PENDING", @@ -7,7 +8,9 @@ export const config = { events: [ { fromAddress: Deno.env.get("ART_PEACE_CONTRACT_ADDRESS"), - keys: ["0x2D7B50EBF415606D77C7E7842546FC13F8ACFBFD16F7BCF2BC2D08F54114C23"], + keys: [ + "0x2D7B50EBF415606D77C7E7842546FC13F8ACFBFD16F7BCF2BC2D08F54114C23", + ], includeReverted: false, includeTransaction: false, includeReceipt: false, @@ -16,7 +19,8 @@ export const config = { }, sinkType: "webhook", sinkOptions: { - targetUrl: "http://art-peace-backend-1:8080/consumeIndexerMsg" + targetUrl: + Deno.env.get("SINK_TARGET_URL") || Deno.env.get("LOCALHOST_TARGET_URL"), }, }; diff --git a/indexer/script.js b/indexer/script.js deleted file mode 100644 index c0c0b29b..00000000 --- a/indexer/script.js +++ /dev/null @@ -1,26 +0,0 @@ -export const config = { - streamUrl: "http://localhost:7171", - startingBlock: 0, - network: "starknet", - finality: "DATA_STATUS_PENDING", - filter: { - events: [ - { - fromAddress: Deno.env.get("ART_PEACE_CONTRACT_ADDRESS"), - keys: ["0x2D7B50EBF415606D77C7E7842546FC13F8ACFBFD16F7BCF2BC2D08F54114C23"], - includeReverted: false, - includeTransaction: false, - includeReceipt: false, - }, - ], - }, - sinkType: "webhook", - sinkOptions: { - targetUrl: "http://localhost:8080/consumeIndexerMsg" - }, -}; - -// This transform does nothing. -export default function transform(block) { - return block; -}