feat: codegen for instance & proxy

This commit is contained in:
nikdementev 2021-06-09 17:20:37 +03:00 committed by 0xZick 地方分権化
parent 693e81fdff
commit 9289f456d9
5 changed files with 8 additions and 5 deletions

View File

@ -2,7 +2,7 @@ module.exports = {
yaml: [
{
specVersion: '0.0.2',
repository: 'https://github.com/Synthetixio/synthetix-subgraph',
repository: 'https://github.com/tornadocash/tornado-subgraph',
dataSourceKind: 'ethereum/contract',
mapping: {
kind: 'ethereum/events',

View File

@ -6,8 +6,9 @@ const Contracts = require('./contracts');
module.exports = {
createYaml: (env) => {
const createInstanceBlock = ({ name, startBlocks, address }) => ({
const createInstanceBlock = ({ name, network, startBlocks, address }) => ({
name,
network,
mappingFile: '../src/mapping-instance.ts',
startBlock: startBlocks.prod,
address,
@ -16,7 +17,7 @@ module.exports = {
abis: [
{
name: 'Instance',
file: '../abis/Instance.json'
path: '../abis/Instance.json'
}
],
events: [

View File

@ -1,4 +1,4 @@
module.exports = {
description: 'Instance',
schemaFile: './schema.graphql',
schemaFile: '../schema.graphql',
};

View File

@ -1,4 +1,4 @@
module.exports = {
description: 'Proxy',
schemaFile: './schema.graphql',
schemaFile: '../schema.graphql',
};

View File

@ -6,6 +6,8 @@
"build": "graph build",
"yaml:proxy": "node ./create-yaml-file create-yaml -s proxy -e bsc | mustache - mustache/yaml.mustache > subgraphs/proxy-tornado-subgraph.yaml",
"yaml:instance": "node ./create-yaml-file create-yaml -s instance -e bsc | mustache - mustache/yaml.mustache > subgraphs/instance-tornado-subgraph.yaml",
"codegen:proxy": "yarn yaml:proxy && yarn codegen -- subgraphs/proxy-tornado-subgraph.yaml",
"codegen:instance": "yarn yaml:instance && yarn codegen -- subgraphs/instance-tornado-subgraph.yaml",
"deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ tornadocash/bsc-tornado-subgraph"
},
"dependencies": {