-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 32c42f8
Showing
21 changed files
with
14,342 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
# These are some examples of commonly ignored file patterns. | ||
# You should customize this list as applicable to your project. | ||
# Learn more about .gitignore: | ||
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore | ||
|
||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.* | ||
package-lock.json | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# Compiled Java class files | ||
*.class | ||
|
||
# Compiled Python bytecode | ||
*.py[cod] | ||
|
||
# Log files | ||
*.log | ||
|
||
# Package files | ||
*.jar | ||
|
||
# Generated files | ||
target/ | ||
dist/ | ||
src/types | ||
project.yaml | ||
|
||
# JetBrains IDE | ||
.idea/ | ||
/tmp | ||
|
||
# Unit test reports | ||
TEST*.xml | ||
|
||
# Generated by MacOS | ||
.DS_Store | ||
|
||
# Generated by Windows | ||
Thumbs.db | ||
|
||
# Applications | ||
*.app | ||
*.exe | ||
*.war | ||
|
||
# Large media files | ||
*.mp4 | ||
*.tiff | ||
*.avi | ||
*.flv | ||
*.mov | ||
*.wmv | ||
|
||
.data | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
name: Deploy | ||
|
||
jobs: | ||
build: | ||
name: Build and Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Executing docker compose build and update | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
port: ${{ secrets.PORT }} | ||
script: | | ||
cd /home/${{ secrets.USERNAME }}/subquery-indexer/; | ||
git reset --hard; | ||
git pull --rebase; | ||
docker system prune -f; | ||
docker compose -f docker-compose.production.yml build --force-rm --no-cache --compress; | ||
docker compose -f docker-compose.production.yml up -d; | ||
docker compose ps -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
# These are some examples of commonly ignored file patterns. | ||
# You should customize this list as applicable to your project. | ||
# Learn more about .gitignore: | ||
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore | ||
|
||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.* | ||
package-lock.json | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# Compiled Java class files | ||
*.class | ||
|
||
# Compiled Python bytecode | ||
*.py[cod] | ||
|
||
# Log files | ||
*.log | ||
|
||
# Package files | ||
*.jar | ||
|
||
# Generated files | ||
target/ | ||
dist/ | ||
src/types | ||
project.yaml | ||
|
||
# JetBrains IDE | ||
.idea/ | ||
/tmp | ||
|
||
# Unit test reports | ||
TEST*.xml | ||
|
||
# Generated by MacOS | ||
.DS_Store | ||
|
||
# Generated by Windows | ||
Thumbs.db | ||
|
||
# Applications | ||
*.app | ||
*.exe | ||
*.war | ||
|
||
# Large media files | ||
*.mp4 | ||
*.tiff | ||
*.avi | ||
*.flv | ||
*.mov | ||
*.wmv | ||
|
||
.data | ||
dist |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.2.2.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT LICENSE | ||
|
||
Copyright 2020-2021 SubQuery Pte Ltd authors & contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SubQuery Indexer for Drop points program | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
version: "3" | ||
|
||
services: | ||
postgres: | ||
build: | ||
context: . | ||
dockerfile: ./docker/pg-Dockerfile | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- .data/postgres:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
subquery-node-osmosis: | ||
image: subquerynetwork/subql-node-cosmos:latest | ||
depends_on: | ||
"postgres": | ||
condition: service_healthy | ||
restart: always | ||
environment: | ||
DB_USER: postgres | ||
DB_PASS: postgres | ||
DB_DATABASE: postgres | ||
DB_HOST: postgres | ||
DB_PORT: 5432 | ||
volumes: | ||
- ./:/app | ||
command: | ||
- ${SUB_COMMAND:-} # set SUB_COMMAND env variable to "test" to run tests | ||
- -f=/app/project-osmosis.yaml | ||
- --multi-chain | ||
- --db-schema=multi-transfers | ||
- --disable-historical | ||
- --batch-size=30 | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://subquery-node-osmosis:3000/ready"] | ||
interval: 3s | ||
timeout: 5s | ||
retries: 10 | ||
subquery-node-secret: | ||
image: subquerynetwork/subql-node-cosmos:latest | ||
depends_on: | ||
"postgres": | ||
condition: service_healthy | ||
restart: always | ||
environment: | ||
DB_USER: postgres | ||
DB_PASS: postgres | ||
DB_DATABASE: postgres | ||
DB_HOST: postgres | ||
DB_PORT: 5432 | ||
volumes: | ||
- ./:/app | ||
command: | ||
- ${SUB_COMMAND:-} # set SUB_COMMAND env variable to "test" to run tests | ||
- -f=/app/project-secret.yaml | ||
- --multi-chain | ||
- --db-schema=multi-transfers | ||
- --disable-historical | ||
- --batch-size=30 | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://subquery-node-secret:3000/ready"] | ||
interval: 3s | ||
timeout: 5s | ||
retries: 10 | ||
|
||
graphql-engine: | ||
image: onfinality/subql-query:latest | ||
ports: | ||
- 3001:3000 | ||
depends_on: | ||
"postgres": | ||
condition: service_healthy | ||
"subquery-node-secret": | ||
condition: service_healthy | ||
"subquery-node-osmosis": | ||
condition: service_healthy | ||
restart: always | ||
environment: | ||
DB_USER: postgres | ||
DB_PASS: postgres | ||
DB_DATABASE: postgres | ||
DB_HOST: postgres | ||
DB_PORT: 5432 | ||
command: | ||
- --name=multi-transfers | ||
- --playground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<EOF | ||
CREATE EXTENSION IF NOT EXISTS btree_gist; | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM subquerynetwork/subql-node-cosmos:latest | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --no-cache g++ make py3-pip | ||
COPY package.json yarn.lock .yarnrc.yml ./ | ||
COPY .yarn/ ./.yarn/ | ||
RUN yarn workspaces focus --all | ||
|
||
COPY . . | ||
|
||
ARG ENV_FILE=.env.mainnet.sample | ||
COPY ${ENV_FILE} .env.local | ||
|
||
RUN yarn codegen | ||
RUN yarn build | ||
|
||
CMD ["-f=/app", "--db-schema=app", "--workers=4", "--batch-size=30", "--unfinalized-blocks=true"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM postgres:16-alpine | ||
|
||
# Variables needed at runtime to configure postgres and run the initdb scripts | ||
ENV POSTGRES_DB 'postgres' | ||
ENV POSTGRES_USER 'postgres' | ||
ENV POSTGRES_PASSWORD 'postgres' | ||
|
||
# Copy in the load-extensions script | ||
COPY docker/load-extensions.sh /docker-entrypoint-initdb.d/ | ||
|
||
# Convert line endings to LF | ||
RUN sed -i 's/\r$//' /docker-entrypoint-initdb.d/load-extensions.sh && chmod +x /docker-entrypoint-initdb.d/load-extensions.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "neutron", | ||
"version": "0.0.1", | ||
"description": "This project can be use as a starting point for developing your Cosmos (Neutron) based SubQuery project", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "subql build", | ||
"codegen": "subql codegen", | ||
"start:docker": "docker-compose pull && docker-compose up --remove-orphans", | ||
"dev": "subql codegen && subql build && docker-compose pull && docker-compose up --remove-orphans", | ||
"prepack": "rm -rf dist && npm run build", | ||
"test": "jest" | ||
}, | ||
"homepage": "https://github.com/subquery/cosmos-subql-starter", | ||
"repository": "github:subquery/cosmos-subql-starter", | ||
"files": [ | ||
"dist", | ||
"schema.graphql", | ||
"project.yaml" | ||
], | ||
"author": "SubQuery Team", | ||
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"@cosmjs/stargate": "^0.28.9", | ||
"@subql/cli": "^4.10.0", | ||
"@subql/node-cosmos": "latest", | ||
"@subql/testing": "latest", | ||
"typescript": "^5.2.2" | ||
}, | ||
"dependencies": { | ||
"@subql/types-cosmos": "latest", | ||
"@subql/utils": "^2.7.0", | ||
"@types/node": "^17.0.21", | ||
"pino": "^7.8.0", | ||
"ts-proto": "^1.112.1", | ||
"tslib": "^2.3.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
specVersion: 1.0.0 | ||
version: 0.0.1 | ||
name: drop-points | ||
description: Drop points | ||
runner: | ||
node: | ||
name: '@subql/node-cosmos' | ||
version: '>=3.0.0' | ||
query: | ||
name: '@subql/query' | ||
version: '*' | ||
schema: | ||
file: ./schema.graphql | ||
network: | ||
chainId: osmosis-1 | ||
endpoint: | ||
- https://osmosis-rpc.publicnode.com/ | ||
dataSources: | ||
- kind: cosmos/Runtime | ||
startBlock: 15952063 | ||
mapping: | ||
file: ./dist/index.js | ||
handlers: | ||
- handler: handleCoin | ||
kind: cosmos/TransactionHandler |
Oops, something went wrong.