diff --git a/.gitignore b/.gitignore index 6d810a0..4e48527 100644 --- a/.gitignore +++ b/.gitignore @@ -65,5 +65,4 @@ build .idea .env -generated .DS_Store diff --git a/README.md b/README.md index 155f3eb..1c7ec92 100644 --- a/README.md +++ b/README.md @@ -205,15 +205,16 @@ To deploy the Ethereum Mainnet subgraph: Now navigate to this repository (tornado-subgraph) and run the following commands: ```bash -yarn +# Create all necessary files for subgraph deployment +yarn && yarn generate -yarn codegen:tornado-mainnet +# Deploy subgraph on Ethereum Mainnet +yarn deploy:tornado-mainnet +# Deploy subgraph on BNB Chain +yarn deploy:tornado-bsc -yarn build:tornado-mainnet - -npx graph create tornadocash/tornado-subgraph --node http://127.0.0.1:8020 - -npx graph deploy tornadocash/tornado-subgraph --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020/ subgraphs/tornado-subgraph-mainnet.yaml +# Can deploy all at once if you have all necessary node connections +yarn deploy:all ``` You might see some issues about non-existing directories like `build/` or `generated/` the first time you deploy the subgraph. If you do, simply create the directory and re-run the command that failed. diff --git a/generated/.gitignore b/generated/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/generated/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/package.json b/package.json index 61ba3a9..15b0d62 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "license": "UNLICENSED", "scripts": { "lint": "eslint .", + "generate": "yarn generate-bsc && yarn generate-xdai && yarn generate-matic && yarn generate-mainnet && yarn generate-goerli && yarn generate-avalanche && yarn generate-arbitrum && yarn generate-optimism", "generate-bsc": "yarn codegen:tornado-bsc && yarn build:tornado-bsc", "generate-xdai": "yarn codegen:tornado-xdai && yarn build:tornado-xdai", "generate-matic": "yarn codegen:tornado-matic && yarn build:tornado-matic", @@ -37,7 +38,8 @@ "build:tornado-avalanche": "graph build subgraphs/tornado-subgraph-avalanche.yaml", "build:tornado-arbitrum": "graph build subgraphs/tornado-subgraph-arbitrum.yaml", "build:tornado-optimism": "graph build subgraphs/tornado-subgraph-optimism.yaml", - "deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ --access-token $TOKEN", + "deploy": "graph deploy --node http://127.0.0.1:8020/ --ipfs http://127.0.0.1:5001/", + "deploy:all": "yarn deploy:tornado-bsc && yarn deploy:tornado-xdai && yarn deploy:tornado-matic && yarn deploy:tornado-mainnet && yarn deploy:tornado-avalanche && yarn deploy:tornado-arbitrum && yarn deploy:tornado-optimism", "deploy:tornado-bsc": "yarn deploy -- tornadocash/bsc-tornado-subgraph subgraphs/tornado-subgraph-bsc.yaml", "deploy:tornado-xdai": "yarn deploy -- tornadocash/xdai-tornado-subgraph subgraphs/tornado-subgraph-xdai.yaml", "deploy:tornado-matic": "yarn deploy -- tornadocash/matic-tornado-subgraph subgraphs/tornado-subgraph-matic.yaml",