Skip to main content

What you’ll need

Tip: USDC launched on Ethereum in Sept 2018; you can confirm addresses per chain in Circle’s docs if you ever target other networks.

Getting started

  1. Go to the Ormi App and login.
  2. From the dashboard, create an API key for deployments.
0xGraph API Keys
Keep this page open, we’ll need the API key to deploy a subgraph.

Running the subgraph CLI

Open your terminal and run The Graph CLI init flow:
graph init usdc-subgraph
0xGraph graph init
When prompted:
0xGraph graph init
  1. Network: Ethereum Mainnet
  2. Source: Smart contract: Ethereum
  3. Subgraph slug: create your own name
  4. Contract address: 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
  5. Contract name: create your own name
  6. Start block: (optional but recommended)

Setting up the subgraph

cd <subgraph name>
graph codegen
0xGraph graph init
graph build
0xGraph graph init

Deploy the subgraph to 0xGraph

Return to your API page and copy the information to paste it in the API key section below.
graph deploy <graph-name> --node  https://subgraph.api.ormilabs.com/deploy --ipfs https://subgraph.api.ormilabs.com/ipfs --deploy-key <API key>
0xGraph graph init

Track sync status

You can check syncing in the dashboard by going to the Subgraphs tab:
0xGraph graph init
Click the URL button and a graphql link will pop up. Click the graphql link.
0xGraph graph init

Query your USDC subgraph

query LatestTransfers {
  transfers(first: 5, orderBy: blockTimestamp, orderDirection: desc) {
    id
    from
    to
    blockTimestamp
  }
}
0xGraph graph init

You’re all set up!

Next steps

I