Skip to content

Commit

Permalink
Merge pull request #4 from ixofoundation/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Michael-Ixo authored Sep 27, 2024
2 parents c51da92 + 78f50cb commit 3704436
Show file tree
Hide file tree
Showing 106 changed files with 8,632 additions and 702 deletions.
Binary file removed .DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ TRUST_PROXY=1
SENTRYDSN=
RPC=
DATABASE_URL=postgresql://username:password@blocksync-db:5432/Blocksync-core?schema=public
# whether to use ssl for the database connection or not, for localhost db disable this
# 1 = true, 0 = false
DATABASE_USE_SSL=0

# 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
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ blockEvent.json
blockRes.json
blockTx.json
bondsInfo.json

*.DS_Store
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"
]
}
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:18.15.0
FROM --platform=linux/amd64 node:18.17.0

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

# Generate Prisma client
RUN npx prisma generate

EXPOSE 8080

# Start
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Twitter](https://img.shields.io/twitter/follow/ixo_impact?style=social)](https://twitter.com/ixoworld)
[![Medium](https://img.shields.io/badge/Medium-ixo-green)](https://ixoworld.medium.com/)

![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 the core info from an ixo blockchain to an instance of PostgreSQL. The core info consists of the Block data, Transactions, Messages and Events.

Expand All @@ -33,7 +33,6 @@ Copy `.env.example` to `.env` and configure. If this step is skipped, ixo-blocks

```bash
yarn install
yarn prisma:reset
yarn start
```

Expand All @@ -53,7 +52,7 @@ cd ixo-blocksync-core/

Copy `.env.example` to `.env` and configure. If this step is skipped, ixo-blocksync will use `.env.example` as the configuration by default.
Don't use quotations when asign env vars for docker
Create a role(e.g. app_user) in the DB for postgress to work
Create a role(e.g. app_user) in the DB for postgress to work.

```bash
docker build -t ixofoundation/ixo-blocksync-core:latest .
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/20230830061749_init/:/docker-entrypoint-initdb.d/
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions docs/enums/types_Event.EventTypes.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,21 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.9389
<li class="current"><a href="../modules.html">ixo-<wbr/>blocksync-<wbr/>core</a>
<ul>
<li class="tsd-kind-module"><a href="../modules/app.html">app</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/index.html">index</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_block.html">postgres/block</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_client.html">postgres/client</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/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_block_sync_handler.html">sync_<wbr/>handlers/block_<wbr/>sync_<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_transactions_sync_handler.html">sync_<wbr/>handlers/transactions_<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/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_secrets.html">util/secrets</a></li></ul></li></ul></div></details></nav>
<nav class="tsd-navigation secondary menu-sticky">
Expand Down
13 changes: 9 additions & 4 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">Request</span><span class="tsd-signatu
<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 @@ -69,16 +69,21 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.9389
<li class="current"><a href="../modules.html">ixo-<wbr/>blocksync-<wbr/>core</a>
<ul>
<li class="current selected tsd-kind-module"><a href="../modules/app.html">app</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/index.html">index</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_block.html">postgres/block</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_client.html">postgres/client</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/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_block_sync_handler.html">sync_<wbr/>handlers/block_<wbr/>sync_<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_transactions_sync_handler.html">sync_<wbr/>handlers/transactions_<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/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_secrets.html">util/secrets</a></li></ul></li></ul></div></details></nav>
<nav class="tsd-navigation secondary menu-sticky">
Expand Down
Loading

0 comments on commit 3704436

Please sign in to comment.