Skip to content

Running large block size simulation

Dave Collins edited this page Jan 17, 2015 · 9 revisions

This simulation is for testing large (upto 32 MB) block sizes. By default btcd nodes accept a block of maximum size ~1 MB. We need to use a fork of btcwire with updated MaxBlockPayload to handle larger blocks:

Go to btcwire directory:

cd $GOPATH/src/github.com/btcsuite/btcwire/

... and edit msgblock.go MaxBlockPayload:

-const MaxBlockPayload = 1000000 // Not actually 1MB which would be 1024 * 1024
+const MaxBlockPayload = 32 * 1000000 // Not actually 1MB which would be 1024 * 1024

You'll need to re-install dependents of btcwire again, so you can do this:

go install -v github.com/btcsuite/btcd github.com/btcsuite/btcwallet

To test, check that btcd accepts the updated param max for -blockmaxsize:

btcd --simnet -u rpcuser -P rpcpass --blockmaxsize=31999000

If it starts btcd, you're good to go, but if you see this message, you're missing the updated maximum block size:

loadConfig: The blockmaxsize option must be in between 1000 and 999000 -- parsed [31999000]
Use btcd -h to show usage

The default CSV is meant for simulating normal block sizes. For large block sizes, use an input CSV with large block sizes, e.g. cat large.csv:

16200,200000,180000

Now you should be able to launch btcsim with the new maximum block size and use the above CSV for input:

btcsim -maxblocksize=31999000 -txcurve=large.csv
Clone this wiki locally