From 3b6a1d0e4c9140abf0fab71d143b99024ae1afb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Sun, 7 May 2017 16:02:58 +0200 Subject: [PATCH] Set up config for testnet --- .../kosmos-parity/recipes/node_testnet.rb | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/site-cookbooks/kosmos-parity/recipes/node_testnet.rb b/site-cookbooks/kosmos-parity/recipes/node_testnet.rb index 18cebf7..145ab53 100644 --- a/site-cookbooks/kosmos-parity/recipes/node_testnet.rb +++ b/site-cookbooks/kosmos-parity/recipes/node_testnet.rb @@ -7,25 +7,46 @@ # All rights reserved - Do Not Redistribute # +rpc_proxy_port = 8546 +rpc_port = 18546 + credentials = Chef::EncryptedDataBagItem.load('credentials', 'parity') parity_node "testnet" do password credentials["testnet_password"] config parity: { - chain: "ropsten", + chain: "testnet", no_download: true, # Don't Download Updates }, network: { port: 30304, + warp: true, }, rpc: { - port: 8546, + port: rpc_port, + cors: "*", + apis: ["safe"], + hosts: ["all"], }, dapps: { - port: 8091, + disable: true, }, ui: { - port: 8181, + disable: true, + }, + websockets: { + disable: true, } + rpc_proxy_port rpc_proxy_port end +# The firewall_rule doesn't appear to work inside a resource, that's why we're +# doing it here +unless node.chef_environment == "development" + include_recipe 'firewall' + firewall_rule "parity_testnet" do + port rpc_proxy_port + protocol :tcp + command :allow + end +end