Japan Open Chain Mainnet
- Type
- mainnet
- Protocol
- ethereum
- Identifier
- joc
- Chain ID
- eip155:81
- Native Currency
- JOC
Indexing Data on Japan Open Chain
Japan Open Chain is an EVM-compatible Layer 1 operated by trusted Japanese enterprises and designed for compliant, business-grade applications, with JOC as its native token. The Graph can index that onchain activity — DEX swaps, pools, and liquidity; lending and borrowing positions; token transfers and holder balances; and contract events — and serve it over GraphQL with Subgraphs.
Japan Open Chain is supported by The Graph with Subgraphs — develop, test, and publish them in Subgraph Studio. Publishing is enabled, though guaranteed indexing via The Graph Network is not yet available for Japan Open Chain.
Indexing Japan Open Chain with Subgraphs
Getting smart contract data is hard. You write your own indexer, run your own database, and handle chain reorganizations yourself. The Graph removes that work, giving you an open API, called a Subgraph, that you query with GraphQL.
Japan Open Chain is EVM-compatible, so the Subgraph workflow is the same as on most EVM chains. You develop and test your Subgraph in Subgraph Studio, then query it through the development endpoint.
Subgraph publishing is enabled for Japan Open Chain, but no guaranteed indexing is available via The Graph Network at this time. You can develop, test, and publish your Subgraph in Subgraph Studio, but Indexers on the decentralized network are not guaranteed to index and serve it yet.
Quick Start: Build Your Own Subgraph
Building a Subgraph for Japan Open Chain takes four steps:
- Create your Subgraph in Subgraph Studio.
- Initialize a Subgraph project from your Japan Open Chain contract.
- Deploy it to Subgraph Studio and test it in the playground.
- Query it over GraphQL with the development endpoint.
See the Subgraph pricing page for current query rates and free-tier limits.
Step 1: Create your Subgraph in Subgraph Studio
Open Subgraph Studio and connect your wallet (MetaMask, Coinbase Wallet, WalletConnect, or Safe). Create a Subgraph, then copy its slug and your deploy key from the Subgraph details page — you use both from the CLI. For a full walkthrough, see Using Subgraph Studio.
Step 2: Initialize your Subgraph project
Install the Graph CLI with the package manager you prefer:
1# npm2npm install -g @graphprotocol/graph-cli@latest34# or yarn5yarn global add @graphprotocol/graph-cliInitialize from your Japan Open Chain contract:
1graph initThe CLI walks you through a set of prompts:
- Protocol: choose
ethereum. Japan Open Chain is EVM-compatible. - Subgraph slug: use the slug of the Subgraph you created in Subgraph Studio, for example
my-joc-subgraph. - Directory: where the project is scaffolded.
- Ethereum network: select
jocfrom the list of supported networks. - Contract address: the address of the contract you want to index. Find it on explorer.japanopenchain.org.
- ABI: if the CLI cannot fetch the ABI, export it from your build artifacts or the the Japan Open Chain explorer contract page. Supply it as a JSON file.
- Start block: the block your contract was deployed at. Set this so indexing does not scan from genesis. The explorer shows the deployment block.
- Contract name: the name of your contract.
- Index contract events as entities: set this to
true. The CLI then scaffolds entities and mappings for every emitted event.
Point the manifest at Japan Open Chain:
1dataSources:2- kind: ethereum3 name: MyContract4 network: joc5 source:6 address: '0xYourJocContractAddress'7 abi: MyContract8 startBlock: 123456 # your contract's deployment blockFor a full walkthrough of schema and mapping authoring, see Creating a Subgraph. Then generate types and build:
1graph codegen && graph buildStep 3: Deploy to Subgraph Studio
Authenticate the CLI with the deploy key from your Subgraph details page:
1graph auth <DEPLOY_KEY>Then deploy your Subgraph to Subgraph Studio (the CLI asks for a version label such as 0.0.1):
1graph deploy <SUBGRAPH_SLUG>Deploying pushes your Subgraph to Subgraph Studio, where you can test it in the playground and check indexing logs. It does not publish it to the decentralized network — see Using Subgraph Studio for details.
Step 4: Query your Subgraph
Once your Subgraph is syncing in Studio, test your queries against the development query URL shown on the Subgraph details page.
- Create an API key from the API Keys dashboard at thegraph.com/studio.
- Send GraphQL queries to the development query URL with your API key. The development endpoint is rate-limited (currently 3,000 queries per day).
You can publish your Subgraph to The Graph Network at any time, but Indexers are not guaranteed to serve Japan Open Chain Subgraphs yet, so the Subgraph Studio development endpoint is the reliable way to query today.
See Querying The Graph for the full query API.