Skip to content

Commit e1d5962

Browse files
Chore/bump node 9.1 dbsync 13.3 (#879)
* chore: updated compose file and added preprod config files * chore: updated view creation for db-sync 13.3 * chore: added config files for networks * Added slot point so that ogmios does not start from origin, instead start just before the asset minting started. (#880) Thanks @Kartiiyer12 I'll use this in my bump for Node 9.0 * chore: added config files for networks * chore: fixed sonar lint issues * chore: moved chainsyncpoint to background so that it can be configured via env * chore: moved chainsyncpoint to background so that it can be configured via env * chore: removed unused cachedfrom statements * chore: fixed docker build format warnings * chore: removed unsued console log * chore: splitted cardano-node-ogmios container into two seperate ones (node + ogmios) * chore: adjusted ogmios server name default value in dockerfile * chore: Postgres port now adjustable * chore: Postgres port now adjustable * chore: updated urls to use local token registry for all networks by default * chore: added docker compose dependency to the token registry that it waits for postgres * chore: Token Registry Port is now adjustable and background is using it * chore: right tokenregistry is used now * chore: adjusted adapots table name * chore: adjusted adapots table name * chore: fixed console log of chainfollower starting point * chore: Testing batchsize for queue size * chore: updated metadata info message it can take up to 90mins * chore: added chain follower vars to docker-compose * chore: fixed a bug which caused no chainsync point when syncing from genesis * chore: fixed lint issue * docs: Upgraded documentation * docs: disclaimer for db-sync issue --------- Co-authored-by: Kartiiyer12 <[email protected]>
1 parent 5f5cdfe commit e1d5962

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+16494
-15909
lines changed

Dockerfile

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ARG UBUNTU_VERSION=20.04
22

3-
FROM ubuntu:${UBUNTU_VERSION} as ubuntu-nodejs
3+
FROM ubuntu:${UBUNTU_VERSION} AS ubuntu-nodejs
44
ARG NODEJS_MAJOR_VERSION=18
55
ENV DEBIAN_FRONTEND=nonintercative
66
RUN apt-get update && apt-get install curl -y &&\
77
curl --proto '=https' --tlsv1.2 -sSf -L https://deb.nodesource.com/setup_${NODEJS_MAJOR_VERSION}.x | bash - &&\
88
apt-get install nodejs -y
99

10-
FROM ubuntu-nodejs as nodejs-builder
10+
FROM ubuntu-nodejs AS nodejs-builder
1111
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - &&\
1212
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list &&\
1313
apt-get update && apt-get install gcc g++ make gnupg2 yarn -y
@@ -25,21 +25,21 @@ COPY \
2525
tsconfig.json \
2626
/app/
2727

28-
FROM nodejs-builder as cardano-graphql-builder
28+
FROM nodejs-builder AS cardano-graphql-builder
2929
RUN yarn --frozen-lockfile --non-interactive &&\
3030
yarn build
3131

32-
FROM nodejs-builder as cardano-graphql-production-deps
32+
FROM nodejs-builder AS cardano-graphql-production-deps
3333
RUN yarn --frozen-lockfile --non-interactive --production
3434

35-
FROM frolvlad/alpine-glibc:alpine-3.11_glibc-2.30 as downloader
35+
FROM frolvlad/alpine-glibc:alpine-3.11_glibc-2.30 AS downloader
3636
RUN apk add curl
3737
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | sh
3838
ENV HASURA_GRAPHQL_ENABLE_TELEMETRY=false
3939
RUN hasura --skip-update-check update-cli --version v2.17.1
4040
RUN hasura --skip-update-check plugins install cli-ext
4141

42-
FROM nodejs-builder as dev
42+
FROM nodejs-builder AS dev
4343
RUN apt-get update && apt-get install yarn -y
4444
RUN mkdir src
4545
RUN mkdir /node-ipc
@@ -57,7 +57,7 @@ ENV \
5757
POSTGRES_USER_FILE=/run/secrets/postgres_user
5858
WORKDIR /src
5959

60-
FROM ubuntu-nodejs as background
60+
FROM ubuntu-nodejs AS background
6161
ARG NETWORK=mainnet
6262
# using local token registry as default
6363
ARG METADATA_SERVER_URI="http://token-metadata-registry:8091"
@@ -74,7 +74,7 @@ ENV \
7474
HASURA_URI="http://hasura:8080" \
7575
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" \
7676
METADATA_SERVER_URI=${METADATA_SERVER_URI} \
77-
OGMIOS_HOST="cardano-node-ogmios" \
77+
OGMIOS_HOST="ogmios" \
7878
OGMIOS_PORT=1337 \
7979
POSTGRES_DB_FILE=/run/secrets/postgres_db \
8080
POSTGRES_HOST=postgres \
@@ -92,15 +92,15 @@ COPY --from=cardano-graphql-production-deps /app/packages/api-cardano-db-hasura/
9292
WORKDIR /app/packages/api-cardano-db-hasura/dist
9393
CMD ["node", "background.js"]
9494

95-
FROM ubuntu-nodejs as server
95+
FROM ubuntu-nodejs AS server
9696
ARG NETWORK=mainnet
9797
ENV \
9898
CARDANO_NODE_CONFIG_PATH=/config/cardano-node/config.json \
9999
HASURA_GRAPHQL_ENABLE_TELEMETRY=false \
100100
HASURA_URI="http://hasura:8080" \
101101
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" \
102102
NETWORK=${NETWORK} \
103-
OGMIOS_HOST="cardano-node-ogmios" \
103+
OGMIOS_HOST="ogmios" \
104104
OGMIOS_PORT=1337
105105
COPY --from=cardano-graphql-builder /app/packages/api-cardano-db-hasura/dist /app/packages/api-cardano-db-hasura/dist
106106
COPY --from=cardano-graphql-builder /app/packages/api-cardano-db-hasura/hasura/project /app/packages/api-cardano-db-hasura/hasura/project
@@ -117,6 +117,6 @@ WORKDIR /app/packages/server/dist
117117
EXPOSE 3100
118118
CMD ["node", "index.js"]
119119

120-
FROM cardanofoundation/cf-token-metadata-registry-api:latest as token-registry
120+
FROM cardanofoundation/cf-token-metadata-registry-api:latest AS token-registry
121121
ADD scripts/token-registry-init.sh /app/entrypoint.sh
122122
ENTRYPOINT sh /app/entrypoint.sh

README.md

+25-19
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
Cross-platform, _typed_, and **queryable** API for Cardano. The project contains multiple [packages] for composing
1616
GraphQL services to meet specific application demands, and a [docker compose stack] serving the included
17-
[cardano-graphql-server Dockerfile], the extended [hasura Dockerfile], [cardano-node-ogmios]. The [schema] is defined in
17+
[cardano-graphql-server Dockerfile], the extended [hasura Dockerfile], [ogmios] and [cardano-node]. The [schema] is defined in
1818
native `.graphql`, and used to generate a [TypeScript package for client-side static typing]. A mutation is available to
1919
submit a signed and serialized transaction to the local node.
2020

@@ -40,7 +40,7 @@ Check the [releases] for the latest version.
4040
``` console
4141
git clone \
4242
--single-branch \
43-
--branch 8.1.0 \
43+
--branch 8.2.0 \
4444
--recurse-submodules \
4545
https://github.com/cardano-foundation/cardano-graphql.git \
4646
&& cd cardano-graphql
@@ -58,10 +58,13 @@ console session freely. See [Docker Compose docs] to tailor for your use-case
5858
<summary><i>mainnet</i></summary>
5959

6060
Get the most recent weekly snapshot link [here](https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#12/), and set it as `RESTORE_SNAPSHOT` below, or omit if you wish to sync from genesis.
61+
> **Disclaimer:** There is currently a known issue with `cardano-db-sync` which hinders using a snapshot.
62+
> We will provide an update once the issue is resolved.
63+
6164
``` console
6265
DOCKER_BUILDKIT=1 \
6366
COMPOSE_DOCKER_CLI_BUILD=1 \
64-
RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.2/db-sync-snapshot-schema-13.2-block-10060706-x86_64.tgz \
67+
RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.3/db-sync-snapshot-schema-13.3-block-10611621-x86_64.tgz \
6568
docker compose up -d --build &&\
6669
docker compose logs -f
6770
```
@@ -127,11 +130,12 @@ your use-case.
127130
Get the most recent weekly snapshot link [here](https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#11/), and set it as `RESTORE_SNAPSHOT` below, or omit if you wish to sync from genesis.
128131
``` console
129132
export NETWORK=mainnet &&\
130-
docker pull cardanofoundation/cardano-graphql-server:8.1.0-${NETWORK} &&\
131-
docker pull cardanofoundation/cardano-graphql-background:8.1.0-${NETWORK} &&\
132-
docker pull cardanofoundation/cardano-graphql-hasura:8.1.0 &&\
133-
docker pull cardanosolutions/cardano-node-ogmios:v6.4.0_8.9.3-${NETWORK} &&\
134-
RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.2/db-sync-snapshot-schema-13.2-block-10060706-x86_64.tgz \
133+
docker pull cardanofoundation/cardano-graphql-server:8.2.0-${NETWORK} &&\
134+
docker pull cardanofoundation/cardano-graphql-background:8.2.0-${NETWORK} &&\
135+
docker pull cardanofoundation/cardano-graphql-hasura:8.2.0 &&\
136+
docker pull ghcr.io/intersectmbo/cardano-node:9.1.0 &&\
137+
docker pull cardanosolutions/ogmios:v6.5 &&\
138+
RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.3/db-sync-snapshot-schema-13.3-block-10611621-x86_64.tgz \
135139
docker compose up -d &&\
136140
docker compose logs -f
137141
```
@@ -142,10 +146,11 @@ docker compose logs -f
142146

143147
``` console
144148
export NETWORK=preprod &&\
145-
docker pull cardanofoundation/cardano-graphql-server:8.1.0-${NETWORK} &&\
146-
docker pull cardanofoundation/cardano-graphql-background:8.1.0-${NETWORK} &&\
147-
docker pull cardanofoundation/cardano-graphql-hasura:8.1.0 &&\
148-
docker pull cardanosolutions/cardano-node-ogmios:v6.4.0_8.9.3-${NETWORK} &&\
149+
docker pull cardanofoundation/cardano-graphql-server:8.2.0-${NETWORK} &&\
150+
docker pull cardanofoundation/cardano-graphql-background:8.2.0-${NETWORK} &&\
151+
docker pull cardanofoundation/cardano-graphql-hasura:8.2.0 &&\
152+
docker pull ghcr.io/intersectmbo/cardano-node:9.1.0 &&\
153+
docker pull cardanosolutions/ogmios:v6.5 &&\
149154
API_PORT=3101 \
150155
HASURA_PORT=8091 \
151156
OGMIOS_PORT=1338 \
@@ -161,10 +166,11 @@ docker compose -p ${NETWORK} logs -f
161166

162167
``` console
163168
export NETWORK=preview &&\
164-
docker pull cardanofoundation/cardano-graphql-server:8.1.0-${NETWORK} &&\
165-
docker pull cardanofoundation/cardano-graphql-background:8.1.0-${NETWORK} &&\
166-
docker pull cardanofoundation/cardano-graphql-hasura:8.1.0 &&\
167-
docker pull cardanosolutions/cardano-node-ogmios:v6.4.0_8.9.3-${NETWORK} &&\
169+
docker pull cardanofoundation/cardano-graphql-server:8.2.0-${NETWORK} &&\
170+
docker pull cardanofoundation/cardano-graphql-background:8.2.0-${NETWORK} &&\
171+
docker pull cardanofoundation/cardano-graphql-hasura:8.2.0 &&\
172+
docker pull ghcr.io/intersectmbo/cardano-node:9.1.0 &&\
173+
docker pull cardanosolutions/ogmios:v6.5 &&\
168174
API_PORT=3102 \
169175
HASURA_PORT=8092 \
170176
OGMIOS_PORT=1339 \
@@ -220,7 +226,7 @@ METADATA_SERVER_URI="https://metadata.world.dev.cardano.org"
220226
If you are upgrading from Postgres 11 to 14: A resync will be needed.
221227
To speed up the process you can use the following snapshots:
222228
- [DB-Sync](https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.2/db-sync-snapshot-schema-13.2-block-10060706-x86_64.tgz)
223-
- [Node](https://csnapshots.io/about#Manual_download)
229+
- [Node](https://mithril.network/doc/manual/getting-started/bootstrap-cardano-node/)
224230

225231
### Check Cardano DB sync progress
226232
Use the GraphQL Playground in the browser at http://localhost:3100/graphql:
@@ -288,12 +294,12 @@ See [Building].
288294
[Docker Compose docs]: https://docs.docker.com/compose/
289295
[cardano-graphql-server Dockerfile]: ./Dockerfile
290296
[hasura Dockerfile]: ./packages/api-cardano-db-hasura/hasura/Dockerfile
291-
[cardano-node-ogmios]: https://ogmios.dev/getting-started/docker/
297+
[ogmios]: https://ogmios.dev/getting-started/docker/
298+
[cardano-node]: https://github.com/IntersectMBO/cardano-node
292299
[schema]: ./packages/api-cardano-db-hasura/schema.graphql
293300
[TypeScript package for client-side static typing]: ./packages/client-ts/README.md
294301
[Apollo Server]: https://www.apollographql.com/docs/apollo-server/
295302
[GraphQL Code Generator]: https://graphql-code-generator.com
296-
[available on npm]: https://www.npmjs.com/package/cardano-graphql-ts
297303
[Ogmios]: https://ogmios.dev/
298304
[releases]: https://github.com/cardano-foundation/cardano-graphql/releases
299305
[Wiki :book:]: https://github.com/cardano-foundation/cardano-graphql/wiki

config/network/mainnet/cardano-db-sync/config.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"EnableFutureGenesis": true,
23
"EnableLogMetrics": false,
34
"EnableLogging": true,
45
"NetworkName": "mainnet",
@@ -111,4 +112,4 @@
111112
"scRotation": null
112113
}
113114
]
114-
}
115+
}

0 commit comments

Comments
 (0)