-
-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
179 changed files
with
5,053 additions
and
2,767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Subgraphs deployment | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
SUBGRAPH_DEPLOY_KEY: | ||
required: true | ||
|
||
jobs: | ||
coverage: | ||
name: Redeploy all existing subgraphs | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
BUILDKIT_PROGRESS: plain | ||
BLOCKTIME: 0 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Deploying the subgraphs | ||
run: cd subgraph && yarn deploy-all | ||
shell: bash | ||
env: | ||
SUBGRAPH_DEPLOY_KEY: ${{ secrets.SUBGRAPH_DEPLOY_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
version: '3.2' | ||
services: | ||
graph-node: | ||
image: graphprotocol/graph-node:v0.27.0 | ||
image: graphprotocol/graph-node:v0.28.2 | ||
ports: | ||
- '8000:8000' | ||
- '8001:8001' | ||
- '8020:8020' | ||
|
||
ipfs: | ||
image: ipfs/kubo:v0.15.0 | ||
image: ipfs/kubo:v0.16.0 | ||
ports: | ||
- '5001:5001' | ||
|
||
postgres: | ||
image: postgres:14.5 | ||
image: postgres:15.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { notifyNewKeysToWedlocks } from '../src/operations/wedlocksOperations' | ||
import { SubgraphService } from '@unlock-protocol/unlock-js' | ||
import yargs from 'yargs' | ||
|
||
const argv = yargs | ||
.option('network', { | ||
requiresArg: true, | ||
type: 'number', | ||
alias: 'n', | ||
description: 'Network ID of the network', | ||
}) | ||
.option('lockAddress', { | ||
requiresArg: true, | ||
type: 'string', | ||
alias: 'l', | ||
description: 'Lock Address to use.', | ||
}) | ||
.help() | ||
.alias('h', 'help') | ||
.example( | ||
'yarn ts-node scripts/send_email.ts --network 5 --lockAddress xyz', | ||
'send emails to all users on goerli on xyz lock address.' | ||
).argv | ||
|
||
interface Options { | ||
lockAddress: string | ||
network: number | ||
} | ||
|
||
async function run({ lockAddress, network }: Options) { | ||
const service = new SubgraphService() | ||
const keys = await service.keys( | ||
{ | ||
first: 1000, | ||
where: { | ||
lock_in: [lockAddress.toLowerCase()], | ||
}, | ||
}, | ||
{ | ||
networks: [network.toString()], | ||
} | ||
) | ||
await notifyNewKeysToWedlocks(keys, network) | ||
return keys | ||
} | ||
|
||
if (argv.lockAddress && argv.network) { | ||
run({ | ||
lockAddress: argv.lockAddress, | ||
network: argv.network, | ||
}) | ||
.then((keys) => { | ||
console.log( | ||
`Successfully sent emails to recipients associated with ${keys.length} keys.` | ||
) | ||
}) | ||
.catch(console.error) | ||
} else { | ||
console.log(argv) | ||
} |
Oops, something went wrong.