Skip to content

Commit

Permalink
Update subsquid/src/processor.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
andor0 committed Jun 10, 2022
1 parent 24613b0 commit 0305c67
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ After=network.target
[Service]
ExecStart=node -r dotenv/config lib/processor.js

Environment="ENV=dali"
WorkingDirectory={{ work_dir }}/subsquid
StandardOutput=syslog
StandardError=syslog
Expand Down
21 changes: 17 additions & 4 deletions subsquid/src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,25 @@ import {

const processor = new SubstrateProcessor("composable_dali_dev");

const chain = (): string => {
switch(process.env.ENV) {
case 'dali':
return 'wss://dali.devnets.composablefinance.ninja/parachain/alice'
default:
return 'ws://localhost:9997'
}
};

const chain_connection_string = chain();
const archive_connection_string = 'http://localhost:8080/v1/graphql';

console.log(`Chain ${chain_connection_string}`);
console.log(`Archive ${archive_connection_string}`);

processor.setBatchSize(500);
processor.setDataSource({
archive: `http://localhost:8080/v1/graphql`,
// archive: `http://localhost:4010/v1/graphql`,
chain: "ws://localhost:9997",
// chain: "wss://dali.devnets.composablefinance.ninja/parachain/alice",
archive: archive_connection_string,
chain: chain_connection_string,
});

processor.addEventHandler('pablo.PoolCreated', async (ctx) => {
Expand Down

0 comments on commit 0305c67

Please sign in to comment.