ソースを参照

contrib/localnet/darkfid*: updated to work with latest darkfid

skoupidi 2 年 前
コミット
d54e44b573
34 ファイル変更449 行追加967 行削除
  1. 3 0
      bin/minerd/minerd.toml
  2. 3 1
      contrib/localnet/darkfid-five-nodes/README.md
  3. 0 5
      contrib/localnet/darkfid-five-nodes/clean.sh
  4. 36 52
      contrib/localnet/darkfid-five-nodes/darkfid0.toml
  5. 40 50
      contrib/localnet/darkfid-five-nodes/darkfid1.toml
  6. 40 50
      contrib/localnet/darkfid-five-nodes/darkfid2.toml
  7. 40 50
      contrib/localnet/darkfid-five-nodes/darkfid3.toml
  8. 40 50
      contrib/localnet/darkfid-five-nodes/darkfid4.toml
  9. 0 33
      contrib/localnet/darkfid-five-nodes/logproc.py
  10. 13 0
      contrib/localnet/darkfid-five-nodes/minerd0.toml
  11. 13 0
      contrib/localnet/darkfid-five-nodes/minerd1.toml
  12. 13 0
      contrib/localnet/darkfid-five-nodes/minerd2.toml
  13. 13 0
      contrib/localnet/darkfid-five-nodes/minerd3.toml
  14. 13 0
      contrib/localnet/darkfid-five-nodes/minerd4.toml
  15. 23 12
      contrib/localnet/darkfid-five-nodes/tmux_sessions.sh
  16. 4 4
      contrib/localnet/darkfid-single-node/README.md
  17. 3 0
      contrib/localnet/darkfid-single-node/minerd.toml
  18. 5 2
      contrib/localnet/darkfid-small/README.md
  19. 36 52
      contrib/localnet/darkfid-small/darkfid0.toml
  20. 47 49
      contrib/localnet/darkfid-small/darkfid1.toml
  21. 24 56
      contrib/localnet/darkfid-small/darkfid2.toml
  22. 13 0
      contrib/localnet/darkfid-small/minerd0.toml
  23. 13 0
      contrib/localnet/darkfid-small/minerd1.toml
  24. 14 8
      contrib/localnet/darkfid-small/tmux_sessions.sh
  25. 0 5
      contrib/localnet/darkfid/.gitignore
  26. 0 124
      contrib/localnet/darkfid/README.md
  27. 0 3
      contrib/localnet/darkfid/clean.sh
  28. 0 77
      contrib/localnet/darkfid/darkfid0.toml
  29. 0 82
      contrib/localnet/darkfid/darkfid1.toml
  30. 0 76
      contrib/localnet/darkfid/darkfid2.toml
  31. 0 55
      contrib/localnet/darkfid/faucetd.toml
  32. BIN
      contrib/localnet/darkfid/faucetd/wallet.db
  33. 0 41
      contrib/localnet/darkfid/lilith_config.toml
  34. 0 30
      contrib/localnet/darkfid/tmux_sessions.sh

+ 3 - 0
bin/minerd/minerd.toml

@@ -8,3 +8,6 @@
 
 # JSON-RPC listen URL
 #rpc_listen = "tcp://127.0.0.1:28467"
+
+# PoW miner number of threads to use
+#threads = 4

+ 3 - 1
contrib/localnet/darkfid-five-nodes/README.md

@@ -1,4 +1,6 @@
 darkfid localnet
 ================
 
-This will start 5 darkfid nodes to participate in the consensus.
+This will start five `darkfid` node instances
+in localnet mode, along with a `minerd` daemon
+to mine blocks, for each one.

+ 0 - 5
contrib/localnet/darkfid-five-nodes/clean.sh

@@ -1,8 +1,3 @@
 #!/bin/sh
 rm -rf darkfid0 darkfid1 darkfid2 darkfid3 darkfid4
-# clean log files
-rm /tmp/f_history.log  /tmp/lead_history.log /tmp/lottery_history.log &>/dev/null &
-touch /tmp/f_history.log
-touch /tmp/lead_history.log
-touch /tmp/lottery_history.log
 

+ 36 - 52
contrib/localnet/darkfid-five-nodes/darkfid0.toml

@@ -6,71 +6,55 @@
 ## The default values are left commented. They can be overridden either by
 ## uncommenting, or by using the command-line.
 
-# Chain to use (testnet, mainnet)
-chain = "testnet"
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48340"
 
-# Path to the wallet database
-wallet_path = "darkfid0/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
+# Blockchain network to use
+network = "localnet"
 
+# Localnet blockchain network configuration
+[network_config."localnet"]
 # Path to the blockchain database directory
-database = "darkfid0/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8340"
-
-# Participate in the consensus protocol
-consensus = true
-
-# Enable single-node mode for local testing
-single_node = false
-
-# P2P accept addresses for the consensus protocol
-consensus_p2p_accept = ["tcp://127.0.0.1:8341"]
+database = "darkfid0"
 
-# P2P external addresses for the consensus protocol
-consensus_p2p_external = ["tcp://127.0.0.1:8341"]
+# Finalization threshold, denominated by number of blocks
+threshold = 3
 
-# Connection slots for the consensus protocol
-#consensus_slots = 8
+# minerd JSON-RPC endpoint
+minerd_endpoint = "tcp://127.0.0.1:48467"
 
-# Connection slots for the consensus protocol
-#consensus_p2p_seed = []
+# PoW block production target, in seconds
+pow_target = 20
 
