Coder Social home page Coder Social logo

nunoedgarhubsoftphotoflow / adchain-subgraph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from graphprotocol/adchain-subgraph

0.0 2.0 0.0 180 KB

Example subgraph project for querying the AdChain TCR

License: MIT License

TypeScript 100.00%

adchain-subgraph's Introduction

AdChain

AdChain subgraph manifest for The Graph

This is an example subgraph which demonstrates how to write

  • A subgraph manifest
  • A GraphQL schema
  • A mapping script

This example uses the AdChain that was recently deployed to mainnet. This registry keeps a list of websites that are deemed to not be committing ad fraud. Any AdChain token holder can submit an application to include a new website onto the list. Those applications can be challenged by other token holders. All of this data can be queried using The Graph.

The Graph Node contains instructions for running everything. Additionally see the Getting Started Guide for a detailed walkthrough of how the pieces fit together.

Once you have built the subgraph and started a Graph Node you may open a GraphiQL browser at 127.0.0.1:8000 and get started with these example queries.

{
  challenges(first: 50, where: {outcome: "failed"}) {
    id
    challenger
    commitEndDate
    revealEndDate
    challenger
    outcome
    rewardPool   
    totalTokens
    application {
      id,
      whitelisted,
      deposit
    }
  }
}
{
  applications(first: 100,
    where: {
        deposit_gt: "10000000000",
        owner_in: ["0x7609e21921c7efcf73a588833bf7709889291781", "0x1a5cdcfba600e0c669795e0b65c344d5a37a4d5a"]
   }) {
    id
    whitelisted
    deposit
    owner
    challenges {
      id
      outcome
      rewardPool
    }
  }
}

adchain-subgraph's People

Contributors

davekaj avatar fordn avatar html5cat avatar leoyvens avatar nenadjaja avatar timmclean avatar zerim avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.