Skip to content

Commit

Permalink
Merge pull request #109 from ixofoundation/develop
Browse files Browse the repository at this point in the history
Develop -> Main
  • Loading branch information
Michael-Ixo authored Aug 13, 2024
2 parents 780a929 + 766e022 commit 67d4075
Show file tree
Hide file tree
Showing 277 changed files with 22,560 additions and 2,946 deletions.
Binary file removed .DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
PORT="8080"
# express trust proxy config for if you are using a reverse proxy
TRUST_PROXY=1
NODE_ENV=production

SENTRYDSN=

RPC=
DATABASE_URL=postgresql://username:password@block-sync-db:5432/Blocksync?schema=public
# database url for core database where seeding information from
DATABASE_URL_CORE=

# whether to migrate the database programatically or not, if set to true, the database will be migrated programatically
# according to postgres/migrations, for prod environtments where dont have direct db access or dont want to connect to db directly.
# Please note this has its own limitations, if this is used please dont modify the db schema manually at all, only rely on the
# programatic migrations.
# 1 = true, 0 = false
MIGRATE_DB_PROGRAMATICALLY=1
# whether to use ssl for the database connection or not, for localhost db disable this
# 1 = true, 0 = false
DATABASE_USE_SSL=0

# optional endpoint to map entity ipfs service to when entity is resolved on blocksync
IPFS_SERVICE_MAPPING="https://devnet-blocksync.ixo.earth/api/ipfs/"

# entity module contract address to check cosmwasm events to index
ENTITY_MODULE_CONTRACT_ADDRESS="ixo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sqa3vn7"
13 changes: 13 additions & 0 deletions .github/workflows/node-ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build and Release
on:
push:
branches:
- master
- develop

jobs:
build-and-release:
uses: ixofoundation/ixo-github-actions/.github/workflows/node-ci-build.yml@main
with:
commit_sha: ${{ github.sha }}
secrets: inherit
7 changes: 7 additions & 0 deletions .github/workflows/node-ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Pull Request Build and Test
on:
pull_request:

