Skip to content

Chore/merge master conway era #1209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bfd3cc1
chore: add live-{preview,preprod} v2 deployments
gytis-ivaskevicius Mar 25, 2024
2889ea3
chore: disable blockfrost worker on old deployments
gytis-ivaskevicius Mar 25, 2024
7e0eaf7
Merge pull request #1173 from input-output-hk/live-deployments
gytis-ivaskevicius Mar 27, 2024
205a119
chore: pass NODE_ENV=production to live environment provider servers
gytis-ivaskevicius Mar 28, 2024
d1cc65b
Merge pull request #1183 from input-output-hk/pass-node-env
gytis-ivaskevicius Mar 28, 2024
5b0ce8d
ci: publish packages [skip actions]
lace-bot Apr 3, 2024
57363bf
Merge pull request #1197 from input-output-hk/release/cardano-service…
gytis-ivaskevicius Apr 3, 2024
f084f42
feat(hardware-ledger): enable LedgerKeyAgent to accept a device to es…
szymonmaslowski Mar 26, 2024
1e6287b
refactor(hardware-ledger): use more precise type for the object repre…
szymonmaslowski Mar 28, 2024
abbf5fe
fix(cardano-services): emergency fix for lw-10209
iccicci Apr 4, 2024
3891d35
Merge pull request #1161 from input-output-hk/feat/lw-9808-lace-HW-on…
szymonmaslowski Apr 4, 2024
eec92ae
ci: publish packages [skip actions]
lace-bot Apr 4, 2024
1281a98
Merge pull request #1199 from input-output-hk/fix/LW-10209-emergency-…
gytis-ivaskevicius Apr 4, 2024
9bf4cf3
chore: split smash url per env
bernokl Apr 5, 2024
0d8cbe2
chore: update pre- url to api/v1, update default
bernokl Apr 5, 2024
132a9f6
feat: optimize projector to not write irrelevant blocks
mkazlauskas Mar 26, 2024
2178cda
fix(cardano-services): address projection now applies store operators…
AngelCastilloB Apr 3, 2024
0d3a152
chore: clean up let in defaults
bernokl Apr 8, 2024
389727b
Merge pull request #1201 from input-output-hk/update_smash
bernokl Apr 8, 2024
1426bf1
chore: enable running on AArch64 (`master`) (#1171)
michalrus Apr 8, 2024
06a1de5
feat(wallet): implement drep registration tracker
vetalcore Apr 2, 2024
9cf346f
refactor(wallet): hoist ObservableWallet getPubDRepKey under Observab…
vetalcore Apr 4, 2024
d53a96e
Merge pull request #1200 from input-output-hk/feat/projector-no-pg-tr…
AngelCastilloB Apr 9, 2024
b0c08fd
Merge pull request #1192 from input-output-hk/feat/lw-9897-implement-…
vetalcore Apr 9, 2024
59fcd06
chore: upgrade Axios version to 0.28.0
VanessaPC Apr 11, 2024
eb469a0
Merge pull request #1207 from input-output-hk/feat/lw-10266-upgrade-a…
VanessaPC Apr 11, 2024
ba01291
fix: the projection now always stores blocks when it reaches tip - k
AngelCastilloB Apr 11, 2024
3ee403b
Merge pull request #1208 from input-output-hk/fix/store-data-now-alwa…
AngelCastilloB Apr 12, 2024
dcd237d
Merge branch 'master' into conway-era
iccicci Apr 12, 2024
58da17c
test(e2e): make transaction test compliant with new wallet.governance…
iccicci Apr 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions compose/aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Overrides for AArch64 processors, until we get official images:

services:
cardano-db-sync:
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.1.0.0}
cardano-node:
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-node:${CARDANO_NODE_VERSION:-1.35.5}
ogmios:
image: ghcr.io/input-output-hk/ogmios-tracker/ogmios:v${OGMIOS_VERSION:-5.6.0}
cardano-submit-api:
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-submit-api:${CARDANO_NODE_VERSION:-1.35.5}
1 change: 1 addition & 0 deletions compose/arm64.yml
3 changes: 3 additions & 0 deletions compose/x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Nothing to override – for x86_64 processors we use the official `amd64` images.

{}
104 changes: 94 additions & 10 deletions nix/cardano-services/deployments/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ in
resources.limits = mkPodResources "300Mi" "500m";
resources.requests = mkPodResources "150Mi" "100m";
};

pg-boss-worker = {
enabled = false;
metadata-fetch-mode = "direct";
resources.limits = mkPodResources "300Mi" "300m";
resources.requests = mkPodResources "150Mi" "200m";
enabled = false;
metadata-fetch-mode = "smash";
smash-url = if values.network == "mainnet"
then "https://smash.cardano-mainnet.iohk.io/api/v1"
else "https://${values.network}-smash.world.dev.cardano.org/api/v1";
resources.limits = mkPodResources "300Mi" "300m";
resources.requests = mkPodResources "150Mi" "200m";
};

