Skip to content

Commit

Permalink
fix: add DATABASE_USE_SSL option for remote dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelPretorius committed Apr 23, 2024
1 parent 9120d9e commit 254fc13
Show file tree
Hide file tree
Showing 74 changed files with 1,631 additions and 324 deletions.
9 changes: 6 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +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 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
3 changes: 1 addition & 2 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 Down
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions docs/enums/types_Event.EventTypes.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,11 @@ <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_migration.html">prisma/migration</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>
Expand All @@ -194,6 +195,8 @@ <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/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: 8 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">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,10 +69,11 @@ <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_migration.html">prisma/migration</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>
Expand All @@ -81,6 +82,8 @@ <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/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 254fc13

Please sign in to comment.