jobs:
call-ci-workflow:
uses: ixofoundation/ixo-github-actions/.github/workflows/node-ci-pr.yml@main
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.15.0
v18.17.0
62 changes: 62 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"branches": [
"main",
{
"name": "develop",
"channel": "alpha",
"prerelease": true
},
{
"name": "test",
"channel": "beta",
"prerelease": true
}
],
"ci": true,
"preset": "conventionalcommits",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{ "breaking": true, "release": "major" },
{ "type": "feat", "release": "minor" },
{ "type": "fix", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "build", "release": "patch" },
{ "scope": "security", "release": "patch" },
{ "type": "chore", "release": false },
{ "type": "ci", "release": false },
{ "type": "docs", "release": false },
{ "type": "refactor", "release": false },
{ "type": "revert", "release": false },
{ "type": "style", "release": false },
{ "type": "test", "release": false },
{ "scope": "no-release", "release": false },
{ "scope": "release", "release": "patch" }
],
"presetConfig": true
}
],
[
"@semantic-release/release-notes-generator",
{
"presetConfig": true
}
],
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/git",
{
"assets": ["package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:16.14.2
FROM --platform=linux/amd64 node:18.17.0

# Create app directory
RUN mkdir /usr/src/app
Expand All @@ -11,8 +11,6 @@ RUN yarn --pure-lockfile --production && yarn cache clean
# Copy rest of files
COPY . .

# Generate Prisma client
RUN yarn prisma:generate

EXPOSE 8080

Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![GitHub repo size](https://img.shields.io/github/repo-size/ixofoundation/ixo-blocksync)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/ixofoundation/jambo/blob/main/LICENSE)

![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white)![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge&logo=express&logoColor=%2361DAFB)![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white)![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)![Prisma](https://img.shields.io/badge/Prisma-3982CE?style=for-the-badge&logo=Prisma&logoColor=white)![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)![GraphQL](https://img.shields.io/badge/-GraphQL-E10098?style=for-the-badge&logo=graphql&logoColor=white)
![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white)![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge&logo=express&logoColor=%2361DAFB)![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white)![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)![GraphQL](https://img.shields.io/badge/-GraphQL-E10098?style=for-the-badge&logo=graphql&logoColor=white)

Syncs all the public info from an ixo blockchain to an instance of PostgreSQL. It gets fed from a [ixo-blocksync-core](https://github.com/ixofoundation/ixo-blocksync-core) database in order to speed up indexing and put less strain on nodes, which means you need an ixo-blocksync-core database connection in order to run this.

Expand All @@ -29,11 +29,9 @@ Copy `.env.example` to `.env` and configure. If this step is skipped, ixo-blocks
- Create a database called Blocksync

```bash
npm install
npx prisma migrate reset
npx prisma generate
npm run build
npm start
yarn install
yarn build
yarn start
```

---
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ services:
- 5432:5432
volumes:
- ./data/db:/var/lib/postgresql/data
- ./src/prisma/migrations/20230314111809_init/:/docker-entrypoint-initdb.d/
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

23 changes: 20 additions & 3 deletions docs/enums/types_Event.EventTypes.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,43 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.9389
<li class="tsd-kind-module"><a href="../modules/graphql_claims.html">graphql/claims</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_entity.html">graphql/entity</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_example.html">graphql/example</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_smart_tags_plugin.html">graphql/smart_<wbr/>tags_<wbr/>plugin</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_token.html">graphql/token</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_chain_handler.html">handlers/chain_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_tokenomics.html">graphql/tokenomics</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_claims_handler.html">handlers/claims_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_entity_handler.html">handlers/entity_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_ipfs_handler.html">handlers/ipfs_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_token_handler.html">handlers/token_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_tokenomics_handler.html">handlers/tokenomics_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/index.html">index</a></li>
<li class="tsd-kind-module"><a href="../modules/postgraphile.html">postgraphile</a></li>
<li class="tsd-kind-module"><a href="../modules/prisma_prisma_client.html">prisma/prisma_<wbr/>client</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_bond.html">postgres/bond</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_chain.html">postgres/chain</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_claim.html">postgres/claim</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_client.html">postgres/client</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_entity.html">postgres/entity</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_iid.html">postgres/iid</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_ipfs.html">postgres/ipfs</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_migrations.html">postgres/migrations</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_token.html">postgres/token</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_tokenomics_account.html">postgres/tokenomics_<wbr/>account</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_transaction.html">postgres/transaction</a></li>
<li class="tsd-kind-module"><a href="../modules/swagger.html">swagger</a></li>
<li class="tsd-kind-module"><a href="../modules/swagger_json.html">swagger.json</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_sync_blocks.html">sync/sync_<wbr/>blocks</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_sync_chain.html">sync/sync_<wbr/>chain</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_sync_custom.html">sync/sync_<wbr/>custom</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_handlers_event_data_sync_handler.html">sync_<wbr/>handlers/event_<wbr/>data_<wbr/>sync_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_handlers_event_data_sync_wasm_handler.html">sync_<wbr/>handlers/event_<wbr/>data_<wbr/>sync_<wbr/>wasm_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_handlers_event_sync_handler.html">sync_<wbr/>handlers/event_<wbr/>sync_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_handlers_transaction_sync_handler.html">sync_<wbr/>handlers/transaction_<wbr/>sync_<wbr/>handler</a></li>
<li class="current tsd-kind-module"><a href="../modules/types_Event.html">types/<wbr/>Event</a></li>
<li class="tsd-kind-module"><a href="../modules/types_General.html">types/<wbr/>General</a></li>
<li class="tsd-kind-module"><a href="../modules/types_getBlock.html">types/get<wbr/>Block</a></li>
<li class="tsd-kind-module"><a href="../modules/util_conversions.html">util/conversions</a></li>
<li class="tsd-kind-module"><a href="../modules/util_db.html">util/db</a></li>
<li class="tsd-kind-module"><a href="../modules/util_helpers.html">util/helpers</a></li>
<li class="tsd-kind-module"><a href="../modules/util_long.html">util/long</a></li>
<li class="tsd-kind-module"><a href="../modules/util_memory.html">util/memory</a></li>
<li class="tsd-kind-module"><a href="../modules/util_proto.html">util/proto</a></li>
<li class="tsd-kind-module"><a href="../modules/util_rate_limiter.html">util/rate-<wbr/>limiter</a></li>
<li class="tsd-kind-module"><a href="../modules/util_secrets.html">util/secrets</a></li>
Expand Down
27 changes: 22 additions & 5 deletions docs/functions/app.app.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h5>req: <span class="tsd-signature-type">IncomingMessage</span><span class="tsd
<h5>res: <span class="tsd-signature-type">ServerResponse</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">IncomingMessage</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">&gt;</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in node_modules/@types/express-serve-static-core/index.d.ts:1067</li></ul></aside></li>
<li>Defined in node_modules/@types/express-serve-static-core/index.d.ts:1084</li></ul></aside></li>
<li class="tsd-signature tsd-anchor-link" id="app-1">app<span class="tsd-signature-symbol">(</span>req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Request</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">ParamsDictionary</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">ParsedQs</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span>, res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">&gt;</span>, next<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">NextFunction</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#app-1" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
<li class="tsd-description">
<div class="tsd-parameters">
Expand All @@ -46,7 +46,7 @@ <h5>res: <span class="tsd-signature-type">Response</span><span class="tsd-signat
<h5>next: <span class="tsd-signature-type">NextFunction</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in node_modules/@types/express-serve-static-core/index.d.ts:69</li></ul></aside></li></ul></section></div>
<li>Defined in node_modules/@types/express-serve-static-core/index.d.ts:60</li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand All @@ -72,26 +72,43 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.9389
<li class="tsd-kind-module"><a href="../modules/graphql_claims.html">graphql/claims</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_entity.html">graphql/entity</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_example.html">graphql/example</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_smart_tags_plugin.html">graphql/smart_<wbr/>tags_<wbr/>plugin</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_token.html">graphql/token</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_chain_handler.html">handlers/chain_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/graphql_tokenomics.html">graphql/tokenomics</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_claims_handler.html">handlers/claims_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_entity_handler.html">handlers/entity_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_ipfs_handler.html">handlers/ipfs_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_token_handler.html">handlers/token_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/handlers_tokenomics_handler.html">handlers/tokenomics_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/index.html">index</a></li>
<li class="tsd-kind-module"><a href="../modules/postgraphile.html">postgraphile</a></li>
<li class="tsd-kind-module"><a href="../modules/prisma_prisma_client.html">prisma/prisma_<wbr/>client</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_bond.html">postgres/bond</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_chain.html">postgres/chain</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_claim.html">postgres/claim</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_client.html">postgres/client</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_entity.html">postgres/entity</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_iid.html">postgres/iid</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_ipfs.html">postgres/ipfs</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_migrations.html">postgres/migrations</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_token.html">postgres/token</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_tokenomics_account.html">postgres/tokenomics_<wbr/>account</a></li>
<li class="tsd-kind-module"><a href="../modules/postgres_transaction.html">postgres/transaction</a></li>
<li class="tsd-kind-module"><a href="../modules/swagger.html">swagger</a></li>
<li class="tsd-kind-module"><a href="../modules/swagger_json.html">swagger.json</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_sync_blocks.html">sync/sync_<wbr/>blocks</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_sync_chain.html">sync/sync_<wbr/>chain</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_sync_custom.html">sync/sync_<wbr/>custom</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_handlers_event_data_sync_handler.html">sync_<wbr/>handlers/event_<wbr/>data_<wbr/>sync_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_handlers_event_data_sync_wasm_handler.html">sync_<wbr/>handlers/event_<wbr/>data_<wbr/>sync_<wbr/>wasm_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_handlers_event_sync_handler.html">sync_<wbr/>handlers/event_<wbr/>sync_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/sync_handlers_transaction_sync_handler.html">sync_<wbr/>handlers/transaction_<wbr/>sync_<wbr/>handler</a></li>
<li class="tsd-kind-module"><a href="../modules/types_Event.html">types/<wbr/>Event</a></li>
<li class="tsd-kind-module"><a href="../modules/types_General.html">types/<wbr/>General</a></li>
<li class="tsd-kind-module"><a href="../modules/types_getBlock.html">types/get<wbr/>Block</a></li>
<li class="tsd-kind-module"><a href="../modules/util_conversions.html">util/conversions</a></li>
<li class="tsd-kind-module"><a href="../modules/util_db.html">util/db</a></li>
<li class="tsd-kind-module"><a href="../modules/util_helpers.html">util/helpers</a></li>
<li class="tsd-kind-module"><a href="../modules/util_long.html">util/long</a></li>
<li class="tsd-kind-module"><a href="../modules/util_memory.html">util/memory</a></li>
<li class="tsd-kind-module"><a href="../modules/util_proto.html">util/proto</a></li>
<li class="tsd-kind-module"><a href="../modules/util_rate_limiter.html">util/rate-<wbr/>limiter</a></li>
<li class="tsd-kind-module"><a href="../modules/util_secrets.html">util/secrets</a></li>
Expand Down
Loading

0 comments on commit 67d4075

Please sign in to comment.