backend = {
Expand Down Expand Up @@ -210,7 +212,6 @@ in

blockfrost-worker.enabled = true;
pg-boss-worker.enabled = true;
pg-boss-worker.metadata-fetch-mode = "smash";
};
};

Expand Down Expand Up @@ -329,7 +330,6 @@ in

blockfrost-worker.enabled = true;
pg-boss-worker.enabled = true;
pg-boss-worker.metadata-fetch-mode = "smash";
};
};

Expand All @@ -348,6 +348,7 @@ in
network = "preprod";
region = "us-east-1";


backend.hostnames = ["${final.namespace}.${baseUrl}"];
backend.passHandleDBArgs = false;
backend.routes = [
Expand Down Expand Up @@ -401,8 +402,9 @@ in
backend.allowedOrigins = lib.concatStringsSep "," allowedOriginsDev;
backend.hostnames = ["${final.namespace}.${baseUrl}"];

blockfrost-worker.enabled = true;
pg-boss-worker.enabled = true;

blockfrost-worker.enabled = true;
cardano-services = {
ingresOrder = 98;
};
Expand Down Expand Up @@ -492,6 +494,7 @@ in
providers = {
backend = {
enabled = true;
env.NODE_ENV = "production";
};
};

Expand All @@ -515,14 +518,54 @@ in
"/v2.0.0/tx-submit"
"/v2.0.0/utxo"
];
blockfrost-worker.enabled = true;
# blockfrost-worker.enabled = true;
cardano-services = {
ingresOrder = 99;
image = "926093910549.dkr.ecr.us-east-1.amazonaws.com/cardano-services:s8j5nx9x2naar194pr58kpmlr5s4xn7b";
};
};
};

"live-preprod@us-east-2@v2" = final: {
name = "${final.namespace}-cardanojs-v2";
namespace = "live-preprod";
context = "eks-admin";

providers = {
backend = {
enabled = true;
env.NODE_ENV = "production";
};
stake-pool-provider = {
enabled = true;
env.OVERRIDE_FUZZY_OPTIONS = "true";
env.NODE_ENV = "production";
};
handle-provider = {
enabled = true;
env.NODE_ENV = "production";
};
};

projectors = {
handle.enabled = true;
stake-pool.enabled = true;
};

values = {
network = "preprod";
region = "us-east-2";

backend.hostnames = ["backend.${final.namespace}.eks.${baseUrl}" "${final.namespace}.${baseUrl}"];
blockfrost-worker.enabled = true;
pg-boss-worker.enabled = true;
cardano-services = {
ingresOrder = 98;
};
};
};


"live-preview@us-east-2@v1" = final: {
name = "${final.namespace}-cardanojs-v1";
namespace = "live-preview";
Expand All @@ -531,6 +574,7 @@ in
providers = {
backend = {
enabled = true;
env.NODE_ENV = "production";
};
};

Expand All @@ -554,14 +598,53 @@ in
"/v2.0.0/tx-submit"
"/v2.0.0/utxo"
];
blockfrost-worker.enabled = true;
# blockfrost-worker.enabled = true;
cardano-services = {
ingresOrder = 99;
image = "926093910549.dkr.ecr.us-east-1.amazonaws.com/cardano-services:s8j5nx9x2naar194pr58kpmlr5s4xn7b";
};
};
};

"live-preview@us-east-2@v2" = final: {
name = "${final.namespace}-cardanojs-v2";
namespace = "live-preview";
context = "eks-admin";

providers = {
backend = {
enabled = true;
env.NODE_ENV = "production";
};
stake-pool-provider = {
enabled = true;
env.OVERRIDE_FUZZY_OPTIONS = "true";
env.NODE_ENV = "production";
};
handle-provider = {
enabled = true;
env.NODE_ENV = "production";
};
};

projectors = {
handle.enabled = true;
stake-pool.enabled = true;
};

values = {
network = "preview";
region = "us-east-2";

backend.hostnames = ["backend.${final.namespace}.eks.${baseUrl}" "${final.namespace}.${baseUrl}"];
blockfrost-worker.enabled = true;
pg-boss-worker.enabled = true;
cardano-services = {
ingresOrder = 98;
};
};
};

"ops-preview-1@us-east-1" = final: {
namespace = "ops-preview-1";

Expand Down Expand Up @@ -610,6 +693,7 @@ in
env.USE_SUBMIT_API = "true";
env.USE_BLOCKFROST = lib.mkForce "false";
env.SUBMIT_API_URL = "http://${final.namespace}-cardano-stack.${final.namespace}.svc.cluster.local:8090";
env.NODE_ENV = "production";
};
stake-pool-provider.enabled = true;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
}
// lib.optionalAttrs (values.pg-boss-worker ? env) values.pg-boss-worker.env
// lib.optionalAttrs (values.pg-boss-worker.metadata-fetch-mode == "smash") {
SMASH_URL = "https://smash.cardano-mainnet.iohk.io/api/v1";
SMASH_URL = values.pg-boss-worker.smash-url;
});
volumeMounts = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/cardano-services-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"dependencies": {
"@cardano-sdk/core": "workspace:~",
"@cardano-sdk/util": "workspace:~",
"axios": "^0.27.2",
"axios": "^0.28.0",
"class-validator": "^0.14.0",
"json-bigint": "~1.0.0",
"ts-log": "^2.2.4"
Expand Down
4 changes: 4 additions & 0 deletions packages/cardano-services/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.27.1](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/[email protected]...@cardano-sdk/[email protected]) (2024-04-03)

