|
25 | 25 |
|
26 | 26 | pkgs = iohkNix.pkgs; |
27 | 27 | 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 // { |
72 | 29 | 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; |
76 | 33 | }; |
77 | 34 | }; |
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"; } |
88 | 35 | forEnvironments = f: lib.mapAttrs |
89 | | - (name: env: f (env // { environment = name; })) |
| 36 | + (name: env: f (env // { inherit name; })) |
90 | 37 | 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 | +} |
0 commit comments