Socket
Book a DemoInstallSign in
Socket

monarch-agent

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monarch-agent

This project can be use as a starting point for developing your new Base Goerli SubQuery project

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
0
Created
Source

Monarch SubQuery

SubQuery is a fast, flexible, and reliable open-source data indexer that provides you with custom APIs for your web3 project across all of our supported networks.

  • Playground: Subquery Explorer

Developer Guide

Install dependencies

yarn install

SubQuery project layout

  • The project manifest in project.ts defines the key project configuration and mapping handler filters
  • The GraphQL Schema (schema.graphql) defines the shape of the resulting data that you are using SubQuery to index
  • The Mapping functions in src/mappings/ directory are typescript functions that handle transformation logic

Run your project

  • yarn codegen - Generates types from the GraphQL schema definition and contract ABIs and saves them in the /src/types directory. This must be done after each change to the schema.graphql file or the contract ABIs
  • yarn build - Builds and packages the SubQuery project into the /dist directory
  • docker-compose pull && docker-compose up - Runs a Docker container with an indexer, PostgeSQL DB, and a query service. This requires Docker to be installed and running locally. The configuration for this container is set from your docker-compose.yml

You can observe the three services start, and once all are running (it may take a few minutes on your first start), please open your browser and head to http://localhost:3000 - you should see a GraphQL playground showing with the schemas ready to query. Read the docs for more information or explore the possible service configuration for running SubQuery.

Query Agent Data

  • Query all users that have authorize a specific rebalancer
{
  query {
    users(filter: { rebalancer: { equalTo: "<REBALANCER_ADDRESS>" } }) {
        nodes {
            id
            marketCaps {
              nodes {
                marketId
                cap
              }
            }
        }
    }
}
}

Publish your project

subql publish

FAQs

Package last updated on 19 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts