diff --git a/.rubocop.yml b/.rubocop.yml index 7ed82d3..11b96b0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -36,3 +36,6 @@ Metrics/ModuleLength: Lint/OrAssignmentToConstant: Enabled: false + +Lint/DuplicateBranch: + Enabled: false diff --git a/ChangeLog.md b/ChangeLog.md index 782edb3..5d4429d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,8 @@ +## [0.1.5] - 2023-04-04 + +## Changed + - don't use p2p for cardano-node (#8) + ## [0.1.4] - 2023-03-01 ## Added diff --git a/lib/cardano-up/launcher.rb b/lib/cardano-up/launcher.rb index 4024275..e974f35 100644 --- a/lib/cardano-up/launcher.rb +++ b/lib/cardano-up/launcher.rb @@ -113,23 +113,34 @@ def self.node_up(configuration) } } CardanoUp::Session.create_or_update(session_name, service_details) - if CardanoUp::Utils.win? - # Turn off p2p for Windows - # TODO: remove after https://github.com/input-output-hk/ouroboros-network/issues/3968 released - config_win = CardanoUp::Utils.from_json("#{config_dir}/config.json") - config_win[:EnableP2P] = false - CardanoUp::Utils.to_json("#{config_dir}/config.json", config_win) - topology = { - Producers: [ - { - addr: "#{env}-node.world.dev.cardano.org", - port: 30_002, - valency: 2 - } - ] - } - CardanoUp::Utils.to_json("#{config_dir}/topology.json", topology) + # Turn off p2p in config.json and topology.json + config_json = CardanoUp::Utils.from_json("#{config_dir}/config.json") + config_json[:EnableP2P] = false + CardanoUp::Utils.to_json("#{config_dir}/config.json", config_json) + addr = env == 'mainnet' ? 'relays-new.cardano-mainnet.iohk.io' : "#{env}-node.world.dev.cardano.org" + port = case env + when 'mainnet' + 3001 + when 'preprod' + 30_000 + when 'preview' + 30_002 + else + 30_000 + end + topology_json = { + Producers: [ + { + addr: addr, + port: port, + valency: 2 + } + ] + } + CardanoUp::Utils.to_json("#{config_dir}/topology.json", topology_json) + + if CardanoUp::Utils.win? # create cardano-node.bat file File.write("#{bin_dir}/cardano-node.bat", node_cmd) install_node = "nssm install #{node_service} #{bin_dir}/cardano-node.bat" diff --git a/lib/cardano-up/version.rb b/lib/cardano-up/version.rb index 0c4ea52..562a1fb 100644 --- a/lib/cardano-up/version.rb +++ b/lib/cardano-up/version.rb @@ -2,5 +2,5 @@ # Version module CardanoUp - VERSION ||= '0.1.4' + VERSION ||= '0.1.5' end