Ver código fonte

localnet/darkfid: Communicate using TLS, and optional verbosity.

Luther Blissett 3 anos atrás
pai
commit
e2db33154b

+ 1 - 1
contrib/localnet/darkfid/clean.sh

@@ -1,3 +1,3 @@
 #!/bin/sh
-rm -rf darkfid0 darkfid1 darkfid2 faucetd/blockchain
+rm -rf darkfid0 darkfid1 darkfid2 faucetd/blockchain lilith_hosts.tsv
 git checkout faucetd/wallet.db

+ 3 - 3
contrib/localnet/darkfid/darkfid0.toml

@@ -19,7 +19,7 @@ wallet_pass = "changeme"
 database = "darkfid0/blockchain"
 
 # JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8340"
+rpc_listen = "tls://127.0.0.1:8340"
 
 # Participate in the consensus protocol
 consensus = true
@@ -34,7 +34,7 @@ consensus_p2p_external = ["tls://127.0.0.1:8341"]
 #consensus_slots = 8
 
 # Connection slots for the consensus protocol
-consensus_p2p_seed = ["tcp://127.0.0.1:33033"]
+consensus_p2p_seed = ["tls://127.0.0.1:33033"]
 
 # Peers to connect to for the consensus protocol
 #consensus_p2p_peer = []
@@ -53,7 +53,7 @@ sync_p2p_external = ["tls://127.0.0.1:8342"]
 #sync_slots = 8
 
 # Seed nodes to connect to for the syncing protocol
-sync_p2p_seed = ["tcp://127.0.0.1:33032"]
+sync_p2p_seed = ["tls://127.0.0.1:33032"]
 
 # Peers to connect to for the syncing protocol
 #sync_p2p_peer = []

+ 4 - 4
contrib/localnet/darkfid/darkfid1.toml

@@ -19,7 +19,7 @@ wallet_pass = "changeme"
 database = "darkfid1/blockchain"
 
 # JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8440"
+rpc_listen = "tls://127.0.0.1:8440"
 
 # Participate in the consensus protocol
 consensus = true
@@ -34,10 +34,10 @@ consensus_p2p_external = ["tls://127.0.0.1:8441"]
 #consensus_slots = 8
 
 # Connection slots for the consensus protocol
-consensus_p2p_seed = ["tcp://127.0.0.1:33033"]
+consensus_p2p_seed = ["tls://127.0.0.1:33033"]
 
 # Seed nodes JSON-RPC listen URL for clock synchronization
-consensus_seed_rpc = ["tcp://127.0.0.1:8340"]
+consensus_seed_rpc = ["tls://127.0.0.1:8340"]
 
 # Peers to connect to for the consensus protocol
 #consensus_p2p_peer = []
@@ -58,7 +58,7 @@ sync_p2p_external = ["tls://127.0.0.1:8442"]
 #sync_slots = 8
 
 # Seed nodes to connect to for the syncing protocol
-sync_p2p_seed = ["tcp://127.0.0.1:33032"]
+sync_p2p_seed = ["tls://127.0.0.1:33032"]
 
 # Peers to connect to for the syncing protocol
 #sync_p2p_peer = []

+ 1 - 1
contrib/localnet/darkfid/darkfid2.toml

@@ -52,7 +52,7 @@ sync_p2p_external = ["tls://127.0.0.1:8542"]
 #sync_slots = 8
 
 # Seed nodes to connect to for the syncing protocol
-sync_p2p_seed = ["tcp://127.0.0.1:33032"]
+sync_p2p_seed = ["tls://127.0.0.1:33032"]
 
 # Peers to connect to for the syncing protocol
 #sync_p2p_peer = []

+ 1 - 1
contrib/localnet/darkfid/lilith_config.toml

@@ -10,7 +10,7 @@
 #rpc_listen = "tcp://127.0.0.1:18927"
 
 # Daemon published urls, common for all enabled networks
-urls = ["tcp://127.0.0.1"]
+urls = ["tls://127.0.0.1"]
 
 # Hosts .tsv file to use
 hosts_file="lilith_hosts.tsv"

+ 13 - 7
contrib/localnet/darkfid/tmux_sessions.sh

@@ -1,24 +1,30 @@
 #!/bin/sh
 set -e
 
-# Start a tmux session with a lilith node, two consensus nodes, a non-consensus node, and
-# a faucet that's able to mint tokens.
+# Start a tmux session with a lilith node, two consensus nodes, a non-consensus
+# node, and a faucet that's able to mint tokens.
+
+if [ "$1" = "-v" ]; then
+	verbose="-v"
+else
+	verbose=""
+fi
 
 tmux new-session -d
-tmux send-keys "LOG_TARGETS='!MessageSubsystem::notify' ../../../lilith -v -c lilith_config.toml" Enter
+tmux send-keys "LOG_TARGETS='!MessageSubsystem::notify' ../../../lilith ${verbose} -c lilith_config.toml" Enter
 sleep 2
 tmux split-window -v
-tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid -v -c darkfid0.toml" Enter
+tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid0.toml" Enter
 sleep 2
 tmux select-pane -t 0
 tmux split-window -h
-tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid -v -c darkfid1.toml" Enter
+tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid1.toml" Enter
 sleep 2
 tmux select-pane -t 1
 tmux split-window -h
-tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid -v -c darkfid2.toml" Enter
+tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid2.toml" Enter
 sleep 2
 tmux select-pane -t 3
 tmux split-window -h
-tmux send-keys "LOG_TARGETS='!sled,!net' ../../../faucetd -v -c faucetd.toml" Enter
+tmux send-keys "LOG_TARGETS='!sled,!net' ../../../faucetd ${verbose} -c faucetd.toml" Enter
 tmux attach