Преглед на файлове

contrib/localnet/darkfid*: updated all localnet configs and scripts to use xmrig

skoupidi преди 7 месеца
родител
ревизия
86a6b1e87c
променени са 25 файла, в които са добавени 127 реда и са изтрити 450 реда
  1. 23 2
      bin/darkfid/darkfid_config.toml
  2. 2 3
      contrib/localnet/darkfid-five-nodes/README.md
  3. 5 0
      contrib/localnet/darkfid-five-nodes/darkfid0.toml
  4. 5 0
      contrib/localnet/darkfid-five-nodes/darkfid1.toml
  5. 5 0
      contrib/localnet/darkfid-five-nodes/darkfid2.toml
  6. 5 0
      contrib/localnet/darkfid-five-nodes/darkfid3.toml
  7. 5 0
      contrib/localnet/darkfid-five-nodes/darkfid4.toml
  8. 0 48
      contrib/localnet/darkfid-five-nodes/minerd0.toml
  9. 0 48
      contrib/localnet/darkfid-five-nodes/minerd1.toml
  10. 0 48
      contrib/localnet/darkfid-five-nodes/minerd2.toml
  11. 0 48
      contrib/localnet/darkfid-five-nodes/minerd3.toml
  12. 0 48
      contrib/localnet/darkfid-five-nodes/minerd4.toml
  13. 15 21
      contrib/localnet/darkfid-five-nodes/tmux_sessions.sh
  14. 14 13
      contrib/localnet/darkfid-single-node/README.md
  15. 1 1
      contrib/localnet/darkfid-single-node/clean.sh
  16. 9 1
      contrib/localnet/darkfid-single-node/darkfid.toml
  17. 2 2
      contrib/localnet/darkfid-single-node/init-wallet.sh
  18. 0 50
      contrib/localnet/darkfid-single-node/minerd.toml
  19. 12 6
      contrib/localnet/darkfid-single-node/tmux_sessions.sh
  20. 5 5
      contrib/localnet/darkfid-small/README.md
  21. 5 0
      contrib/localnet/darkfid-small/darkfid0.toml
  22. 5 0
      contrib/localnet/darkfid-small/darkfid1.toml
  23. 0 48
      contrib/localnet/darkfid-small/minerd0.toml
  24. 0 48
      contrib/localnet/darkfid-small/minerd1.toml
  25. 9 10
      contrib/localnet/darkfid-small/tmux_sessions.sh

+ 23 - 2
bin/darkfid/darkfid_config.toml

@@ -43,8 +43,13 @@ rpc_listen = "tcp://127.0.0.1:8340"
 # Disabled RPC methods
 rpc_disabled_methods = ["p2p.get_info"]
 
-[network_config."testnet".stratum_rpc]
-rpc_listen = "tcp://127.0.0.1:8341"
+## Testnet JSON-RPC settings for stratum mining requests (optional)
+#[network_config."testnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+#rpc_listen = "tcp://127.0.0.1:8341"
+
+# Disabled RPC methods (stratum mining)
+#rpc_disabled_methods = []
 
 ## Testnet JSON-RPC settings for p2pool merge mining requests (optional)
 #[network_config."testnet".mm_rpc]
@@ -169,6 +174,14 @@ rpc_listen = "tcp://127.0.0.1:8440"
 # Disabled RPC methods
 rpc_disabled_methods = ["p2p.get_info"]
 
+## Mainnet JSON-RPC settings for stratum mining requests (optional)
+#[network_config."mainnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+#rpc_listen = "tcp://127.0.0.1:8441"
+
+# Disabled RPC methods (stratum mining)
+#rpc_disabled_methods = []
+
 ## Mainnet JSON-RPC settings for p2pool merge mining requests (optional)
 #[network_config."mainnet".mm_rpc]
 # JSON-RPC listen URL (merge mining)
@@ -297,6 +310,14 @@ rpc_listen = "tcp://127.0.0.1:8240"
 # Disabled RPC methods
 rpc_disabled_methods = ["p2p.get_info"]
 
+## Localnet JSON-RPC settings for stratum mining requests (optional)
+#[network_config."localnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+#rpc_listen = "tcp://127.0.0.1:8241"
+
+# Disabled RPC methods (stratum mining)
+#rpc_disabled_methods = []
+
 ## Localnet JSON-RPC settings for p2pool merge mining requests (optional)
 #[network_config."localnet".mm_rpc]
 # JSON-RPC listen URL (merge mining)

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

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

