Coder Social home page Coder Social logo

pinkdiamond1 / xquery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blocknetdx/xquery-v1-archive

0.0 1.0 0.0 151 KB

XQuery provides decentralized access to indexed data for EVM blockchains such as Ethereum and Avalanche.

Home Page: https://xquery.io

License: GNU General Public License v3.0

Python 85.46% Dockerfile 3.42% Jinja 11.11%

xquery's Introduction

Powered by Blocknet and XQuery

Indexer - EXRPROXY-ENV plugin

Requirements

  • Docker
  • docker-compose

Dependency Installation

Install Docker (Ubuntu)

sudo apt-get update

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
    
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

sudo apt install curl
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Automated Deployment with EXRPROXY-ENV

Best suitable to be used with EXRPROXY-ENV autobuild

  • Runs indexer, DB, and hasura API endpoint
  • requires at least 2vCPU

query.yaml input file format (This .yaml file is auto-generated in Autobuild steps below.)

#mandatory
graph: Name of graph
#mandatory
endpoint: Graph endpoint
chains:
  #mandatory
  - name: Name of chain; no spaces required
    #mandatory
    rpc_host: Rpc endpoint of chain, host and ip;
    #mandatory
    abi: ABI file; check provided abi format
    #mandatory
    query:
    - name: What events to search for
    #mandatory
    address:
    - name: Router name; no spaces required
      address: Router address
    #not mandatory
    historical:
    - fromBlock: Starting block number for historical events; Expected number

Autobuild steps

Requirements

  • Port 80 must be opened on the host

Follow the Service Node Setup Guide. That guide employs the autobuild tools in the EXR ENV repo to deploy XQuery within an EXR Environment.

Once the XQuery stack has been deployed in the EXR ENV, you can create a project and test the XQuery deployment by following the Project API and the XQuery API.

NOTE: If you want to create a project in the EXR ENV for testing, and you want to avoid making a payment to create the project, check out the projects.py tool in your EXR ENV, located at exrproxy-env/cli/projects.py. Issue projects.py -h for help in using it.

Templates

Single chain

pangolin-query.yaml

# Single chain - AVAX
graph: AVAX
endpoint: /indexer
chains:
  - name: AVAX_PANGOLIN
    rpc_host: https://api.avax.network/ext/bc/C/rpc
    abi: abi/pangolinRouter.json
    query:
    - name: Swap
    address:
    - name: Pangolin_Router
      address: '0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106'
    historical:
    - fromBlock: "6800000"

uniswap-query.yaml

#Single chain - ETH - infura
graph: ETH
endpoint: /indexer
chains:
  - name: ETH_UNISWAP
    rpc_host: https://:[email protected]/v3/INFURA_PROJECT
    abi: abi/uniswapRouter.json
    query:
    - name: Swap
    address:
    - name: Uniswap_Router_v2
      address: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'
    - name: Uniswap_Router_v3
      address: '0xe592427a0aece92de3edee1f18e0157c05861564'
    historical:
    - fromBlock: "13600000"

pegasys-query.yaml

#Single chain - NEVM - pegasys
graph: NEVM
endpoint: /indexer
chains:
  - name: NEVM_PEGASYS
    rpc_host: https://rpc.syscoin.org/
    abi: abi/pegasysRouter.json
    query:
      - name: Withdrawal
      - name: Deposit
      - name: Approval
      - name: Burn
      - name: Mint
      - name: Swap
      - name: Sync
      - name: Transfer
    address:
    - name: Pegasys_Router
      address: '0x017dAd2578372CAEE5c6CddfE35eEDB3728544C4'
    historical:
    - fromBlock: "38202"

Multi chain

pangolin-uniswap-pegasys-query.yaml

#Multi chain AVAX - ETH - NEVM
graph: AVAX_ETH_NEVM
endpoint: /indexer
chains:
  - name: AVAX_PANGOLIN
    rpc_host: https://api.avax.network/ext/bc/C/rpc
    abi: abi/pangolinRouter.json
    query:
    - name: Swap
    address:
    - name: Pangolin_Router
      address: '0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106'
    historical:
    - fromBlock: "6800000"
  - name: ETH_UNISWAP
    rpc_host: https://:[email protected]/v3/INFURA_PROJECT
    abi: abi/uniswapRouter.json
    query:
    - name: Swap
    address:
    - name: Uniswap_Router_v2
      address: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'
    - name: Uniswap_Router_v3
      address: '0xe592427a0aece92de3edee1f18e0157c05861564'
    historical:
    - fromBlock: "13600000"
  - name: NEVM_PEGASYS
    rpc_host: https://rpc.syscoin.org/
    abi: abi/pegasysRouter.json
    query:
      - name: Withdrawal
      - name: Deposit
      - name: Approval
      - name: Burn
      - name: Mint
      - name: Swap
      - name: Sync
      - name: Transfer
    address:
    - name: Pegasys_Router
      address: '0x017dAd2578372CAEE5c6CddfE35eEDB3728544C4'
    historical:
    - fromBlock: "38202"

xquery's People

Contributors

atcsecure avatar conanmishler avatar dmetcalf99 avatar pom11 avatar shrnkld avatar supermutecx avatar walkjivefly avatar

Watchers

 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.