Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit cfd4324

Browse files
committed
move environments to iohk-nix
1 parent 013ea14 commit cfd4324

File tree

5 files changed

+32
-75
lines changed

5 files changed

+32
-75
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
## Features
77
- A new endpoint to calculate the walletid of a given mnemonic [#4237](https://github.com/input-output-hk/cardano-sl/pull/4237)
88

9+
### Improvements
10+
11+
- Configuration files and environments map moved to iohk-nix [#4227](https://github.com/input-output-hk/cardano-sl/pull/4227)
12+
913
## Cardano SL 3.0.3
1014

1115
### Improvements

default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ let
6464
inherit (scripts) connect;
6565
inherit (args) environment resume;
6666
};
67-
mkTest = { environment, ...}: {
68-
full = acceptanceTest { inherit environment; resume = false; };
69-
quick = acceptanceTest { inherit environment; resume = true; };
67+
mkTest = environment: {
68+
full = acceptanceTest { environment = environment.name; resume = false; };
69+
quick = acceptanceTest { environment = environment.name; resume = true; };
7070
};
7171
in commonLib.forEnvironments mkTest;
7272
in {

lib.nix

Lines changed: 12 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -25,68 +25,20 @@ let
2525

2626
pkgs = iohkNix.pkgs;
2727
lib = pkgs.lib;
28-
in lib // iohkNix // (rec {
29-
utf8LocaleSetting = ''
30-
export LC_ALL=en_GB.UTF-8
31-
export LANG=en_GB.UTF-8
32-
'';
33-
34-
# Blockchain networks and their configuration keys
35-
environments = {
36-
mainnet = {
37-
relays = "relays.cardano-mainnet.iohk.io";
38-
confKey = "mainnet_full";
39-
genesisFile = ./lib/mainnet-genesis.json;
40-
genesisHash = "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb";
41-
private = false;
42-
};
43-
staging = {
44-
relays = "relays.awstest.iohkdev.io";
45-
confKey = "mainnet_dryrun_full";
46-
genesisFile = ./lib/mainnet-genesis-dryrun-with-stakeholders.json;
47-
genesisHash = "c6a004d3d178f600cd8caa10abbebe1549bef878f0665aea2903472d5abf7323";
48-
private = false;
49-
};
50-
testnet = {
51-
relays = "relays.cardano-testnet.iohkdev.io";
52-
confKey = "testnet_full";
53-
genesisFile = ./lib/testnet-genesis.json;
54-
genesisHash = "96fceff972c2c06bd3bb5243c39215333be6d56aaf4823073dca31afe5038471";
55-
private = false;
56-
};
57-
shelley_staging = {
58-
relays = "relays.shelley-staging.aws.iohkdev.io";
59-
confKey = "shelley_staging_full";
60-
genesisFile = ./lib/shelley-staging-genesis.json;
61-
genesisHash = "82995abf3e0e0f8ab9a6448875536a1cba305f3ddde18cd5ff54c32d7a5978c6";
62-
private = false;
63-
};
64-
shelley_staging_short = {
65-
relays = "relays.staging-shelley-short.aws.iohkdev.io";
66-
confKey = "shelley_staging_short_full";
67-
genesisFile = ./lib/shelley-staging-short-genesis.json;
68-
genesisHash = "752ad119c4eb4cda927acb6f9e234887794775a22e9c11fb967d5fc2705bab04";
69-
private = false;
70-
pbftThreshold = "0.9";
71-
};
28+
environments = iohkNix.cardanoLib.environments // {
7229
demo = {
73-
confKey = "dev";
74-
relays = "127.0.0.1";
75-
private = true;
30+
confKey = "dev";
31+
relays = "127.0.0.1";
32+
private = true;
7633
};
7734
};
78-
79-
# Generates an attrset for the three cardano-sl networks by applying
80-
# the given function to each environment.
81-
#
82-
# Example:
83-
# forEnvironments ({ environment, confKey, ... }: "key for ${environment} is ${confKey}")
84-
# => { demo = "key for demo is dev";
85-
# mainnet = "key for mainnet is mainnet_full";
86-
# staging = "key for staging is mainnet_dryrun_full";
87-
# testnet = "key for testnet is testnet_full"; }
8835
forEnvironments = f: lib.mapAttrs
89-
(name: env: f (env // { environment = name; }))
36+
(name: env: f (env // { inherit name; }))
9037
environments;
91-
92-
})
38+
in lib // iohkNix.cardanoLib // iohkNix // {
39+
inherit environments forEnvironments;
40+
utf8LocaleSetting = ''
41+
export LC_ALL=en_GB.UTF-8
42+
export LANG=en_GB.UTF-8
43+
'';
44+
}

nix/iohk-nix-src.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"url": "https://github.com/input-output-hk/iohk-nix",
3-
"rev": "ec5463c3c3442ab3d80500af6c9a57310aed79db",
4-
"date": "2019-08-09T20:49:52-04:00",
5-
"sha256": "0m1f26awc9v7klzmah06x357hn04bxwyaj287aikjqn2gbg2v51m",
3+
"rev": "0c0c2b69d44d067ef0fee60a95bcd06ecfdea53c",
4+
"date": "2019-08-19T13:42:41-04:00",
5+
"sha256": "0h716win6biipy37k5xx4br5v6vx1kpi8kixrg8iwrm72c7p3v74",
66
"fetchSubmodules": false
77
}

nix/scripts.nix

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ let
2626
in {
2727
# connect function required for acceptanceTests
2828
inherit connect;
29-
connectScripts = commonLib.forEnvironments ({ environment, ... }:
29+
connectScripts = commonLib.forEnvironments (environment:
3030
{
31-
wallet = connect { inherit environment; };
32-
explorer = connect { inherit environment; executable = "explorer"; };
31+
wallet = connect { environment = environment.name; };
32+
explorer = connect { environment = environment.name; executable = "explorer"; };
3333
proposal-ui = pkgs.callPackage ./launch/proposal-ui {
34-
inherit cardanoConfig environment;
34+
inherit cardanoConfig;
3535
inherit (nixTools.nix-tools.cexes.cardano-sl-script-runner) testcases;
36+
environment = environment.name;
3637
};
3738

3839
});
@@ -45,11 +46,11 @@ in {
4546
inherit cardanoConfig connect;
4647
inherit (nixTools.nix-tools.cexes.cardano-sl-node) cardano-node-simple;
4748
} // args);
48-
makeDockerImage = { environment, ...}:
49-
build { inherit environment; } // {
50-
wallet = build { inherit environment; type = "wallet"; };
51-
explorer = build { inherit environment; type = "explorer"; };
52-
node = build { inherit environment; type = "node"; };
49+
makeDockerImage = environment:
50+
build { environment = environment.name; } // {
51+
wallet = build { environment = environment.name; type = "wallet"; };
52+
explorer = build { environment = environment.name; type = "explorer"; };
53+
node = build { environment = environment.name; type = "node"; };
5354
};
5455
in commonLib.forEnvironments makeDockerImage;
5556
}

0 commit comments

Comments
 (0)