Skip to content
This repository has been archived by the owner on Aug 24, 2018. It is now read-only.

Latest commit

 

History

History
181 lines (126 loc) · 6.67 KB

miner.md

File metadata and controls

181 lines (126 loc) · 6.67 KB

Website | Download | Setup | Xthin | Xpedited | Miner

Using Ensocoin for Mining

Ensocoin is based on the Satoshi codebase, so it is a drop in replacement for your mining pool software. Simply configure your pool to point to the Ensocoin daemon, in the exact same manner you would for the Bitcoin Core daemon.

But Ensocoin has specific features to facilitate mining.

Setting your excessive block size and accept depth

Blocks larger than the excessive block size will be ignored until "accept depth" (see next section) blocks are built upon them. This allows miners to discourage blocks that they feel are excessively large, but to ultimately accept them if it looks like the majority of the network is accepting this size. You can learn more about these parameters here, and a miner's opinion on how they should be set here.

To change the largest block that Ensocoin will generate, run:

bitcoin-cli setexcessiveblock blockSize acceptDepth

For example, to set 1MB blocks with an accept depth of 10 blocks use:

bitcoin-cli setexcessiveblock 1000000 10

To change the excessive block size field in ensocoin.conf or on the command line, set the excessiveblocksize config variable to a value in bytes:

excessiveblocksize=<NNN>

for example, to set 3MB blocks use:

excessiveblocksize=3000000

To change the accept depth field in ensocoin.conf or on the command line, set the excessiveacceptdepth config variable to a value (in blocks):

excessiveacceptdepth=<NNN>

for example, to wait for 10 blocks before accepting an excessive block, use:

excessiveacceptdepth=10

To discover these settings in a running bitcoind, use "getexcessiveblock". For example:

$ bitcoin-cli getexcessiveblock
{
  "excessiveBlockSize": 16000000,
  "excessiveAcceptDepth": 4
}

Setting your subversion string (spoofing the user agent)

To hide that this is a Ensocoin node, set the "net.subversionOverride" to a string of your choice, in the ensocoin.conf file or using ./bitcoin-cli:

 bitcoin-cli set net.subversionOverride="Your Choice Here"

To show the current string:

bitcoin-cli get net.subversionOverride

To change this field in ensocoin.conf or on the command line, use:

net.subversionOverride=

Setting your maximum mined block

By default, the maximum block that Ensocoin will mine is 1MB (compatible with Bitcoin Core). You may want to increase this block size if the bitcoin network as a whole is willing to mine larger blocks, or you may want to decrease this size if you feel that the demands on the network is exceeding capacity.

To change the largest block that Ensocoin will generate, run:

bitcoin-cli setminingmaxblock blocksize

For example, to set 2MB blocks, use:

bitcoin-cli setminingmaxblock 2000000

To change this field in ensocoin.conf or on the command line, use:

blockmaxsize=<NNN>

for example, to set 3MB blocks use:

blockmaxsize=3000000

You can discover the maximum block size by running:

bitcoin-cli getminingmaxblock
  • WARNING: Setting this max block size parameter means that Bitcoin may mine blocks of that size on the NEXT block. It is expected that any voting or "grace period" (like BIP109 specified) has already occurred.

Setting your block version

Miners can set the block version flag via CLI/RPC or config file:

From the CLI/RPC,

bitcoin-cli setblockversion (version number or string)

For example:

The following all choose to vote for 2MB blocks:

bitcoin-cli setblockversion 0x30000000
bitcoin-cli setblockversion 805306368
bitcoin-cli setblockversion BIP109

The following does not vote for 2MB blocks:

bitcoin-cli setblockversion 0x20000000
bitcoin-cli setblockversion 536870912
bitcoin-cli setblockversion BASE

You can discover the current block version using:

bitcoin-cli getblockversion

From ensocoin.conf:

blockversion=805306368

Note you must specify the version in decimal format in the ensocoin.conf file. Here is an easy conversion in Linux: python -c "print '%d' % 0x30000000"

  • WARNING: If you use nonsense numbers when calling setblockversion, you'll end up generating blocks with nonsense versions!

Setting your block retry intervals

Ensocoin tracks multiple sources for data an can rapidly request blocks or transactions from other sources if one source does not deliver the requested data. To change the retry rate, set it in microseconds in your ensocoin.conf:

Transaction retry interval:

txretryinterval=2000000

Block retry interval:

blkretryinterval=2000000

Setting your memory pool size

A larger transaction memory pool allows your node to receive expedited blocks successfully (it increases the chance that you will have a transaction referenced in the expedited block) and to pick from a larger set of available transactions. To change the memory pool size, configure it in ensocoin.conf:

maxmempool=<megabytes>

So a 4GB mempool would be configured like:

maxmempool=4096

Setting your Coinbase string

To change the string that appears in the coinbase message of a mined block, run:

bitcoin-cli setminercomment "your mining comment"

To show the current string:

bitcoin-cli getminercomment
  • WARNING: some mining software and pools also add to the coinbase string and do not validate the total string length (it must be < 100 bytes). This can cause the mining pool to generate invalid blocks. Please ensure that your mining pool software validates total string length, or keep the string you add to Ensocoin short.

Filling a new node's transaction memory pool

When you restart bitcoind, the memory pool starts empty. If a block is found quickly, this could result in an block with few transactions. It is possible to "prime" a new instance of bitcoind with the memory pool of a different Ensocoin node. To do so, go to the CLI on the node that has a full mempool, connect to your new node, and push the transactions to it.

`bitcoin-cli addnode <new node's IP:port> onetry`
`bitcoin-cli pushtx <new node's IP:port>`