**Note:** Version bump only for package @cardano-sdk/cardano-services

## [0.27.0](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/[email protected]...@cardano-sdk/[email protected]) (2024-03-26)

### ⚠ BREAKING CHANGES
Expand Down
8 changes: 4 additions & 4 deletions packages/cardano-services/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardano-sdk/cardano-services",
"version": "0.27.0",
"version": "0.27.1",
"description": "Cardano GraphQL Services",
"engines": {
"node": ">=16.20.2"
Expand Down Expand Up @@ -29,8 +29,8 @@
"cleanup:nm": "rm -rf node_modules",
"cleanup": "rm -rf dist node_modules",
"cli": "ts-node --transpile-only src/cli.ts",
"compose:up": "docker compose --env-file environments/.env.$NETWORK -p cardano-services-$NETWORK -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/pg-agent.yml ${FILES:-} up",
"compose:down": "docker compose -p cardano-services-$NETWORK -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/pg-agent.yml down -t 120",
"compose:up": "docker compose --env-file environments/.env.$NETWORK -p cardano-services-$NETWORK -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/pg-agent.yml -f ../../compose/$(uname -m).yml ${FILES:-} up",
"compose:down": "docker compose -p cardano-services-$NETWORK -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/pg-agent.yml -f ../../compose/$(uname -m).yml down -t 120",
"coverage": "yarn test --coverage || true",
"circular-deps:check": "madge --circular dist/cjs",
"lint": "eslint -c ../../complete.eslintrc.js \"src/**/*.ts\" \"test/**/*.ts\"",
Expand Down Expand Up @@ -98,7 +98,7 @@
"@cardano-sdk/util": "workspace:~",
"@cardano-sdk/util-rxjs": "workspace:~",
"@hapi/topo": "^6.0.2",
"axios": "^0.27.2",
"axios": "^0.28.0",
"backoff-rxjs": "^7.0.0",
"bignumber.js": "^9.1.0",
"body-parser": "^1.19.2",
Expand Down
6 changes: 5 additions & 1 deletion packages/cardano-services/src/Http/HttpService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import { versionPathFromSpec } from '../util/openApi';
import express, { Router } from 'express';
import path from 'path';

const openApiOption = { ignoreUndocumented: true, validateRequests: true, validateResponses: true };
const openApiOption = {
ignoreUndocumented: true,
validateRequests: true,
validateResponses: process.env.NODE_ENV !== 'production'
};

export abstract class HttpService extends RunnableModule {
public router: express.Router;
Expand Down
30 changes: 19 additions & 11 deletions packages/cardano-services/src/Projection/createTypeormProjection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Bootstrap, ProjectionEvent, logProjectionProgress, requestNext } from '@cardano-sdk/projection';
import { Cardano, ObservableCardanoNode } from '@cardano-sdk/core';
import { Logger } from 'ts-log';
import { Observable, concat, defer, take, takeWhile } from 'rxjs';
import { Observable, concat, defer, groupBy, mergeMap, take, takeWhile } from 'rxjs';
import {
PgConnectionConfig,
TypeormDevOptions,
Expand Down Expand Up @@ -72,7 +72,7 @@ export const createTypeormProjection = ({
logger.debug(`Creating projection with policyIds ${JSON.stringify(handlePolicyIds)}`);
logger.debug(`Using a ${blocksBufferLength} blocks buffer`);

const { mappers, entities, stores, extensions } = prepareTypeormProjection(
const { mappers, entities, stores, extensions, willStore } = prepareTypeormProjection(
{
options: projectionOptions,
projections
Expand Down Expand Up @@ -118,15 +118,23 @@ export const createTypeormProjection = ({
defer(() =>
projectionSource$.pipe(
applyMappers(mappers),
shareRetryBackoff(
(evt$) =>
evt$.pipe(
withTypeormTransaction({ connection$: connect() }),
applyStores(stores),
buffer.storeBlockData(),
typeormTransactionCommit()
),
{ shouldRetry: isRecoverableTypeormError }
// if there are any relevant data to write into db
groupBy((evt) => willStore(evt)),
mergeMap((group$) =>
group$.key
? group$.pipe(
shareRetryBackoff(
(evt$) =>
evt$.pipe(
withTypeormTransaction({ connection$: connect() }),
applyStores(stores),
buffer.storeBlockData(),
typeormTransactionCommit()
),
{ shouldRetry: isRecoverableTypeormError }
)
)
: group$
),
tipTracker.trackProjectedTip(),
requestNext(),
Expand Down
Loading
Loading