+ 5 - 0
contrib/localnet/darkfid-five-nodes/darkfid0.toml

@@ -43,6 +43,11 @@ rpc_listen = "tcp://127.0.0.1:48240"
 # Disabled RPC methods
 #rpc_disabled_methods = ["p2p.get_info"]
 
+## Localnet JSON-RPC settings for stratum mining requests (optional)
+[network_config."localnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+rpc_listen = "tcp://127.0.0.1:48241"
+
 ## Localnet P2P network settings
 [network_config."localnet".net]
 # P2P accept addresses the instance listens on for inbound connections

+ 5 - 0
contrib/localnet/darkfid-five-nodes/darkfid1.toml

@@ -43,6 +43,11 @@ rpc_listen = "tcp://127.0.0.1:48340"
 # Disabled RPC methods
 #rpc_disabled_methods = ["p2p.get_info"]
 
+## Localnet JSON-RPC settings for stratum mining requests (optional)
+[network_config."localnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+rpc_listen = "tcp://127.0.0.1:48341"
+
 ## Localnet P2P network settings
 [network_config."localnet".net]
 # P2P accept addresses the instance listens on for inbound connections

+ 5 - 0
contrib/localnet/darkfid-five-nodes/darkfid2.toml

@@ -43,6 +43,11 @@ rpc_listen = "tcp://127.0.0.1:48440"
 # Disabled RPC methods
 #rpc_disabled_methods = ["p2p.get_info"]
 
+## Localnet JSON-RPC settings for stratum mining requests (optional)
+[network_config."localnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+rpc_listen = "tcp://127.0.0.1:48441"
+
 ## Localnet P2P network settings
 [network_config."localnet".net]
 # P2P accept addresses the instance listens on for inbound connections

+ 5 - 0
contrib/localnet/darkfid-five-nodes/darkfid3.toml

@@ -43,6 +43,11 @@ rpc_listen = "tcp://127.0.0.1:48540"
 # Disabled RPC methods
 #rpc_disabled_methods = ["p2p.get_info"]
 
+## Localnet JSON-RPC settings for stratum mining requests (optional)
+[network_config."localnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+rpc_listen = "tcp://127.0.0.1:48541"
+
 ## Localnet P2P network settings
 [network_config."localnet".net]
 # P2P accept addresses the instance listens on for inbound connections

+ 5 - 0
contrib/localnet/darkfid-five-nodes/darkfid4.toml

@@ -43,6 +43,11 @@ rpc_listen = "tcp://127.0.0.1:48640"
 # Disabled RPC methods
 #rpc_disabled_methods = ["p2p.get_info"]
 
+## Localnet JSON-RPC settings for stratum mining requests (optional)
+[network_config."localnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+rpc_listen = "tcp://127.0.0.1:48641"
+
 ## Localnet P2P network settings
 [network_config."localnet".net]
 # P2P accept addresses the instance listens on for inbound connections

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

@@ -1,48 +0,0 @@
-## 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.
-
-# Number of nonces to execute in system hashrate benchmark
-#bench = 1000
-
-# Flag indicating whether to run miner in light mode
-light_mode = false
-
-# Flag indicating whether to run miner with Large Pages
-large_pages = false
-
-# Flag indicating whether to run miner with secure access to JIT memory (if supported)
-secure = false
-
-# PoW miner number of threads to use
-threads = 1
-
-# Polling rate to ask darkfid for mining jobs
-#polling_rate = 2
-
-# Stop mining at given height (0 mines forever)
-#stop_at_height = 0
-
-# Blockchain network to use
-network = "localnet"
-
-# Localnet blockchain network configuration
-[network_config."localnet"]
-# Wallet mining address to receive mining rewards.
-# This is a dummy one so the miner can start,
-# replace with your own one.
-recipient = "DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"
-
-# Optional contract spend hook to use in the mining reward
-#spend_hook = "YOUR_SPEND_HOOK_HERE"
-
-# Optional contract user data to use in the mining reward.
-# This is not arbitrary data.
-#user_data = "YOUR_USER_DATA_HERE"
-
-# darkfid JSON-RPC endpoint
-endpoint = "tcp://127.0.0.1:48240"

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

@@ -1,48 +0,0 @@
-## 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.
-
-# Number of nonces to execute in system hashrate benchmark
-#bench = 1000
-
-# Flag indicating whether to run miner in light mode
-light_mode = false
-
-# Flag indicating whether to run miner with Large Pages
-large_pages = false
-
-# Flag indicating whether to run miner with secure access to JIT memory (if supported)
-secure = false
-
-# PoW miner number of threads to use
-threads = 1
-
-# Polling rate to ask darkfid for mining jobs
-#polling_rate = 2
-
-# Stop mining at given height (0 mines forever)
-#stop_at_height = 0
-
-# Blockchain network to use
-network = "localnet"
-
-# Localnet blockchain network configuration
-[network_config."localnet"]
-# Wallet mining address to receive mining rewards.
-# This is a dummy one so the miner can start,
-# replace with your own one.
-recipient = "DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"
-
-# Optional contract spend hook to use in the mining reward
-#spend_hook = "YOUR_SPEND_HOOK_HERE"
-
-# Optional contract user data to use in the mining reward.
-# This is not arbitrary data.
-#user_data = "YOUR_USER_DATA_HERE"
-
-# darkfid JSON-RPC endpoint
-endpoint = "tcp://127.0.0.1:48340"

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

@@ -1,48 +0,0 @@
-## 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.
-
-# Number of nonces to execute in system hashrate benchmark
-#bench = 1000
-
-# Flag indicating whether to run miner in light mode
-light_mode = false
-
-# Flag indicating whether to run miner with Large Pages
-large_pages = false
-
-# Flag indicating whether to run miner with secure access to JIT memory (if supported)
-secure = false
-
-# PoW miner number of threads to use
-threads = 1
-
-# Polling rate to ask darkfid for mining jobs
-#polling_rate = 2
-
-# Stop mining at given height (0 mines forever)
-#stop_at_height = 0
-
-# Blockchain network to use
-network = "localnet"
-
-# Localnet blockchain network configuration
-[network_config."localnet"]
-# Wallet mining address to receive mining rewards.
-# This is a dummy one so the miner can start,
-# replace with your own one.
-recipient = "DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"
-
-# Optional contract spend hook to use in the mining reward
-#spend_hook = "YOUR_SPEND_HOOK_HERE"
-
-# Optional contract user data to use in the mining reward.
-# This is not arbitrary data.
-#user_data = "YOUR_USER_DATA_HERE"
-
-# darkfid JSON-RPC endpoint
-endpoint = "tcp://127.0.0.1:48440"

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

@@ -1,48 +0,0 @@
-## 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.
-
-# Number of nonces to execute in system hashrate benchmark
-#bench = 1000
-
-# Flag indicating whether to run miner in light mode
-light_mode = false
-
-# Flag indicating whether to run miner with Large Pages
-large_pages = false
-
-# Flag indicating whether to run miner with secure access to JIT memory (if supported)
-secure = false
-
-# PoW miner number of threads to use
-threads = 1
-
-# Polling rate to ask darkfid for mining jobs
-#polling_rate = 2
-
-# Stop mining at given height (0 mines forever)
-#stop_at_height = 0
-
-# Blockchain network to use
-network = "localnet"
-
-# Localnet blockchain network configuration
-[network_config."localnet"]
-# Wallet mining address to receive mining rewards.
-# This is a dummy one so the miner can start,
-# replace with your own one.
-recipient = "DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"
-
-# Optional contract spend hook to use in the mining reward
-#spend_hook = "YOUR_SPEND_HOOK_HERE"
-
-# Optional contract user data to use in the mining reward.
-# This is not arbitrary data.
-#user_data = "YOUR_USER_DATA_HERE"
-
-# darkfid JSON-RPC endpoint
-endpoint = "tcp://127.0.0.1:48540"

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

@@ -1,48 +0,0 @@
-## 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.
-
-# Number of nonces to execute in system hashrate benchmark
-#bench = 1000
-
-# Flag indicating whether to run miner in light mode
-light_mode = false
-
-# Flag indicating whether to run miner with Large Pages
-large_pages = false
-
-# Flag indicating whether to run miner with secure access to JIT memory (if supported)
-secure = false
-
-# PoW miner number of threads to use
-threads = 1
-
-# Polling rate to ask darkfid for mining jobs
-#polling_rate = 2
-
-# Stop mining at given height (0 mines forever)
-#stop_at_height = 0
-
-# Blockchain network to use
-network = "localnet"
-
-# Localnet blockchain network configuration
-[network_config."localnet"]
-# Wallet mining address to receive mining rewards.
-# This is a dummy one so the miner can start,
-# replace with your own one.
-recipient = "DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"
-
-# Optional contract spend hook to use in the mining reward
-#spend_hook = "YOUR_SPEND_HOOK_HERE"
-
-# Optional contract user data to use in the mining reward.
-# This is not arbitrary data.
-#user_data = "YOUR_USER_DATA_HERE"
-
-# darkfid JSON-RPC endpoint
-endpoint = "tcp://127.0.0.1:48640"

+ 15 - 21
contrib/localnet/darkfid-five-nodes/tmux_sessions.sh

@@ -1,12 +1,15 @@
 #!/bin/sh
 set -e
 
-# Start a tmux session with five minerd daemons and five darkfid nodes
+# Start a tmux session with five xmrig daemons and five darkfid nodes
 
 # Path to used binaries
-MINERD="../../../minerd"
+XMRIG="xmrig"
 DARKFID="LOG_TARGETS='!runtime,!sled' ../../../darkfid"
 
+# Dummy mining config wallet so mining daemons can start.
+XMRIG_USER="OERjbThtVW1VMkZIYmI2RlhucUx0OXByaFRSWmVWcE5hdTROWXQ3Szg1ZDVVWnA0RGpabmFKZVZEAAA"
+
 session=darkfid-five-nodes
 
 if [ "$1" = "-vv" ]; then
@@ -17,32 +20,23 @@ else
 fi
 
 tmux new-session -d -s $session -n "node0"
-tmux send-keys -t $session "$MINERD -c minerd0.toml $verbose" Enter
-sleep 1
-tmux split-window -t $session -v -l 90%
+tmux send-keys -t $session "$XMRIG -u x+1 -o 127.0.0.1:48241 -t 2 -u $XMRIG_USER" Enter
+tmux split-window -t $session -v -l 80%
 tmux send-keys -t $session "$DARKFID -c darkfid0.toml $verbose" Enter
-sleep 2
 tmux new-window -t $session -n "node1"
-tmux send-keys -t $session "$MINERD -c minerd1.toml $verbose" Enter
-sleep 1
-tmux split-window -t $session -v -l 90%
+tmux send-keys -t $session "$XMRIG -u x+1 -o 127.0.0.1:48341 -t 2 -u $XMRIG_USER" Enter
+tmux split-window -t $session -v -l 80%
 tmux send-keys -t $session "$DARKFID -c darkfid1.toml $verbose" Enter
-sleep 2
 tmux new-window -t $session -n "node2"
-tmux send-keys -t $session "$MINERD -c minerd2.toml $verbose" Enter
-sleep 1
-tmux split-window -t $session -v -l 90%
+tmux send-keys -t $session "$XMRIG -u x+1 -o 127.0.0.1:48441 -t 2 -u $XMRIG_USER" Enter
+tmux split-window -t $session -v -l 80%
 tmux send-keys -t $session "$DARKFID -c darkfid2.toml $verbose" Enter
-sleep 2
 tmux new-window -t $session -n "node3"
-tmux send-keys -t $session "$MINERD -c minerd3.toml $verbose" Enter
-sleep 1
-tmux split-window -t $session -v -l 90%
+tmux send-keys -t $session "$XMRIG -u x+1 -o 127.0.0.1:48541 -t 2 -u $XMRIG_USER" Enter
+tmux split-window -t $session -v -l 80%
 tmux send-keys -t $session "$DARKFID -c darkfid3.toml $verbose" Enter
-sleep 2
 tmux new-window -t $session -n "node4"
-tmux send-keys -t $session "$MINERD -c minerd4.toml $verbose" Enter
-sleep 1
-tmux split-window -t $session -v -l 90%
+tmux send-keys -t $session "$XMRIG -u x+1 -o 127.0.0.1:48641 -t 2 -u $XMRIG_USER" Enter
+tmux split-window -t $session -v -l 80%
 tmux send-keys -t $session "$DARKFID -c darkfid4.toml $verbose" Enter
 tmux attach -t $session

+ 14 - 13
contrib/localnet/darkfid-single-node/README.md

@@ -2,26 +2,27 @@ darkfid localnet
 ================
 
 This will start one `darkfid` node in localnet mode,
-along with a `minerd` daemon to mine blocks.
+along with an `xmrig` daemon to mine blocks.
 
-If we want to test wallet stuff, we must generate
-a testing wallet and pass its address to the `darkfid`
-config, so the wallet gets the block rewards the node
-produces. We generate a wallet, set it as the default
-and set its address as the `recipient` field in
-`minerd.toml`, using the porvided automated script:
-```
+If we want to test wallet stuff, we must generate a testing wallet and
+pass its mining configuration to the `xmrig` daemon, so the wallet gets
+the block rewards the node produces. We generate a wallet, set it as
+the default and set its address as the `XMRIG_USER` field in
+`tmux_sessions.sh`, using provided automated script:
+```shell
 % ./init-wallet.sh
 ```
 
-Then start the daemons and wait until `darkfid` is initialized:
-```
+Then make sure the `xmrig` daemon binary path is configured correctly
+in `tmux_sessions.sh`, start the daemons and wait until `darkfid` is
+initialized:
+```shell
 % ./tmux_sessions.sh
 ```
 
-After some blocks have been generated we
-will see some `DRK` in our test wallet.
-```
+After some blocks have been generated we will see some `DRK` in our
+test wallet:
+```shell
 % ./wallet-balance.sh
 ```
 

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

@@ -1,3 +1,3 @@
 #!/bin/sh
 rm -rf darkfid drk
-sed -i -e "s|recipient =.*|recipient = \"DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf\"|g" minerd.toml
+sed -i -e "s|XMRIG_USER=.*|XMRIG_USER=\"OERjbThtVW1VMkZIYmI2RlhucUx0OXByaFRSWmVWcE5hdTROWXQ3Szg1ZDVVWnA0RGpabmFKZVZEAAA\"|g" tmux_sessions.sh

+ 9 - 1
contrib/localnet/darkfid-single-node/darkfid.toml

@@ -43,10 +43,18 @@ rpc_listen = "tcp://127.0.0.1:48240"
 # Disabled RPC methods
 #rpc_disabled_methods = ["p2p.get_info"]
 
+## Localnet JSON-RPC settings for stratum mining requests (optional)
+[network_config."localnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+rpc_listen = "tcp://127.0.0.1:48241"
+
+# Disabled RPC methods (stratum mining)
+#rpc_disabled_methods = []
+
 ## Localnet JSON-RPC settings for p2pool merge mining requests (optional)
 #[network_config."localnet".mm_rpc]
 # JSON-RPC listen URL (merge mining)
-#rpc_listen = "http+tcp://127.0.0.1:8241"
+#rpc_listen = "http+tcp://127.0.0.1:48241"
 
 # Disabled RPC methods (merge mining)
 #rpc_disabled_methods = []

+ 2 - 2
contrib/localnet/darkfid-single-node/init-wallet.sh

@@ -6,5 +6,5 @@ DRK="../../../drk -c drk.toml"
 $DRK wallet initialize
 $DRK wallet keygen
 $DRK wallet default-address 1
-wallet=$($DRK wallet address)
-sed -i -e "s|DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf|$wallet|g" minerd.toml
+wallet=$($DRK wallet mining-config 1 | tail -n 1)
+sed -i -e "s|OERjbThtVW1VMkZIYmI2RlhucUx0OXByaFRSWmVWcE5hdTROWXQ3Szg1ZDVVWnA0RGpabmFKZVZEAAA|$wallet|g" tmux_sessions.sh

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

@@ -1,50 +0,0 @@
-## 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.
-
-# Number of nonces to execute in system hashrate benchmark
-#bench = 1000
-
-# Flag indicating whether to run miner in light mode
-light_mode = false
-
-# Flag indicating whether to run miner with Large Pages
-large_pages = false
-
-# Flag indicating whether to run miner with secure access to JIT memory (if supported)
-secure = false
-
-# PoW miner number of threads to use
-#threads = 4
-
-# Polling rate to ask darkfid for mining jobs
-#polling_rate = 2
-
-# Stop mining at given height (0 mines forever)
-#stop_at_height = 0
-
-# Blockchain network to use
-network = "localnet"
-
-# Localnet blockchain network configuration
-[network_config."localnet"]
-# Wallet mining address to receive mining rewards.
-# This is a dummy one so the miner can start,
-# replace with your own one.
-recipient = "DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"
-
-# Optional contract spend hook to use in the mining reward.
-# This is the DAO spend hook set for convinience,
-# replace with your own one.
-#spend_hook = "6iW9nywZYvyhcM7P1iLwYkh92rvYtREDsC8hgqf2GLuT"
-
-# Optional contract user data to use in the mining reward.
-# This is not arbitrary data.
-#user_data = "YOUR_USER_DATA_HERE"
-
-# darkfid JSON-RPC endpoint
-endpoint = "tcp://127.0.0.1:48240"

+ 12 - 6
contrib/localnet/darkfid-single-node/tmux_sessions.sh

@@ -1,10 +1,17 @@
 #!/bin/sh
 set -e
 
-# Start a tmux session with a minerd daemon and a darkfid node
+# Start a tmux session with an xmrig daemon and a darkfid node
 
-# Path to used binaries
-MINERD="../../../minerd -c minerd.toml"
+# xmrig configuration
+XMRIG_BINARY_PATH="xmrig"
+XMRIG_STRATUM_ENDPOINT="127.0.0.1:48241"
+XMRIG_THREADS="4"
+XMRIG_USER="OERjbThtVW1VMkZIYmI2RlhucUx0OXByaFRSWmVWcE5hdTROWXQ3Szg1ZDVVWnA0RGpabmFKZVZEAAA"
+XMRIG_PARAMS="-u x+1 -o $XMRIG_STRATUM_ENDPOINT -t $XMRIG_THREADS -u $XMRIG_USER"
+XMRIG="$XMRIG_BINARY_PATH $XMRIG_PARAMS"
+
+# Path to darkfid binary
 DARKFID="LOG_TARGETS='!net,!runtime,!sled' ../../../darkfid -c darkfid.toml"
 
 session=darkfid-single-node
@@ -17,8 +24,7 @@ else
 fi
 
 tmux new-session -d -s $session -n $session
-tmux send-keys -t $session "$MINERD $verbose" Enter
-sleep 1
-tmux split-window -t $session -v -l 90%
+tmux send-keys -t $session "$XMRIG" Enter
+tmux split-window -t $session -v -l 80%
 tmux send-keys -t $session "$DARKFID $verbose" Enter
 tmux attach -t $session

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

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

+ 5 - 0
contrib/localnet/darkfid-small/darkfid0.toml

@@ -43,6 +43,11 @@ rpc_listen = "tcp://127.0.0.1:48240"
 # Disabled RPC methods
 #rpc_disabled_methods = ["p2p.get_info"]
 
+## Localnet JSON-RPC settings for stratum mining requests (optional)
+[network_config."localnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+rpc_listen = "tcp://127.0.0.1:48241"
+
 ## Localnet P2P network settings
 [network_config."localnet".net]
 # P2P accept addresses the instance listens on for inbound connections

+ 5 - 0
contrib/localnet/darkfid-small/darkfid1.toml

@@ -51,6 +51,11 @@ rpc_listen = "tcp://127.0.0.1:48340"
 # Disabled RPC methods
 #rpc_disabled_methods = ["p2p.get_info"]
 
+## Localnet JSON-RPC settings for stratum mining requests (optional)
+[network_config."localnet".stratum_rpc]
+# JSON-RPC listen URL (stratum mining)
+rpc_listen = "tcp://127.0.0.1:48341"
+
 ## Localnet P2P network settings
 [network_config."localnet".net]
 # P2P accept addresses the instance listens on for inbound connections

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

@@ -1,48 +0,0 @@
-## 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.
-
-# Number of nonces to execute in system hashrate benchmark
-#bench = 1000
-
-# Flag indicating whether to run miner in light mode
-light_mode = false
-
-# Flag indicating whether to run miner with Large Pages
-large_pages = false
-
-# Flag indicating whether to run miner with secure access to JIT memory (if supported)
-secure = false
-
-# PoW miner number of threads to use
-threads = 2
-
-# Polling rate to ask darkfid for mining jobs
-#polling_rate = 2
-
-# Stop mining at given height (0 mines forever)
-#stop_at_height = 0
-
-# Blockchain network to use
-network = "localnet"
-
-# Localnet blockchain network configuration
-[network_config."localnet"]
-# Wallet mining address to receive mining rewards.
-# This is a dummy one so the miner can start,
-# replace with your own one.
-recipient = "DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"
-
-# Optional contract spend hook to use in the mining reward
-#spend_hook = "YOUR_SPEND_HOOK_HERE"
-
-# Optional contract user data to use in the mining reward.
-# This is not arbitrary data.
-#user_data = "YOUR_USER_DATA_HERE"
-
-# darkfid JSON-RPC endpoint
-endpoint = "tcp://127.0.0.1:48240"

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

@@ -1,48 +0,0 @@
-## 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.
-
-# Number of nonces to execute in system hashrate benchmark
-#bench = 1000
-
-# Flag indicating whether to run miner in light mode
-light_mode = false
-
-# Flag indicating whether to run miner with Large Pages
-large_pages = false
-
-# Flag indicating whether to run miner with secure access to JIT memory (if supported)
-secure = false
-
-# PoW miner number of threads to use
-threads = 2
-
-# Polling rate to ask darkfid for mining jobs
-#polling_rate = 2
-
-# Stop mining at given height (0 mines forever)
-#stop_at_height = 0
-
-# Blockchain network to use
-network = "localnet"
-
-# Localnet blockchain network configuration
-[network_config."localnet"]
-# Wallet mining address to receive mining rewards.
-# This is a dummy one so the miner can start,
-# replace with your own one.
-recipient = "DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"
-
-# Optional contract spend hook to use in the mining reward
-#spend_hook = "YOUR_SPEND_HOOK_HERE"
-
-# Optional contract user data to use in the mining reward.
-# This is not arbitrary data.
-#user_data = "YOUR_USER_DATA_HERE"
-
-# darkfid JSON-RPC endpoint
-endpoint = "tcp://127.0.0.1:48340"

+ 9 - 10
contrib/localnet/darkfid-small/tmux_sessions.sh

@@ -2,12 +2,15 @@
 set -e
 
 # Start a tmux session with two mining and a non-mining darkfid nodes.
-# Additionally, start two minerd daemons.
+# Additionally, start two xmrig daemons.
 
 # Path to used binaries
-MINERD="../../../minerd"
+XMRIG="xmrig"
 DARKFID="LOG_TARGETS='!runtime,!sled' ../../../darkfid"
 
+# Dummy mining config wallet so mining daemons can start.
+XMRIG_USER="OERjbThtVW1VMkZIYmI2RlhucUx0OXByaFRSWmVWcE5hdTROWXQ3Szg1ZDVVWnA0RGpabmFKZVZEAAA"
+
 session=darkfid-small
 
 if [ "$1" = "-vv" ]; then
@@ -18,17 +21,13 @@ else
 fi
 
 tmux new-session -d -s $session -n "node0"
-tmux send-keys -t $session "$MINERD -c minerd0.toml $verbose" Enter
-sleep 1
-tmux split-window -t $session -v -l 90%
+tmux send-keys -t $session "$XMRIG -u x+1 -o 127.0.0.1:48241 -t 2 -u $XMRIG_USER" Enter
+tmux split-window -t $session -v -l 80%
 tmux send-keys -t $session "$DARKFID -c darkfid0.toml $verbose" Enter
-sleep 2
 tmux new-window -t $session -n "node1"
-tmux send-keys -t $session "$MINERD -c minerd1.toml $verbose" Enter
-sleep 1
-tmux split-window -t $session -v -l 90%
+tmux send-keys -t $session "$XMRIG -u x+1 -o 127.0.0.1:48341 -t 2 -u $XMRIG_USER" Enter
+tmux split-window -t $session -v -l 80%
 tmux send-keys -t $session "$DARKFID -c darkfid1.toml $verbose" Enter
-sleep 2
 tmux new-window -t $session -n "node2"
 tmux send-keys -t $session "$DARKFID -c darkfid2.toml $verbose" Enter
 tmux attach -t $session