-# Peers to connect to for the consensus protocol
-#consensus_p2p_peer = []
+# Participate in block production
+miner = true
 
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
+# Wallet address to receive mining rewards.
+# This is a dummy one so the miner can start,
+# replace with your own one.
+recipient = "9vw6WznKk7xEFQwwXhJWMMdjUPi3cXL8NrFKQpKifG1U"
 
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8342"]
+# Skip syncing process and start node right away
+skip_sync = true
 
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8342"]
+## Localnet sync P2P network settings
+[network_config."localnet".sync_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48242"]
 
-# Connection slots for the syncing protocol
-#sync_slots = 8
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Seed nodes to connect to for the syncing protocol
-#sync_p2p_seed = []
-
-# Peers to connect to for the syncing protocol
-#sync_p2p_peer = []
-
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
-
-# Enable localnet hosts
+# Allow localnet hosts
 localnet = true
 
-# Enable channel log
-channel_log = true
+## Localnet miners P2P network settings
+[network_config."localnet".miners_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48241"]
 
-# Whitelisted faucet public key
-#faucet_pub = []
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Verify system clock is correct
-#clock_sync = true
+# Allow localnet hosts
+localnet = true

+ 40 - 50
contrib/localnet/darkfid-five-nodes/darkfid1.toml

@@ -6,71 +6,61 @@
 ## The default values are left commented. They can be overridden either by
 ## uncommenting, or by using the command-line.
 
-# Chain to use (testnet, mainnet)
-chain = "testnet"
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48440"
 
-# Path to the wallet database
-wallet_path = "darkfid1/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
+# Blockchain network to use
+network = "localnet"
 
+# Localnet blockchain network configuration
+[network_config."localnet"]
 # Path to the blockchain database directory
-database = "darkfid1/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8440"
+database = "darkfid1"
 
-# Participate in the consensus protocol
-consensus = true
+# Finalization threshold, denominated by number of blocks
+threshold = 3
 
-# Enable single-node mode for local testing
-single_node = false
+# minerd JSON-RPC endpoint
+minerd_endpoint = "tcp://127.0.0.1:48567"
 
-# P2P accept addresses for the consensus protocol
-consensus_p2p_accept = ["tcp://127.0.0.1:8441"]
+# PoW block production target, in seconds
+pow_target = 20
 
-# P2P external addresses for the consensus protocol
-consensus_p2p_external = ["tcp://127.0.0.1:8441"]
+# Participate in block production
+miner = true
 
-# Connection slots for the consensus protocol
-#consensus_slots = 8
+# Wallet address to receive mining rewards.
+# This is a dummy one so the miner can start,
+# replace with your own one.
+recipient = "9vw6WznKk7xEFQwwXhJWMMdjUPi3cXL8NrFKQpKifG1U"
 
-# Connection slots for the consensus protocol
-#consensus_p2p_seed = []
+# Skip syncing process and start node right away
+skip_sync = false
 
-# Peers to connect to for the consensus protocol
-consensus_p2p_peer = ["tcp://127.0.0.1:8341"]
+## Localnet sync P2P network settings
+[network_config."localnet".sync_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48342"]
 
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8442"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48242"]
 
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8442"]
-
-# Connection slots for the syncing protocol
-#sync_slots = 8
+# Allow localnet hosts
+localnet = true
 
-# Seed nodes to connect to for the syncing protocol
-#sync_p2p_seed = []
+## Localnet miners P2P network settings
+[network_config."localnet".miners_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48341"]
 
-# Peers to connect to for the syncing protocol
-sync_p2p_peer = ["tcp://127.0.0.1:8342"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48241"]
 
-# Enable localnet hosts
+# Allow localnet hosts
 localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Whitelisted faucet public key
-#faucet_pub = []
-
-# Verify system clock is correct
-#clock_sync = true

+ 40 - 50
contrib/localnet/darkfid-five-nodes/darkfid2.toml

@@ -6,71 +6,61 @@
 ## The default values are left commented. They can be overridden either by
 ## uncommenting, or by using the command-line.
 
-# Chain to use (testnet, mainnet)
-chain = "testnet"
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48540"
 
-# Path to the wallet database
-wallet_path = "darkfid2/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
+# Blockchain network to use
+network = "localnet"
 
+# Localnet blockchain network configuration
+[network_config."localnet"]
 # Path to the blockchain database directory
-database = "darkfid2/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8540"
+database = "darkfid2"
 
-# Participate in the consensus protocol
-consensus = true
+# Finalization threshold, denominated by number of blocks
+threshold = 3
 
-# Enable single-node mode for local testing
-single_node = false
+# minerd JSON-RPC endpoint
+minerd_endpoint = "tcp://127.0.0.1:48667"
 
-# P2P accept addresses for the consensus protocol
-consensus_p2p_accept = ["tcp://127.0.0.1:8541"]
+# PoW block production target, in seconds
+pow_target = 20
 
-# P2P external addresses for the consensus protocol
-consensus_p2p_external = ["tcp://127.0.0.1:8541"]
+# Participate in block production
+miner = true
 
-# Connection slots for the consensus protocol
-#consensus_slots = 8
+# Wallet address to receive mining rewards.
+# This is a dummy one so the miner can start,
+# replace with your own one.
+recipient = "9vw6WznKk7xEFQwwXhJWMMdjUPi3cXL8NrFKQpKifG1U"
 
-# Connection slots for the consensus protocol
-#consensus_p2p_seed = []
+# Skip syncing process and start node right away
+skip_sync = false
 
-# Peers to connect to for the consensus protocol
-consensus_p2p_peer = ["tcp://127.0.0.1:8341", "tcp://127.0.0.1:8441"]
+## Localnet sync P2P network settings
+[network_config."localnet".sync_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48442"]
 
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8542"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48242", "tcp+tls://0.0.0.0:48342"]
 
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8542"]
-
-# Connection slots for the syncing protocol
-#sync_slots = 8
+# Allow localnet hosts
+localnet = true
 
-# Seed nodes to connect to for the syncing protocol
-#sync_p2p_seed = []
+## Localnet miners P2P network settings
+[network_config."localnet".miners_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48441"]
 
-# Peers to connect to for the syncing protocol
-sync_p2p_peer = ["tcp://127.0.0.1:8342", "tcp://127.0.0.1:8442"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48241", "tcp+tls://0.0.0.0:48341"]
 
-# Enable localnet hosts
+# Allow localnet hosts
 localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Whitelisted faucet public key
-#faucet_pub = []
-
-# Verify system clock is correct
-#clock_sync = true

+ 40 - 50
contrib/localnet/darkfid-five-nodes/darkfid3.toml

@@ -6,71 +6,61 @@
 ## The default values are left commented. They can be overridden either by
 ## uncommenting, or by using the command-line.
 
-# Chain to use (testnet, mainnet)
-chain = "testnet"
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48640"
 
-# Path to the wallet database
-wallet_path = "darkfid3/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
+# Blockchain network to use
+network = "localnet"
 
+# Localnet blockchain network configuration
+[network_config."localnet"]
 # Path to the blockchain database directory
-database = "darkfid3/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8640"
+database = "darkfid3"
 
-# Participate in the consensus protocol
-consensus = true
+# Finalization threshold, denominated by number of blocks
+threshold = 3
 
-# Enable single-node mode for local testing
-single_node = false
+# minerd JSON-RPC endpoint
+minerd_endpoint = "tcp://127.0.0.1:48767"
 
-# P2P accept addresses for the consensus protocol
-consensus_p2p_accept = ["tcp://127.0.0.1:8641"]
+# PoW block production target, in seconds
+pow_target = 20
 
-# P2P external addresses for the consensus protocol
-consensus_p2p_external = ["tcp://127.0.0.1:8641"]
+# Participate in block production
+miner = true
 
-# Connection slots for the consensus protocol
-#consensus_slots = 8
+# Wallet address to receive mining rewards.
+# This is a dummy one so the miner can start,
+# replace with your own one.
+recipient = "9vw6WznKk7xEFQwwXhJWMMdjUPi3cXL8NrFKQpKifG1U"
 
-# Connection slots for the consensus protocol
-#consensus_p2p_seed = []
+# Skip syncing process and start node right away
+skip_sync = false
 
-# Peers to connect to for the consensus protocol
-consensus_p2p_peer = ["tcp://127.0.0.1:8341", "tcp://127.0.0.1:8441", "tcp://127.0.0.1:8541"]
+## Localnet sync P2P network settings
+[network_config."localnet".sync_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48542"]
 
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8642"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48242", "tcp+tls://0.0.0.0:48342", "tcp+tls://0.0.0.0:48442"]
 
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8642"]
-
-# Connection slots for the syncing protocol
-#sync_slots = 8
+# Allow localnet hosts
+localnet = true
 
-# Seed nodes to connect to for the syncing protocol
-#sync_p2p_seed = []
+## Localnet miners P2P network settings
+[network_config."localnet".miners_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48541"]
 
-# Peers to connect to for the syncing protocol
-sync_p2p_peer = ["tcp://127.0.0.1:8342", "tcp://127.0.0.1:8442", "tcp://127.0.0.1:8542"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48241", "tcp+tls://0.0.0.0:48341", "tcp+tls://0.0.0.0:48441"]
 
-# Enable localnet hosts
+# Allow localnet hosts
 localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Whitelisted faucet public key
-#faucet_pub = []
-
-# Verify system clock is correct
-#clock_sync = true

+ 40 - 50
contrib/localnet/darkfid-five-nodes/darkfid4.toml

@@ -6,71 +6,61 @@
 ## The default values are left commented. They can be overridden either by
 ## uncommenting, or by using the command-line.
 
-# Chain to use (testnet, mainnet)
-chain = "testnet"
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48740"
 
-# Path to the wallet database
-wallet_path = "darkfid4/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
+# Blockchain network to use
+network = "localnet"
 
+# Localnet blockchain network configuration
+[network_config."localnet"]
 # Path to the blockchain database directory
-database = "darkfid4/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8740"
+database = "darkfid4"
 
-# Participate in the consensus protocol
-consensus = true
+# Finalization threshold, denominated by number of blocks
+threshold = 3
 
-# Enable single-node mode for local testing
-single_node = false
+# minerd JSON-RPC endpoint
+minerd_endpoint = "tcp://127.0.0.1:48867"
 
-# P2P accept addresses for the consensus protocol
-consensus_p2p_accept = ["tcp://127.0.0.1:8741"]
+# PoW block production target, in seconds
+pow_target = 20
 
-# P2P external addresses for the consensus protocol
-consensus_p2p_external = ["tcp://127.0.0.1:8741"]
+# Participate in block production
+miner = true
 
-# Connection slots for the consensus protocol
-#consensus_slots = 8
+# Wallet address to receive mining rewards.
+# This is a dummy one so the miner can start,
+# replace with your own one.
+recipient = "9vw6WznKk7xEFQwwXhJWMMdjUPi3cXL8NrFKQpKifG1U"
 
-# Connection slots for the consensus protocol
-#consensus_p2p_seed = []
+# Skip syncing process and start node right away
+skip_sync = false
 
-# Peers to connect to for the consensus protocol
-consensus_p2p_peer = ["tcp://127.0.0.1:8341", "tcp://127.0.0.1:8441", "tcp://127.0.0.1:8541", "tcp://127.0.0.1:8641"]
+## Localnet sync P2P network settings
+[network_config."localnet".sync_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48642"]
 
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8742"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48242", "tcp+tls://0.0.0.0:48342", "tcp+tls://0.0.0.0:48442", "tcp+tls://0.0.0.0:48542"]
 
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8742"]
-
-# Connection slots for the syncing protocol
-#sync_slots = 8
+# Allow localnet hosts
+localnet = true
 
-# Seed nodes to connect to for the syncing protocol
-#sync_p2p_seed = []
+## Localnet miners P2P network settings
+[network_config."localnet".miners_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48641"]
 
-# Peers to connect to for the syncing protocol
-sync_p2p_peer = ["tcp://127.0.0.1:8342", "tcp://127.0.0.1:8442", "tcp://127.0.0.1:8542", "tcp://127.0.0.1:8642"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48241", "tcp+tls://0.0.0.0:48341", "tcp+tls://0.0.0.0:48441", "tcp+tls://0.0.0.0:48541"]
 
-# Enable localnet hosts
+# Allow localnet hosts
 localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Whitelisted faucet public key
-#faucet_pub = []
-
-# Verify system clock is correct
-#clock_sync = true

+ 0 - 33
contrib/localnet/darkfid-five-nodes/logproc.py

@@ -1,33 +0,0 @@
-import matplotlib.pyplot as plt
-import numpy as np
-
-LEAD_FILE = "/tmp/lead_history.log"
-F_FILE = "/tmp/f_history.log"
-
-LEAD_PROCESSED_IMG = "/tmp/lead_history_processed.png"
-F_PROCESSED_IMG = "/tmp/f_history_processed.png"
-
-SEP = ","
-NODES = 5 # nuber of nodes logged
-
-with open(LEAD_FILE) as f:
-    buf = f.read()
-    nodes = buf.split(SEP)[:-1]
-    node_log = []
-    for i in range(0, len(nodes), NODES):
-        assert (nodes[i]==nodes[i+1]==nodes[i+2]==nodes[i+3]==nodes[i+4])
-        node_log+=[int(nodes[i])]
-    freq_single_lead = sum(np.array(node_log)==1)/float(len(node_log))
-    print("single leader frequency: {}".format(freq_single_lead))
-    plt.plot(node_log)
-    plt.savefig(LEAD_PROCESSED_IMG)
-
-with open(F_FILE) as f:
-    buf = f.read()
-    nodes = buf.split(SEP)[:-1]
-    node_log = []
-    for i in range(0, len(nodes), NODES):
-        assert (nodes[i]==nodes[i+1]==nodes[i+2]==nodes[i+3]==nodes[i+4])
-        node_log+=[float(nodes[i])]
-    plt.plot(node_log)
-    plt.savefig(F_PROCESSED_IMG)

+ 13 - 0
contrib/localnet/darkfid-five-nodes/minerd0.toml

@@ -0,0 +1,13 @@
+## minerd configuration file
+##
+## Please make sure you go through all the settings so you can configure
+## your daemon properly.
+##
+## The default values are left commented. They can be overridden either by
+## uncommenting, or by using the command-line.
+
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48467"
+
+# PoW miner number of threads to use
+threads = 2

+ 13 - 0
contrib/localnet/darkfid-five-nodes/minerd1.toml

@@ -0,0 +1,13 @@
+## minerd configuration file
+##
+## Please make sure you go through all the settings so you can configure
+## your daemon properly.
+##
+## The default values are left commented. They can be overridden either by
+## uncommenting, or by using the command-line.
+
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48567"
+
+# PoW miner number of threads to use
+threads = 2

+ 13 - 0
contrib/localnet/darkfid-five-nodes/minerd2.toml

@@ -0,0 +1,13 @@
+## minerd configuration file
+##
+## Please make sure you go through all the settings so you can configure
+## your daemon properly.
+##
+## The default values are left commented. They can be overridden either by
+## uncommenting, or by using the command-line.
+
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48667"
+
+# PoW miner number of threads to use
+threads = 2

+ 13 - 0
contrib/localnet/darkfid-five-nodes/minerd3.toml

@@ -0,0 +1,13 @@
+## minerd configuration file
+##
+## Please make sure you go through all the settings so you can configure
+## your daemon properly.
+##
+## The default values are left commented. They can be overridden either by
+## uncommenting, or by using the command-line.
+
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48767"
+
+# PoW miner number of threads to use
+threads = 2

+ 13 - 0
contrib/localnet/darkfid-five-nodes/minerd4.toml

@@ -0,0 +1,13 @@
+## minerd configuration file
+##
+## Please make sure you go through all the settings so you can configure
+## your daemon properly.
+##
+## The default values are left commented. They can be overridden either by
+## uncommenting, or by using the command-line.
+
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48867"
+
+# PoW miner number of threads to use
+threads = 2

+ 23 - 12
contrib/localnet/darkfid-five-nodes/tmux_sessions.sh

@@ -1,31 +1,42 @@
 #!/bin/sh
 set -e
 
-# Start a tmux session with 5 consensus nodes.
+# Start a tmux session with five minerd daemons and five darkfid nodes
 
-if [ "$1" = "-v" ]; then
-	verbose="-v"
+if [ "$1" = "-vv" ]; then
+	verbose="-vv"
+	shift
 else
 	verbose=""
 fi
 
-touch /tmp/f_history.log
-touch /tmp/lead_history.log
-touch /tmp/lottery_history.log
-
 tmux new-session -d
+tmux send-keys "../../../minerd ${verbose} -c minerd0.toml" Enter
+sleep 1
+tmux split-window -v
 tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid0.toml" Enter
 sleep 2
-tmux split-window -h
+tmux new-window
+tmux send-keys "../../../minerd ${verbose} -c minerd1.toml" Enter
+sleep 1
+tmux split-window -v
 tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid1.toml" Enter
 sleep 2
-tmux split-window -h
+tmux new-window
+tmux send-keys "../../../minerd ${verbose} -c minerd2.toml" Enter
+sleep 1
+tmux split-window -v
 tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid2.toml" Enter
 sleep 2
-tmux split-window -h
+tmux new-window
+tmux send-keys "../../../minerd ${verbose} -c minerd3.toml" Enter
+sleep 1
+tmux split-window -v
 tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid3.toml" Enter
 sleep 2
-tmux split-window -h
+tmux new-window
+tmux send-keys "../../../minerd ${verbose} -c minerd4.toml" Enter
+sleep 1
+tmux split-window -v
 tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid4.toml" Enter
-tmux select-layout even-horizontal
 tmux attach

+ 4 - 4
contrib/localnet/darkfid-single-node/README.md

@@ -1,13 +1,13 @@
 darkfid localnet
 ================
 
-This will start one darkfid node in localnet mode,
-along with a minerd daemon to mine blocks.
+This will start one `darkfid` node in localnet mode,
+along with a `minerd` daemon to mine blocks.
 
 If we want to test wallet stuff, we must generate
-a testing wallet and pass its address to the darkfid
+a testing wallet and pass its address to the `darkfid`
 config, so the wallet gets the block rewards the node
-produces. First we start darkfid and wait until its
+produces. First we start `darkfid` and wait until its
 initialized:
 ```
 % ./tmux_sessions.sh

+ 3 - 0
contrib/localnet/darkfid-single-node/minerd.toml

@@ -8,3 +8,6 @@
 
 # JSON-RPC listen URL
 rpc_listen = "tcp://127.0.0.1:48467"
+
+# PoW miner number of threads to use
+#threads = 4

+ 5 - 2
contrib/localnet/darkfid-small/README.md

@@ -1,5 +1,8 @@
 darkfid localnet
 ================
 
-This will start three darkfid. Two of the darkfid participate 
-in the consensus, and one is just a sync node.
+This will start three `darkfid` node instances
+in localnet mode. Two of the nodes are activelly
+mining, while the other one is just a sync node.
+We also start two `minerd` daemons to mine blocks,
+one for each of the `darkfid` mining nodes.

+ 36 - 52
contrib/localnet/darkfid-small/darkfid0.toml

@@ -6,71 +6,55 @@
 ## The default values are left commented. They can be overridden either by
 ## uncommenting, or by using the command-line.
 
-# Chain to use (testnet, mainnet)
-chain = "testnet"
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48340"
 
-# Path to the wallet database
-wallet_path = "darkfid0/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
+# Blockchain network to use
+network = "localnet"
 
+# Localnet blockchain network configuration
+[network_config."localnet"]
 # Path to the blockchain database directory
-database = "darkfid0/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8340"
-
-# Participate in the consensus protocol
-consensus = true
-
-# Enable single-node mode for local testing
-single_node = false
-
-# P2P accept addresses for the consensus protocol
-consensus_p2p_accept = ["tcp://127.0.0.1:8341"]
+database = "darkfid0"
 
-# P2P external addresses for the consensus protocol
-consensus_p2p_external = ["tcp://127.0.0.1:8341"]
+# Finalization threshold, denominated by number of blocks
+threshold = 3
 
-# Connection slots for the consensus protocol
-#consensus_slots = 8
+# minerd JSON-RPC endpoint
+minerd_endpoint = "tcp://127.0.0.1:48467"
 
-# Connection slots for the consensus protocol
-#consensus_p2p_seed = []
+# PoW block production target, in seconds
+pow_target = 20
 
-# Peers to connect to for the consensus protocol
-#consensus_p2p_peer = []
+# Participate in block production
+miner = true
 
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
+# Wallet address to receive mining rewards.
+# This is a dummy one so the miner can start,
+# replace with your own one.
+recipient = "9vw6WznKk7xEFQwwXhJWMMdjUPi3cXL8NrFKQpKifG1U"
 
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8342"]
+# Skip syncing process and start node right away
+skip_sync = true
 
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8342"]
+## Localnet sync P2P network settings
+[network_config."localnet".sync_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48242"]
 
-# Connection slots for the syncing protocol
-#sync_slots = 8
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Seed nodes to connect to for the syncing protocol
-#sync_p2p_seed = []
-
-# Peers to connect to for the syncing protocol
-#sync_p2p_peer = []
-
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
-
-# Enable localnet hosts
+# Allow localnet hosts
 localnet = true
 
-# Enable channel log
-channel_log = true
+## Localnet miners P2P network settings
+[network_config."localnet".miners_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48241"]
 
-# Whitelisted faucet public key
-#faucet_pub = []
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Verify system clock is correct
-#clock_sync = true
+# Allow localnet hosts
+localnet = true

+ 47 - 49
contrib/localnet/darkfid-small/darkfid1.toml

@@ -6,71 +6,69 @@
 ## The default values are left commented. They can be overridden either by
 ## uncommenting, or by using the command-line.
 
-# Chain to use (testnet, mainnet)
-chain = "testnet"
+## darkfid configuration file
+##
+## Please make sure you go through all the settings so you can configure
+## your daemon properly.
+##
+## The default values are left commented. They can be overridden either by
+## uncommenting, or by using the command-line.
 
-# Path to the wallet database
-wallet_path = "darkfid1/wallet.db"
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48440"
 
-# Password for the wallet database
-wallet_pass = "changeme"
+# Blockchain network to use
+network = "localnet"
 
+# Localnet blockchain network configuration
+[network_config."localnet"]
 # Path to the blockchain database directory
-database = "darkfid1/blockchain"
+database = "darkfid1"
 
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8440"
+# Finalization threshold, denominated by number of blocks
+threshold = 3
 
-# Participate in the consensus protocol
-consensus = true
+# minerd JSON-RPC endpoint
+minerd_endpoint = "tcp://127.0.0.1:48567"
 
-# Enable single-node mode for local testing
-single_node = false
+# PoW block production target, in seconds
+pow_target = 20
 
-# P2P accept addresses for the consensus protocol
-consensus_p2p_accept = ["tcp://127.0.0.1:8441"]
+# Participate in block production
+miner = true
 
-# P2P external addresses for the consensus protocol
-consensus_p2p_external = ["tcp://127.0.0.1:8441"]
+# Wallet address to receive mining rewards.
+# This is a dummy one so the miner can start,
+# replace with your own one.
+recipient = "9vw6WznKk7xEFQwwXhJWMMdjUPi3cXL8NrFKQpKifG1U"
 
-# Connection slots for the consensus protocol
-#consensus_slots = 8
+# Skip syncing process and start node right away
+skip_sync = false
 
-# Connection slots for the consensus protocol
-#consensus_p2p_seed = []
+## Localnet sync P2P network settings
+[network_config."localnet".sync_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48342"]
 
-# Peers to connect to for the consensus protocol
-consensus_p2p_peer = ["tcp://127.0.0.1:8341"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48242"]
 
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8442"]
-
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8442"]
-
-# Connection slots for the syncing protocol
-#sync_slots = 8
+# Allow localnet hosts
+localnet = true
 
-# Seed nodes to connect to for the syncing protocol
-#sync_p2p_seed = []
+## Localnet miners P2P network settings
+[network_config."localnet".miners_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48341"]
 
-# Peers to connect to for the syncing protocol
-sync_p2p_peer = ["tcp://127.0.0.1:8342"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48241"]
 
-# Enable localnet hosts
+# Allow localnet hosts
 localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Whitelisted faucet public key
-#faucet_pub = []
-
-# Verify system clock is correct
-#clock_sync = true

+ 24 - 56
contrib/localnet/darkfid-small/darkfid2.toml

@@ -6,71 +6,39 @@
 ## The default values are left commented. They can be overridden either by
 ## uncommenting, or by using the command-line.
 
-# Chain to use (testnet, mainnet)
-chain = "testnet"
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48540"
 
-# Path to the wallet database
-wallet_path = "darkfid2/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
+# Blockchain network to use
+network = "localnet"
 
+# Localnet blockchain network configuration
+[network_config."localnet"]
 # Path to the blockchain database directory
-database = "darkfid2/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8540"
-
-# Participate in the consensus protocol
-consensus = false
-
-# Enable single-node mode for local testing
-single_node = false
-
-# P2P accept addresses for the consensus protocol
-#consensus_p2p_accept = ["tcp://127.0.0.1:8541"]
-
-# P2P external addressesfor the consensus protocol
-#consensus_p2p_external = ["tcp://127.0.0.1:8541"]
+database = "darkfid2"
 
-# Connection slots for the consensus protocol
-#consensus_slots = 8
+# Finalization threshold, denominated by number of blocks
+threshold = 3
 
-# Connection slots for the consensus protocol
-#consensus_p2p_seed = ["tcp://127.0.0.1:33033"]
+# PoW block production target, in seconds
+pow_target = 20
 
-# Peers to connect to for the consensus protocol
-#consensus_p2p_peer = []
+# Participate in block production
+miner = false
 
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
+# Skip syncing process and start node right away
+skip_sync = false
 
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8542"]
+## Localnet sync P2P network settings
+[network_config."localnet".sync_net]
+# P2P accept addresses the instance listens on for inbound connections
+inbound = ["tcp+tls://0.0.0.0:48442"]
 
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8542"]
+# Whitelisted network transports for outbound connections
+allowed_transports = ["tcp+tls"]
 
-# Connection slots for the syncing protocol
-#sync_slots = 8
+# Peer nodes to manually connect to
+peers = ["tcp+tls://0.0.0.0:48242", "tcp+tls://0.0.0.0:48342"]
 
-# Seed nodes to connect to for the syncing protocol
-#sync_p2p_seed = []
-
-# Peers to connect to for the syncing protocol
-sync_p2p_peer = ["tcp://127.0.0.1:8342", "tcp://127.0.0.1:8442"]
-
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
-
-# Enable localnet hosts
+# Allow localnet hosts
 localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Whitelisted faucet public key
-#faucet_pub = []
-
-# Verify system clock is correct
-#clock_sync = true

+ 13 - 0
contrib/localnet/darkfid-small/minerd0.toml

@@ -0,0 +1,13 @@
+## minerd configuration file
+##
+## Please make sure you go through all the settings so you can configure
+## your daemon properly.
+##
+## The default values are left commented. They can be overridden either by
+## uncommenting, or by using the command-line.
+
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48467"
+
+# PoW miner number of threads to use
+threads = 2

+ 13 - 0
contrib/localnet/darkfid-small/minerd1.toml

@@ -0,0 +1,13 @@
+## minerd configuration file
+##
+## Please make sure you go through all the settings so you can configure
+## your daemon properly.
+##
+## The default values are left commented. They can be overridden either by
+## uncommenting, or by using the command-line.
+
+# JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:48567"
+
+# PoW miner number of threads to use
+threads = 2

+ 14 - 8
contrib/localnet/darkfid-small/tmux_sessions.sh

@@ -1,22 +1,28 @@
 #!/bin/sh
 set -e
 
-# Start a tmux session with two consensus and a non-consensus node.
+# Start a tmux session with two mining and a non-mining darkfid nodes.
+# Additionally, start two minerd daemons.
 
-if [ "$1" = "-v" ]; then
-	verbose="-v"
+if [ "$1" = "-vv" ]; then
+	verbose="-vv"
+	shift
 else
 	verbose=""
 fi
 
 tmux new-session -d
-tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid0.toml" Enter
+tmux send-keys "../../../minerd ${verbose} -c minerd0.toml" Enter
+sleep 1
 tmux split-window -v
+tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid0.toml" Enter
 sleep 2
-tmux select-pane -t 0
-tmux split-window -h
+tmux new-window
+tmux send-keys "../../../minerd ${verbose} -c minerd1.toml" Enter
+sleep 1
+tmux split-window -v
 tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid1.toml" Enter
 sleep 2
-tmux select-pane -t 2
-tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid2.toml" Enter 
+tmux new-window
+tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid2.toml" Enter
 tmux attach

+ 0 - 5
contrib/localnet/darkfid/.gitignore

@@ -1,5 +0,0 @@
-faucetd/blockchain
-darkfid0
-darkfid1
-darkfid2
-lilith_hosts.tsv

+ 0 - 124
contrib/localnet/darkfid/README.md

@@ -1,124 +0,0 @@
-darkfid localnet
-================
-
-This will start three darkfid and one faucetd network. Two of the
-darkfid participate in the consensus, and one is just a sync node.
-
-The faucetd is able to airdrop arbitrary tokens into wallets.
-
-|   Node     |     RPC endpoint       | Consensus |
-|------------|------------------------|-----------|
-| `darkfid0` | `tcp://127.0.0.1:8340` |  `true`   |
-| `darkfid1` | `tcp://127.0.0.1:8440` |  `true`   |
-| `darkfid2` | `tcp://127.0.0.1:8540` |  `false`  |
-| `faucetd`  | `tcp://127.0.0.1:8640` |  `false`  |
-
-## Initialize wallets
-
-```
-$ ./drk -e tcp://127.0.0.1:8340 wallet --initialize
-$ ./drk -e tcp://127.0.0.1:8340 wallet --keygen
-
-$ ./drk -e tcp://127.0.0.1:8440 wallet --initialize
-$ ./drk -e tcp://127.0.0.1:8440 wallet --keygen
-
-$ ./drk -e tcp://127.0.0.1:8540 wallet --initialize
-$ ./drk -e tcp://127.0.0.1:8540 wallet --keygen
-```
-
-Make note of the addresses given by `keygen`.
-
-## Airdrops
-
-Let's airdrop some money do `darkfid1` and `darkfid2`. For this to
-work, we also need to subscribe to their RPC endpoints so we can scan
-incoming blocks and add them to our wallet.
-
-```
-$ ./drk -e tcp://127.0.0.1:8440 subscribe blocks
-$ ./drk -e tcp://127.0.0.1:8540 subscribe blocks
-```
-
-And now we can execute our airdrop calls:
-
-```
-$ ./drk -e tcp://127.0.0.1:8440 airdrop -f tcp://127.0.0.1:8640 \
-    15.57 A7f1RKsCUUHrSXA7a9ogmwg8p3bs6F47ggsW826HD4yd
-
-$ ./drk -e tcp://127.0.0.1:8540 airdrop -f tcp://127.0.0.1:8640 \
-    66.31 BNBZ9YprWvEGMYHW4dFvbLuLfHnN9Bs64zuTFQAbw9Dy
-```
-
-If successful, `drk` should give a transaction ID. Now watch the
-network and wait until the blocks with these transactions get
-finalized.
-
-Then you can check the wallets' balances:
-
-```
-$ ./drk -e tcp://127.0.0.1:8440 wallet --balance
-$ ./drk -e tcp://127.0.0.1:8540 wallet --balance
-```
-
-## Payments
-
-Now let's try to send a little bit of funds from `darkfid1` to
-`darkfid2`:
-
-```
-$ ./drk -e tcp://127.0.0.1:8440 transfer 1.33 \
-    A7f1RKsCUUHrSXA7a9ogmwg8p3bs6F47ggsW826HD4yd \
-    6uw3S12RWnhikrrTrtVsTJFQQdc5i9QWoVLUEfGd8B5Z \
-    > transaction
-```
-
-The command will build proving keys, and create a transaction on
-stdout which you should redirect into a file.
-
-You can optionally inspect this transaction:
-
-```
-$ ./drk -e tcp://127.0.0.1:8440 inspect < transaction
-```
-
-And then we broadcast it:
-
-```
-$ ./drk -e tcp://127.0.0.1:8440 broadcast < transaction
-```
-
-On success, you should see a transaction ID.
-
-Now wait again until the tx is finalized and scanned by your `drk`
-subscribers so you'll see the balance changes.
-
-
-## Swaps
-
-We can also try to swap some coins between `darkfid1` and `darkfid2`.
-
-First `darkfid1` will initiate the 1st half of the swap, and send it
-to `darkfid2`:
-
-```
-$ ./drk -e tcp://127.0.0.1:8440 otc init \
-    -v 14.24:66.41 \
-    -t A7f1RKsCUUHrSXA7a9ogmwg8p3bs6F47ggsW826HD4yd:BNBZ9YprWvEGMYHW4dFvbLuLfHnN9Bs64zuTFQAbw9Dy \
-    > half_swap
-```
-
-Then `darkfid2` can create the second half and send it back to
-`darkfid1`:
-
-```
-$ ./drk -e tcp://127.0.0.1:8540 otc join < half_swap > full_swap
-```
-
-And finally `darkfid1` can sign and broadcast it:
-
-```
-$ ./drk -e tcp://127.0.0.1:8440 otc sign < full_swap > signed_swap
-$ ./drk -e tcp://127.0.0.1:8440 broadcast < signed_swap
-```
-
-After finalization, the balances should update.

+ 0 - 3
contrib/localnet/darkfid/clean.sh

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

+ 0 - 77
contrib/localnet/darkfid/darkfid0.toml

@@ -1,77 +0,0 @@
-## darkfid configuration file
-##
-## Please make sure you go through all the settings so you can configure
-## your daemon properly.
-##
-## The default values are left commented. They can be overridden either by
-## uncommenting, or by using the command-line.
-
-# Chain to use (testnet, mainnet)
-chain = "testnet"
-
-# Path to the wallet database
-wallet_path = "darkfid0/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
-
-# Path to the blockchain database directory
-database = "darkfid0/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8340"
-
-# Participate in the consensus protocol
-consensus = true
-
-# Enable single-node mode for local testing
-single_node = false
-
-# P2P accept addresses for the consensus protocol
-consensus_p2p_accept = ["tcp://127.0.0.1:8341"]
-
-# P2P external addresses for the consensus protocol
-consensus_p2p_external = ["tcp://127.0.0.1:8341"]
-
-# Connection slots for the consensus protocol
-#consensus_slots = 8
-
-# Connection slots for the consensus protocol
-consensus_p2p_seed = ["tcp://127.0.0.1:33033"]
-
-# Peers to connect to for the consensus protocol
-#consensus_p2p_peer = []
-
-
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
-
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8342"]
-
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8342"]
-
-# Connection slots for the syncing protocol
-#sync_slots = 8
-
-# Seed nodes to connect to for the syncing protocol
-sync_p2p_seed = ["tcp://127.0.0.1:33032"]
-
-# Peers to connect to for the syncing protocol
-#sync_p2p_peer = []
-
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
-
-# Enable localnet hosts
-localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Whitelisted faucet public key
-faucet_pub = ["DqaZzCTipXeJw4kcc6ro1SJuzo3diaNjFiaAnKTGQEK1"]
-
-# Verify system clock is correct
-#clock_sync = true

+ 0 - 82
contrib/localnet/darkfid/darkfid1.toml

@@ -1,82 +0,0 @@
-## darkfid configuration file
-##
-## Please make sure you go through all the settings so you can configure
-## your daemon properly.
-##
-## The default values are left commented. They can be overridden either by
-## uncommenting, or by using the command-line.
-
-# Chain to use (testnet, mainnet)
-chain = "testnet"
-
-# Path to the wallet database
-wallet_path = "darkfid1/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
-
-# Path to the blockchain database directory
-database = "darkfid1/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8440"
-
-# Participate in the consensus protocol
-consensus = true
-
-# Enable single-node mode for local testing
-single_node = false
-
-# P2P accept addresses for the consensus protocol
-consensus_p2p_accept = ["tcp://127.0.0.1:8441"]
-
-# P2P external addresses for the consensus protocol
-consensus_p2p_external = ["tcp://127.0.0.1:8441"]
-
-# Connection slots for the consensus protocol
-#consensus_slots = 8
-
-# Connection slots for the consensus protocol
-consensus_p2p_seed = ["tcp://127.0.0.1:33033"]
-
-# Seed nodes JSON-RPC listen URL for clock synchronization
-consensus_seed_rpc = ["tcp://127.0.0.1:8340"]
-
-# Peers to connect to for the consensus protocol
-#consensus_p2p_peer = []
-
-# Peers JSON-RPC listen URL for clock synchronization
-#consensus_peer_rpc = []
-
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
-
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8442"]
-
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8442"]
-
-# Connection slots for the syncing protocol
-#sync_slots = 8
-
-# Seed nodes to connect to for the syncing protocol
-sync_p2p_seed = ["tcp://127.0.0.1:33032"]
-
-# Peers to connect to for the syncing protocol
-#sync_p2p_peer = []
-
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
-
-# Enable localnet hosts
-localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Whitelisted faucet public key
-faucet_pub = ["DqaZzCTipXeJw4kcc6ro1SJuzo3diaNjFiaAnKTGQEK1"]
-
-# Verify system clock is correct
-#clock_sync = true

+ 0 - 76
contrib/localnet/darkfid/darkfid2.toml

@@ -1,76 +0,0 @@
-## darkfid configuration file
-##
-## Please make sure you go through all the settings so you can configure
-## your daemon properly.
-##
-## The default values are left commented. They can be overridden either by
-## uncommenting, or by using the command-line.
-
-# Chain to use (testnet, mainnet)
-chain = "testnet"
-
-# Path to the wallet database
-wallet_path = "darkfid2/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
-
-# Path to the blockchain database directory
-database = "darkfid2/blockchain"
-
-# JSON-RPC listen url
-rpc_listen = "tcp://127.0.0.1:8540"
-
-# Participate in the consensus protocol
-consensus = false
-
-# Enable single-node mode for local testing
-single_node = false
-
-# P2P accept addresses for the consensus protocol
-#consensus_p2p_accept = ["tcp://127.0.0.1:8541"]
-
-# P2P external addressesfor the consensus protocol
-#consensus_p2p_external = ["tcp://127.0.0.1:8541"]
-
-# Connection slots for the consensus protocol
-#consensus_slots = 8
-
-# Connection slots for the consensus protocol
-#consensus_p2p_seed = ["tcp://127.0.0.1:33033"]
-
-# Peers to connect to for the consensus protocol
-#consensus_p2p_peer = []
-
-# Prefered transports of outbound connections for the consensus protocol
-consensus_p2p_transports = ["tls", "tcp"]
-
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8542"]
-
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8542"]
-
-# Connection slots for the syncing protocol
-#sync_slots = 8
-
-# Seed nodes to connect to for the syncing protocol
-sync_p2p_seed = ["tcp://127.0.0.1:33032"]
-
-# Peers to connect to for the syncing protocol
-#sync_p2p_peer = []
-
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
-
-# Enable localnet hosts
-localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Whitelisted faucet public key
-faucet_pub = ["DqaZzCTipXeJw4kcc6ro1SJuzo3diaNjFiaAnKTGQEK1"]
-
-# Verify system clock is correct
-#clock_sync = true

+ 0 - 55
contrib/localnet/darkfid/faucetd.toml

@@ -1,55 +0,0 @@
-## faucetd configuration file
-##
-## Please make sure you go through all the settings so you can configure
-## your daemon properly.
-##
-## The default values are left commented. They can be overridden either by
-## uncommenting, or by using the command-line.
-
-# Chain to use (testnet, mainnet)
-chain = "testnet"
-
-# Path to the wallet database
-wallet_path = "faucetd/wallet.db"
-
-# Password for the wallet database
-wallet_pass = "changeme"
-
-# Path to the blockchain database directory
-database = "faucetd/blockchain"
-
-# JSON-RPC listen URL
-rpc_listen = "tcp://127.0.0.1:8640"
-
-# P2P accept addresses for the syncing protocol
-sync_p2p_accept = ["tcp://127.0.0.1:8642"]
-
-# P2P external addresses for the syncing protocol
-sync_p2p_external = ["tcp://127.0.0.1:8642"]
-
-# Connection slots for the syncing protocol
-#sync_slots = 8
-
-# Seed nodes to connect to for the syncing protocol
-sync_p2p_seed = ["tcp://127.0.0.1:33032"]
-
-# Peers to connect to for the syncing protocol
-#sync_p2p_peer = []
-
-# Prefered transports of outbound connections for the syncing protocol
-sync_p2p_transports = ["tls", "tcp"]
-
-# Enable localnet hosts
-localnet = true
-
-# Enable channel log
-channel_log = true
-
-# Airdrop timeout limit in seconds
-airdrop_timeout = 120
-
-# Airdrop amount limit
-airdrop_limit = "1000000"
-
-# Whitelisted faucet addresses
-faucet_pub = ["DqaZzCTipXeJw4kcc6ro1SJuzo3diaNjFiaAnKTGQEK1"]

BIN
contrib/localnet/darkfid/faucetd/wallet.db


+ 0 - 41
contrib/localnet/darkfid/lilith_config.toml

@@ -1,41 +0,0 @@
-## lilith configuration file
-##
-## Please make sure you go through all the settings so you can configure
-## your daemon properly.
-##
-## The default values are left commented. They can be overridden either by
-## uncommenting, or by using the command-line.
-
-# JSON-RPC listen URL
-#rpc_listen = "tcp://127.0.0.1:18927"
-
-# Daemon published urls, common for all enabled networks
-urls = ["tcp://127.0.0.1"]
-
-# Hosts .tsv file to use
-hosts_file="lilith_hosts.tsv"
-
-## Per-network settings
-[network."darkfid_sync"]
-port = 33032
-#seeds = []
-#peers = []
-localnet = true
-channel_log = true
-
-[network."darkfid_consensus"]
-port = 33033
-#seeds = []
-#peers = []
-localnet = true
-channel_log = true
-
-#[network."ircd"]
-#port = 25551
-#seeds = []
-#peers = []
-
-#[network."taud"]
-#port = 23331
-#seeds = []
-#peers = []

+ 0 - 30
contrib/localnet/darkfid/tmux_sessions.sh

@@ -1,30 +0,0 @@
-#!/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.
-
-if [ "$1" = "-v" ]; then
-	verbose="-v"
-else
-	verbose=""
-fi
-
-tmux new-session -d
-tmux send-keys "LOG_TARGETS='!MessageSubsystem::notify' ../../../lilith ${verbose} -c lilith_config.toml" Enter
-sleep 10
-tmux split-window -v
-tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid0.toml" Enter
-sleep 10
-tmux select-pane -t 0
-tmux split-window -h
-tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid1.toml" Enter
-sleep 10
-tmux select-pane -t 1
-tmux split-window -h
-tmux send-keys "LOG_TARGETS='!sled' ../../../darkfid ${verbose} -c darkfid2.toml" Enter
-sleep 10
-tmux select-pane -t 3
-tmux split-window -h
-tmux send-keys "LOG_TARGETS='!sled,!net' ../../../faucetd ${verbose} -c faucetd.toml" Enter
-tmux attach