Skip to content

Commit

Permalink
Merge pull request #108 from ixofoundation/dev/sql
Browse files Browse the repository at this point in the history
major: remove prisma, replace with pure sql
  • Loading branch information
Michael-Ixo authored May 13, 2024
2 parents f123da8 + 28436d9 commit 4fbeec7
Show file tree
Hide file tree
Showing 275 changed files with 23,981 additions and 4,385 deletions.
10 changes: 7 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PORT="8080"
# express trust proxy config for if you are using a reverse proxy
TRUST_PROXY=1
NODE_ENV=production

SENTRYDSN=

Expand All @@ -10,11 +11,14 @@ DATABASE_URL=postgresql://username:password@block-sync-db:5432/Blocksync?schema=
DATABASE_URL_CORE=

# whether to migrate the database programatically or not, if set to true, the database will be migrated programatically
# according to prisma 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 a all, only rely on the
# programatic migrations. https://www.prisma.io/docs/orm/prisma-migrate/workflows/development-and-production#production-and-testing-environments
# 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/"
Expand Down
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
4 changes: 1 addition & 3 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 @@ -30,8 +30,6 @@ Copy `.env.example` to `.env` and configure. If this step is skipped, ixo-blocks

```bash
npm install
npx prisma migrate reset
npx prisma generate
npm run build
npm 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
Loading

0 comments on commit 4fbeec7

Please sign in to comment.