A decentralized protocol for indexing and querying data from DeMix contracts across all supported blockchains.
DeMix is a zero-knowledge DApp which allows a variety of Blockchain users to prove send & receive crypto currencies without revealing their original identity. At the same time, it allows users to collect their note without using a wallet with funds for gas (using relayers). It is designed to be a simple and useful privacy motivated DAPP for DecentraWorld's community and users. It's time to bring freedom to the people |
---|
version/0.0.1
. We will update this repo with the final versio as soon as DeMix is launched across all supported blockchains mentioned above, and we`re done testing & stressing the beta version of DeMix.
node v16.14.2(LTS)
yarn 1.22.18
npm install -g @graphprotocol/graph-cli@latest
- Sign up with
The Graph
- Add a
subgraph
under hosted service. - The name of each subgraph needs to match the name on the script
package.json
.
yarn install
yarn run generate-<blockchain_name_here>
E.g:yarn run generate-bsc
- replace
$TOKEN (line 52 in package.json)
with an access token yarn run deploy:demix-<blockchain_name_here>
E.g:yarn run deploy:demix-bsc
Or Deploy on all supported chains at the same time:yarn run deploy:all
Optional:yarn run lint
to fix code and implement prettier
The following is a list of our deployed subgraphs. Each subgraph.yaml
file can be used with a thegraph.com
hosted service. It helps our smart contracts to verify notes on the blockchain even when there is many transactions to look through.
Chain ID | Subgraph | Status |
---|---|---|
97 | Testnet-DeMix-Subgraph | Deployed |
1 | Mainnet-DeMix-Subgraph | Undeployed |
56 | BSC-DeMix-Subgraph | Undeployed |
43114 | Avalanche-DeMix-Subgraph | Undeployed |
250 | Fantom-DeMix-Subgraph | Undeployed |
137 | Matic-DeMix-Subgraph | Undeployed |
25 | Cronos-DeMix-Subgraph | Undeployed |
42161 | Arbitrum-DeMix-Subgraph | Undeployed |
10 | Optimism-DeMix-Subgraph | Undeployed |
100 | xDai-DeMix-Subgraph | Undeployed |
5 | Goerli-DeMix-Subgraph | Undeployed |
...
We encourage everyone to use subgraphs for complicated indexing on the blockchain. If you would like to use this repo for your own code, make sure to adjust the following files.
Example subgraph by The Graph: @graphprotocol/example-subgraph
- The schema file
schema.graphql
needs to match your contract`s query and indexing needs. - Create a new
subgraph.yaml
file in the/subgraphs/subgraph.yaml
folder, and name it as you wish. You can use existing .yaml files as a referance, or thecreate-yaml-file.js
file as a .yaml generator script. - Adjust mapping
.ts
files according to your needs, I'd suggest to follow TheGraph's documentation to learn how to initiate, build, and deploy your subgraphs properly. Always run theyarn deploy
command above again to deploy the updated version of your subgraph. Mappings are AssemblyScript code called whenever the Graph Node finds an event or a call specified in the manifest. - In the mustache folder you will find templates to DeMix's subgraph, as we use multiple blockchain this makes the deployment process of each subgraph much easier. You can adjust the templates according to your need. The
yaml.mustache
file contains theschema.graphql
template, that will need to watch the indexing schema that you need. - The
abis
folder contains abis of each contract that is needed for DeMix's indexing. Change the current files with the abi files of your contracts that will be indexed. These ABI files are being pulled by thesubgraph.yaml
file that is used to deploy your subgraph. - The scripts in
package.json
are made to make the build & deployment process easy. Simply add/adjust thegenerate
,yaml
,codegen
,build
, anddeploy
scripts according to your newsubgraph.yaml
file name and other changes.