76 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			76 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
#
 | 
						|
# Cookbook Name:: kosmos-parity
 | 
						|
# Recipe:: node_dev
 | 
						|
#
 | 
						|
# The MIT License (MIT)
 | 
						|
#
 | 
						|
# Copyright:: 2019, Kosmos Developers
 | 
						|
#
 | 
						|
# Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
						|
# of this software and associated documentation files (the "Software"), to deal
 | 
						|
# in the Software without restriction, including without limitation the rights
 | 
						|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
						|
# copies of the Software, and to permit persons to whom the Software is
 | 
						|
# furnished to do so, subject to the following conditions:
 | 
						|
#
 | 
						|
# The above copyright notice and this permission notice shall be included in
 | 
						|
# all copies or substantial portions of the Software.
 | 
						|
#
 | 
						|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
						|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
						|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | 
						|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
						|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
						|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
						|
# THE SOFTWARE.
 | 
						|
 | 
						|
# Sets up a parity node running on the dev chain on port 8545 (behind nginx,
 | 
						|
# with HTTPS)
 | 
						|
 | 
						|
rpc_proxy_port = 8545
 | 
						|
rpc_port       = 18545
 | 
						|
dapps_port     = 8180
 | 
						|
 | 
						|
parity_node "dev" do
 | 
						|
  password "parityparity"
 | 
						|
  config parity: {
 | 
						|
           chain: "dev",
 | 
						|
           no_download: true, # Don't download updates
 | 
						|
         },
 | 
						|
         network: {
 | 
						|
           port: 30303,
 | 
						|
           warp: true,
 | 
						|
           allow_ips: "public" # Don't connect to local IPs
 | 
						|
         },
 | 
						|
         rpc: {
 | 
						|
           port: rpc_port,
 | 
						|
           cors: "*",
 | 
						|
           apis: ["web3", "net", "traces", "rpc", "eth"],
 | 
						|
           hosts: ["all"],
 | 
						|
         },
 | 
						|
         dapps: {
 | 
						|
           port: dapps_port,
 | 
						|
         },
 | 
						|
         ui: {
 | 
						|
           disable: true,
 | 
						|
         },
 | 
						|
         websockets: {
 | 
						|
           disable: true,
 | 
						|
         },
 | 
						|
         mining: {
 | 
						|
           reseal_min_period: 0,
 | 
						|
         }
 | 
						|
  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_dev" do
 | 
						|
    port     rpc_proxy_port
 | 
						|
    protocol :tcp
 | 
						|
    command  :allow
 | 
						|
  end
 | 
						|
end
 |