Skip to content

Commit a5c7212

Browse files
committed
cardano-graphql 5 with ogmios.
1 parent 14faffd commit a5c7212

File tree

3 files changed

+60
-18
lines changed

3 files changed

+60
-18
lines changed

globals-defaults.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ in {
3636
explorerActiveBackends = [ "a" ];
3737
explorer9 = {
3838
cardano-db-sync = sourcePaths.cardano-db-sync-9;
39-
cardano-explorer-app = sourcePaths."cardano-explorer-app-1.5";
4039
cardano-graphql = sourcePaths.cardano-graphql-4;
40+
cardano-explorer-app = sourcePaths."cardano-explorer-app-1.5";
4141
};
4242
explorer10 = {
4343
cardano-db-sync = sourcePaths.cardano-db-sync-10;
44-
cardano-explorer-app = sourcePaths.cardano-explorer-app-next;
45-
cardano-graphql = sourcePaths.cardano-graphql-next;
44+
cardano-graphql = sourcePaths.cardano-graphql-5;
45+
cardano-explorer-app = sourcePaths."cardano-explorer-app-1.6";
46+
cardano-rosetta = sourcePaths."cardano-rosetta-1.3";
4647
};
4748
explorerBackendsInContainers = false;
4849

nix/sources.json

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,16 @@
7171
"url": "https://github.com/input-output-hk/cardano-explorer-app/archive/6233695d96a4f566d7033f246c9b3c9f06a83884.tar.gz",
7272
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
7373
},
74-
"cardano-explorer-app-next": {
75-
"branch": "chore/cardano-graphql-5.0.0-compat",
74+
"cardano-explorer-app-1.6": {
75+
"branch": "refs/tags/1.6.0",
7676
"description": "Cardano Explorer App",
7777
"homepage": "",
7878
"owner": "input-output-hk",
7979
"repo": "cardano-explorer-app",
80-
"rev": "351acc63df0b67be3762a189f7e344dcb729ca36",
81-
"sha256": "04z68rrishc8xr6nwrml00lhq6b8w227c0x18chgikc5gl6idb0y",
80+
"rev": "80be1db48710067664b2e62ba332192e9c84261a",
81+
"sha256": "0sx583488yd62bh79vn6ghrwkh1dw3x6gacpy12km4rinr14d8gz",
8282
"type": "tarball",
83-
"url": "https://github.com/input-output-hk/cardano-explorer-app/archive/351acc63df0b67be3762a189f7e344dcb729ca36.tar.gz",
83+
"url": "https://github.com/input-output-hk/cardano-explorer-app/archive/80be1db48710067664b2e62ba332192e9c84261a.tar.gz",
8484
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
8585
},
8686
"cardano-faucet": {
@@ -108,16 +108,16 @@
108108
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
109109
"version": "cc7f4ddf78182fb14c8d34516e6c72408ad3eb35o"
110110
},
111-
"cardano-graphql-next": {
112-
"branch": "chore/cardano-db-sync-10-compat",
111+
"cardano-graphql-5": {
112+
"branch": "refs/tags/5.0.0",
113113
"description": "GraphQL API for Cardano",
114114
"homepage": "",
115115
"owner": "input-output-hk",
116116
"repo": "cardano-graphql",
117-
"rev": "efa008c3ea0a2c98bee2aa40afeaeba2b5b3e3f3",
118-
"sha256": "10dd4zsbz2nhv4s2x5yf1zkfw1kskvr8nswikdlb5lc9r73igs5f",
117+
"rev": "754d9e9acc31a75b3f786cac5553bd3155e6a968",
118+
"sha256": "07jcvgzxdll1818kmag9bafqp0yc7pq1h85bmsi4hak9mdhz76jd",
119119
"type": "tarball",
120-
"url": "https://github.com/input-output-hk/cardano-graphql/archive/efa008c3ea0a2c98bee2aa40afeaeba2b5b3e3f3.tar.gz",
120+
"url": "https://github.com/input-output-hk/cardano-graphql/archive/754d9e9acc31a75b3f786cac5553bd3155e6a968.tar.gz",
121121
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
122122
"version": "cc7f4ddf78182fb14c8d34516e6c72408ad3eb35o"
123123
},
@@ -157,6 +157,18 @@
157157
"url": "https://github.com/input-output-hk/cardano-rosetta/archive/46f814f78884377010b46e6e307746ebea02ffce.tar.gz",
158158
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
159159
},
160+
"cardano-rosetta-1.3": {
161+
"branch": "1-3-stable",
162+
"description": "An implementation of Rosetta for Cardano ",
163+
"homepage": "https://www.rosetta-api.org",
164+
"owner": "input-output-hk",
165+
"repo": "cardano-rosetta",
166+
"rev": "05ba365dc112a3dc0b2e101ddfd65d6ec4ae9155",
167+
"sha256": "1imbp1pmxxfhdjiaqyn8zswjcrd3fsck7j64fa8bc2n9xj4x5c7l",
168+
"type": "tarball",
169+
"url": "https://github.com/input-output-hk/cardano-rosetta/archive/05ba365dc112a3dc0b2e101ddfd65d6ec4ae9155.tar.gz",
170+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
171+
},
160172
"iohk-nix": {
161173
"branch": "master",
162174
"description": "nix scripts shared across projects",
@@ -193,6 +205,18 @@
193205
"url": "https://github.com/input-output-hk/offchain-metadata-tools/archive/dd052829f0f070f91edd67cffe073db1622ea55d.tar.gz",
194206
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
195207
},
208+
"ogmios": {
209+
"branch": "refs/tags/v4.0.0-beta.4",
210+
"description": " ❇️ A JSON-WSP WebSocket bridge for cardano-node",
211+
"homepage": "https://ogmios.dev",
212+
"owner": "CardanoSolutions",
213+
"repo": "ogmios",
214+
"rev": "a2a92ee54b08e9b8b3c8cc95ea4f4c4d83904579",
215+
"sha256": "1qgrqw31wd0jpxcn0jaih8dmsr6446rqcy8zqgh2wrylfncpznap",
216+
"type": "tarball",
217+
"url": "https://github.com/CardanoSolutions/ogmios/archive/a2a92ee54b08e9b8b3c8cc95ea4f4c4d83904579.tar.gz",
218+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
219+
},
196220
"ops-lib": {
197221
"branch": "master",
198222
"description": "NixOps deployment configuration library for IOHK devops ",

roles/explorer.nix

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ let
55
maintenanceMode = false;
66
cfg = config.services.cardano-db-sync;
77
nodeCfg = config.services.cardano-node;
8+
ogmiosCfg = config.services.cardano-ogmios;
89
nodeId = config.node.nodeId;
910
getSrc = name: variant.${name} or sourcePaths.${name};
1011

12+
cardanoNodeConfigPath = builtins.toFile "cardano-node-config.json" (builtins.toJSON nodeCfg.nodeConfig);
13+
1114
dbSyncPkgs = let s = getSrc "cardano-db-sync"; in import (s + "/nix") { gitrev = s.rev; };
1215
inherit (dbSyncPkgs) cardanoDbSyncHaskellPackages;
1316
inherit (cardanoDbSyncHaskellPackages.cardano-db-sync.components.exes) cardano-db-sync;
@@ -18,11 +21,12 @@ let
1821
cardano-explorer-app-pkgs = import (getSrc "cardano-explorer-app");
1922
in {
2023
imports = [
21-
((getSrc "cardano-graphql") + "/nix/nixos")
24+
cardano-ops.modules.cardano-postgres
25+
cardano-ops.modules.base-service
2226
((sourcePaths.cardano-db-sync-service or (getSrc "cardano-db-sync")) + "/nix/nixos")
27+
((getSrc "ogmios") + "/nix/nixos")
28+
((getSrc "cardano-graphql") + "/nix/nixos")
2329
((getSrc "cardano-rosetta") + "/nix/nixos")
24-
cardano-ops.modules.base-service
25-
cardano-ops.modules.cardano-postgres
2630
];
2731

2832
environment.systemPackages = with pkgs; [
@@ -51,15 +55,23 @@ in {
5155
'';
5256
};
5357

58+
services.cardano-ogmios = {
59+
enable = true;
60+
nodeConfig = cardanoNodeConfigPath;
61+
nodeSocketPath = nodeCfg.socketPath;
62+
hostAddr = "127.0.0.1";
63+
};
64+
5465
services.graphql-engine.enable = true;
5566
services.cardano-graphql = {
5667
enable = true;
68+
inherit cardanoNodeConfigPath;
5769
genesisByron = nodeCfg.nodeConfig.ByronGenesisFile;
5870
genesisShelley = nodeCfg.nodeConfig.ShelleyGenesisFile;
5971
allowListPath = cardano-explorer-app-pkgs.allowList;
60-
cardanoNodeSocketPath = nodeCfg.socketPath;
61-
cardanoNodeConfigPath = builtins.toFile "cardano-node-config.json" (builtins.toJSON nodeCfg.nodeConfig);
6272
metadataServerUri = globals.environmentConfig.metadataUrl or null;
73+
ogmiosHost = ogmiosCfg.hostAddr;
74+
ogmiosPort = ogmiosCfg.port;
6375
};
6476

6577
services.cardano-rosetta-server = {
@@ -109,6 +121,11 @@ in {
109121
RestartSec = "30s";
110122
};
111123

124+
systemd.services.cardano-ogmios.serviceConfig = {
125+
User = "cexplorer";
126+
SupplementaryGroups = "cardano-node";
127+
};
128+
112129
systemd.services.cardano-rosetta-server.serviceConfig = {
113130
User = "cexplorer";
114131
SupplementaryGroups = "cardano-node";

0 commit comments

Comments
 (0)