BHD Mining Tutorial(win)

BHD 1
8 min readFeb 16, 2023

--

1. Download and Installation

Visit https://bhd.one/

Download and install the latest BHD wallet. Once the installation is complete, run the wallet application to start synchronizing block data.

Note that if you are using the testnet network, click on the application with the “green” icon to run the node program, or use “btchdd.exe -testnet -server” at the command line to run the node program.

Synchronizing blocks in progress.

1. Add the Search Path

After the installation is complete, you need to add the BitcoinHD daemon folder to your system’s path search list, as follows:

2.1 Copy the subdirectory “daemon” of BitcoinHD’s installation directory in Explorer.

Usually “C:\Program Files\BitcoinHD\daemon”

2.2 Open in sequence: Windows Start Menu → Settings → System → About → Advanced System Settings → Environment Variables

2.3 In the window that opens, there are two lists, find the “path” item in the first list at the top and double-click it to open the path editor window。

2.4 Click the “New” button, paste the copied directory into the list, and then click OK to save it.

2.5 Reopen your command line window and type “btchd-miner.exe — help” and you should see that the command was invoked correctly.

1. Configure Node RPC Services

By default, if you use the GUI version of the wallet, it cannot run directly with the mining program. If you need to use the GUI version of the wallet for mining, you need to modify its configuration as follows.

3.1 Open the wallet.

Please note: if you are using the testnet network, double click on the green icon.

3.2 Open in order: Settings → Options → Open Configuration File, and click “OK”.

3.3 Type “server=1” in the open text editor and save it.

3.4 Closing the wallet and restarting, at which point the mining process will be able to connect correctly.

4. Edit Configuration Files

4.1 Initializing the configuration file

We use btchd-miner.exe to do mining-related work, and initializing an empty configuration file is one of its functions. You can also initialize the file without it, copy the written configuration file into the directory where you normally start mining. We will need to specify the location of this file when we start the mining program later.

Use the following command to initialize an empty configuration file:

btchd-miner.exe generate-config

This config file can be found in the directory where it was created.

4.2 Fill the configuration

The configuration file format is Json text, named “config.json” by default. Below is an example, and your configuration file will look similar to the example.

{

“testnet”: true,

“noproxy”: true,

“reward”: “2MtsaUDCYg2k9wagWfsdnknQwEkktJgxHnJ”,

“seed”: “bird convince trend skin lumber escape crater describe …”,

“plotPath”:[“E:/chia”],

“rpc”: {

“host”: “http://127.0.0.1:18732"

}

}

Here is an example of a txt file.

BHD Reward Address

This is the address where you will receive your mining rewards in the BHD network. Note that before you use this address, you need to make sure that it is bound to the Farmer public key associated with your Chia’s Plot files. See the section “Binding FarmerId” for instructions on how to do this.

Chia Wallet — Seed

When you initialize the hard drive space, Chia will ask you for a private key, consisting of this string called “Seed”, which is a combination of words. We need this private key to sign when generating BHD block to verify your identity. Please paste the “Seed” into this. This private key is only used for signing and is only stored locally and will not be uploaded to the BHD chain or any network.

Plot File Directory

Here you need to specify your Plot file directory, the registration entry is an array and you can register multiple Plot file directories at the same time.

RPC Connection to the Local Wallet

The RPC connection to the local wallet can be specified here if you use a login user name and password. By default we use a “.cookie” file to authenticate the connection to the wallet, so here you only need to register the “host” entry.

5. Binding Farmerld

Before mining, you need to bind your BHD reward receiving address to FarmerId. Since you need to make a signature, you need to edit the correct configuration file and fill in your correct “Seed” and BHD reward address first. Use the following command to bind FarmerId:

btchd-miner.exe bind — cookie e:/bhd/testnet3/.cookie

“- bind” is the main command

“-cookie” parameter to specify the location of the cookie file, for example e:/bhd/testnet3/.cookie

  • Create a wallet → “CREATE A NEW PRIVATE KEY”
  • Please save your 24 mnemonics, you will need them to log in to your wallet later.
  • Please note: If you lose your mnemonics, you will lose your wallet !!!
  • Choose → “Farming” → “ADD A PLOT”
  • Plot setting
  • 1. Stake BHD
  • To stake BHD to the network for the full rewards of the block, use the following command to do so.
  • btchd-miner.exe deposit — amount [stake amounts] — term [noterm, term1, term2, term3] — testnet — no-proxy
  • - “deposit” is the main command
  • - “-amount” parameter to specify the total number of staking
  • - “-term” parameter to specify the duration of the lock-up, where “noterm” denotes active, “term1”, “term2”, “term3” are different types of locking periods respectively
  • - “-testnet” parameter to use the testnet network. Without this parameter, the command will be executed on the mainnet network.
  • - “-no-proxy” parameter to skip the local proxy setting and connect directly to the node
  • After a successful staking, “btchd-miner.exe” will display a hashrate, which is the “transaction id”. Please save it and use it when you need to exit the staking in the future.
  • 7. pledge ownership transferring
  • BHDs staked to the chain will not be withdrawn in full within the agreed time period, but can be transferred to other miner addresses.
  • btchd-miner.exe retarget — txid transaction hash — address — testnet — no-proxy
  • where “retarget” is the main command
  • l the “ — txid” parameter, which specifies the hash of the staking transaction to be rebinded
  • l the “ — address” parameter, which specifies the new address to be bound
  • l the “ — testnet” parameter, to use the testnet, without which the command will be executed on the mainnet
  • l the “ — no-proxy” parameter to skip the local proxy setting and connect directly to the node
  • In order to prevent a stake from being re-bound frequently within a short period of time, there is a time interval specified for the binding operation. The number of blocks between that binding and the staking or the last binding must not be less than a set value. On the testnet 3, this value is 10, while on the official network it is around 7 weeks. A stake that has been rebinded can be rebinded again with the same command format as described above, which requires specifying the hash of the last rebinded transaction. In addition, only the owner of the stake can transfer it.
  • 8. Querying staking
  • You can query the staking associated with the current account by using the “btchd-cli” command, which allows you to find out the relevant txid and use it in the stake command. The content displayed on the command line is a json text, as shown in the example below, which shows the transaction hash, amount, block height, type, etc. of the stake
  • Here the txt document is used as an example
  • When the “testnet” value is true, the testnet network is used, otherwise the official network is used. When “noproxy” value is true, a network proxy is not used to connect to the wallet. Keep this option at true if there is no special need for a proxy.
  • 9. Withdrawl
  • Once the lock-up period for the staking amount has been reached, miners can use the following command to withdraw:
  • btchd-miner.exe withdraw — txid [transaction id] — testnet — no-proxy
  • - “withdraw” is the main command
  • - “ — txid” parameter to specify the “transaction id”. This “transaction id” will be displayed after the previous successful use of the “deposit” command.
  • 10.Start Mining Process
  • When everything is ready, including nodes that have synchronized all blocks, the mining process can be started by using the following command:
  • btchd-miner.exe mining
  • - “mining” is the main command
  • - “-cookie” parameter to specify the location of the cookie file, for example e:/bhd/testnet3/.cookie

--

--

BHD 1

BHD1 Community is a spontaneously community organization officially certified by BHD1 foundation, which is committed to creating BHD 1ecological entrance.