Powered by Blocknet and XQuery
Indexer - EXRPROXY-ENV plugin
- Docker
- docker-compose
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
#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
Use with EXRPROXY-ENV repo
Docker
Docker-Compose
Servicenode Private Key
Port 80 must be opened on the host
export PUBLIC_IP="" # Update with your public ip address
export SN_NAME="servicenode01" # Update with your snode name
export SN_KEY="servicenodeprivatekey" # Update with your snode private key
export SN_ADDRESS="servicenodekeyaddress" # Update with your snode address
export RPC_USER="user"
export RPC_PASSWORD="password"
docker-compose -f "docker-compose.yml" up -d --build
git clone --recursive https://github.com/blocknetdx/exrproxy-env.git
cd exrproxy-env
git submodule update --init --recursive
Check for reference for local nodes:
autobuild/examples/xquery-gethINT-avaxINT.yaml
To use external connections check:
autobuild/examples/xquery-gethEXT-avaxEXT.yaml
cd autobuild
pip3 install -r requirements.txt
python app.py --yaml examples/xquery-gethINT-avaxINT.yaml
mv autobuild/dockercompose-custom.yaml docker-compose.yml
mv autobuild/xquery.yaml xquery.yaml
docker-compose build
docker-compose -f docker-compose.yml up -d --build
curl http://127.0.0.1/xrs/projects \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"request_project","params": [],"id":1}'
curl http://127.0.0.1/xrs/xquery/<PROJECT-ID>/help -X POST -H "Api-Key:<API-KEY>"
Check the python script in autobuild/xq.py
python3 exrproxy-env/autobuild/xq.py --projectid YOUR-PROJECT-ID --apikey YOUR-API-KEY
# 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"
#Single chain - ETH - infura
graph: ETH
endpoint: /indexer
chains:
- name: ETH_UNISWAP
rpc_host: https://:INFURA_SECRET@mainnet.infura.io/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"
#Multi chain AVAX - ETH
graph: AVAX_ETH
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://:INFURA_SECRET@mainnet.infura.io/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"