Skip to content

Instantly share code, notes, and snippets.

@PastaPastaPasta
Created January 21, 2022 07:22
Show Gist options
  • Save PastaPastaPasta/faca79b604611de68c0898181448989c to your computer and use it in GitHub Desktop.
Save PastaPastaPasta/faca79b604611de68c0898181448989c to your computer and use it in GitHub Desktop.
pasta@pastas-MacBook-Pro bitcoin % alias t='time ./src/bitcoin-cli --regtest'
pasta@pastas-MacBook-Pro bitcoin % t getblockchaininfo
{
"chain": "regtest",
"blocks": 0,
"headers": 0,
"bestblockhash": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
"difficulty": 4.656542373906925e-10,
"time": 1296688602,
"mediantime": 1296688602,
"verificationprogress": 1,
"initialblockdownload": true,
"chainwork": "0000000000000000000000000000000000000000000000000000000000000002",
"size_on_disk": 293,
"pruned": false,
"softforks": {
"bip34": {
"type": "buried",
"active": true,
"height": 1
},
"bip66": {
"type": "buried",
"active": true,
"height": 1
},
"bip65": {
"type": "buried",
"active": true,
"height": 1
},
"csv": {
"type": "buried",
"active": true,
"height": 1
},
"segwit": {
"type": "buried",
"active": true,
"height": 1
},
"testdummy": {
"type": "bip9",
"bip9": {
"status": "defined",
"start_time": 0,
"timeout": 9223372036854775807,
"since": 0,
"min_activation_height": 0
},
"active": false
},
"taproot": {
"type": "bip9",
"bip9": {
"status": "active",
"start_time": -1,
"timeout": 9223372036854775807,
"since": 0,
"min_activation_height": 0
},
"height": 0,
"active": true
}
},
"warnings": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"
}
./src/bitcoin-cli --regtest getblockchaininfo 0.00s user 0.01s system 2% cpu 0.457 total
pasta@pastas-MacBook-Pro bitcoin % t getnewaddress
error code: -18
error message:
No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)
./src/bitcoin-cli --regtest getnewaddress 0.00s user 0.00s system 58% cpu 0.010 total
pasta@pastas-MacBook-Pro bitcoin % t createwallet regtest
{
"name": "regtest",
"warning": ""
}
./src/bitcoin-cli --regtest createwallet regtest 0.00s user 0.00s system 0% cpu 6.202 total
pasta@pastas-MacBook-Pro bitcoin % t loadwallet regtest
error code: -4
error message:
Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?
./src/bitcoin-cli --regtest loadwallet regtest 0.00s user 0.00s system 47% cpu 0.009 total
pasta@pastas-MacBook-Pro bitcoin % t getnewaddress
bcrt1qp6gk4fd2gj6ydt26vcyaanjp6aq4lsh29ks490
./src/bitcoin-cli --regtest getnewaddress 0.00s user 0.00s system 2% cpu 0.404 total
pasta@pastas-MacBook-Pro bitcoin % t generatetoaddress bcrt1qp6gk4fd2gj6ydt26vcyaanjp6aq4lsh29ks490 100
error: Error parsing JSON: bcrt1qp6gk4fd2gj6ydt26vcyaanjp6aq4lsh29ks490
./src/bitcoin-cli --regtest generatetoaddress 100 0.00s user 0.00s system 62% cpu 0.009 total
pasta@pastas-MacBook-Pro bitcoin % t generatetoaddress "bcrt1qp6gk4fd2gj6ydt26vcyaanjp6aq4lsh29ks490" 100
error: Error parsing JSON: bcrt1qp6gk4fd2gj6ydt26vcyaanjp6aq4lsh29ks490
./src/bitcoin-cli --regtest generatetoaddress 100 0.00s user 0.00s system 64% cpu 0.010 total
pasta@pastas-MacBook-Pro bitcoin % t generatetoaddress
error code: -1
error message:
generatetoaddress nblocks "address" ( maxtries )
Mine blocks immediately to a specified address (before the RPC call returns)
Arguments:
1. nblocks (numeric, required) How many blocks are generated immediately.
2. address (string, required) The address to send the newly generated bitcoin to.
3. maxtries (numeric, optional, default=1000000) How many iterations to try.
Result:
[ (json array) hashes of blocks generated
"hex", (string) blockhash
...
]
Examples:
Generate 11 blocks to myaddress
> bitcoin-cli generatetoaddress 11 "myaddress"
If you are using the Bitcoin Core wallet, you can get a new address to send the newly generated bitcoin to with:
> bitcoin-cli getnewaddress
./src/bitcoin-cli --regtest generatetoaddress 0.00s user 0.00s system 58% cpu 0.011 total
pasta@pastas-MacBook-Pro bitcoin % t generatetoaddress 100 bcrt1qp6gk4fd2gj6ydt26vcyaanjp6aq4lsh29ks490
[
"3f7c7608f72bb1e8bc8e8715fb3fc2234697fa4b670640c6a28c76afe0697193",
...
"5f2bc4038e48eeabcf697b9046ecc44919de6bb7c3c890f3a35b5f8c4c9c9ec7"
]
./src/bitcoin-cli --regtest generatetoaddress 100 0.00s user 0.00s system 0% cpu 22.996 total
pasta@pastas-MacBook-Pro bitcoin % t getblockchaininfo
{
"chain": "regtest",
"blocks": 100,
"headers": 100,
"bestblockhash": "5f2bc4038e48eeabcf697b9046ecc44919de6bb7c3c890f3a35b5f8c4c9c9ec7",
"difficulty": 4.656542373906925e-10,
"time": 1642749503,
"mediantime": 1642749501,
"verificationprogress": 1,
"initialblockdownload": false,
"chainwork": "00000000000000000000000000000000000000000000000000000000000000ca",
"size_on_disk": 30177,
"pruned": false,
"softforks": {
"bip34": {
"type": "buried",
"active": true,
"height": 1
},
"bip66": {
"type": "buried",
"active": true,
"height": 1
},
"bip65": {
"type": "buried",
"active": true,
"height": 1
},
"csv": {
"type": "buried",
"active": true,
"height": 1
},
"segwit": {
"type": "buried",
"active": true,
"height": 1
},
"testdummy": {
"type": "bip9",
"bip9": {
"status": "defined",
"start_time": 0,
"timeout": 9223372036854775807,
"since": 0,
"min_activation_height": 0
},
"active": false
},
"taproot": {
"type": "bip9",
"bip9": {
"status": "active",
"start_time": -1,
"timeout": 9223372036854775807,
"since": 0,
"min_activation_height": 0
},
"height": 0,
"active": true
}
},
"warnings": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"
}
./src/bitcoin-cli --regtest getblockchaininfo 0.00s user 0.00s system 52% cpu 0.013 total
pasta@pastas-MacBook-Pro bitcoin % ./src/bench/bench_bitcoin
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 13,371,375.00 | 74.79 | 0.5% | 0.15 | `AddrManAdd`
| 32,484,875.00 | 30.78 | 1.3% | 0.36 | `AddrManAddThenGood`
| 87,814.89 | 11,387.59 | 0.6% | 0.01 | `AddrManGetAddr`
| 92.08 | 10,859,682.04 | 5.7% | 0.01 | :wavy_dash: `AddrManSelect` (Unstable with ~10,884.6 iters. Increase `minEpochIterations` to e.g. 108846)
| 178,316.60 | 5,608.00 | 1.2% | 0.01 | `AssembleBlock`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 70.74 | 14,135,385.25 | 0.4% | 0.01 | `Base58CheckEncode`
| 16.89 | 59,215,277.84 | 0.1% | 0.01 | `Base58Decode`
| 51.93 | 19,257,052.04 | 0.7% | 0.01 | `Base58Encode`
| 8.99 | 111,291,118.11 | 0.4% | 0.01 | `Bech32Decode`
| 19.17 | 52,177,116.01 | 0.3% | 0.01 | `Bech32Encode`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 112.83 | 8,862,744.80 | 2.2% | 0.01 | `BenchLockedPool`
| 21.95 | 45,555,803.44 | 0.7% | 0.01 | `BenchTimeDeprecated`
| 14.01 | 71,377,681.89 | 0.6% | 0.01 | `BenchTimeMillis`
| 13.74 | 72,789,850.10 | 0.6% | 0.01 | `BenchTimeMillisSys`
| 1.56 | 643,011,027.82 | 0.4% | 0.01 | `BenchTimeMock`
| 42,455,583.00 | 23.55 | 1.4% | 0.47 | `BlockToJsonVerbose`
| 27,407,375.00 | 36.49 | 0.7% | 0.30 | `BlockToJsonVerboseWrite`
| 364,194.67 | 2,745.78 | 0.3% | 0.01 | `BnBExhaustion`
| ns/job | job/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 134.26 | 7,448,339.44 | 8.5% | 0.06 | :wavy_dash: `CCheckQueueSpeedPrevectorJob` (Unstable with ~10.9 iters. Increase `minEpochIterations` to e.g. 109)
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 290.78 | 3,439,034.18 | 2.0% | 0.01 | `CCoinsCaching`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 1.50 | 667,865,361.48 | 0.3% | 0.02 | `CHACHA20_1MB`
| 1.50 | 665,373,542.42 | 0.5% | 0.01 | `CHACHA20_256BYTES`
| 1.51 | 660,639,122.49 | 0.5% | 0.01 | `CHACHA20_64BYTES`
| 4.25 | 235,313,390.71 | 1.1% | 0.05 | `CHACHA20_POLY1305_AEAD_1MB_ENCRYPT_DECRYPT`
| 2.10 | 476,986,880.51 | 0.3% | 0.02 | `CHACHA20_POLY1305_AEAD_1MB_ONLY_ENCRYPT`
| 5.18 | 192,977,099.24 | 0.3% | 0.01 | `CHACHA20_POLY1305_AEAD_256BYTES_ENCRYPT_DECRYPT`
| 2.61 | 383,154,747.84 | 0.9% | 0.01 | `CHACHA20_POLY1305_AEAD_256BYTES_ONLY_ENCRYPT`
| 8.16 | 122,549,816.34 | 0.5% | 0.01 | `CHACHA20_POLY1305_AEAD_64BYTES_ENCRYPT_DECRYPT`
| 4.09 | 244,673,594.93 | 0.3% | 0.01 | `CHACHA20_POLY1305_AEAD_64BYTES_ONLY_ENCRYPT`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 286,430.67 | 3,491.25 | 1.3% | 0.01 | `CoinSelection`
| 142,961,750.00 | 6.99 | 1.0% | 1.57 | `ComplexMemPool`
| ns/elem | elem/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 97.95 | 10,208,863.13 | 2.0% | 0.01 | `ConstructGCSFilter`
| ns/block | block/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 2,031,333.00 | 492.29 | 2.0% | 0.02 | `DeserializeAndCheckBlockTest`
| 1,440,167.00 | 694.36 | 6.8% | 0.02 | :wavy_dash: `DeserializeBlockTest` (Unstable with ~1.0 iters. Increase `minEpochIterations` to e.g. 10)
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 3,465,917.00 | 288.52 | 1.8% | 0.04 | `DuplicateInputs`
| 6,533.51 | 153,057.16 | 0.2% | 0.01 | `EvictionProtection0Networks250Candidates`
| 4,856.92 | 205,891.77 | 0.6% | 0.01 | `EvictionProtection1Networks250Candidates`
| 7,633.33 | 131,004.42 | 0.2% | 0.01 | `EvictionProtection2Networks250Candidates`
| 1,687.85 | 592,469.06 | 0.7% | 0.01 | `EvictionProtection3Networks050Candidates`
| 5,331.43 | 187,566.99 | 1.4% | 0.01 | `EvictionProtection3Networks100Candidates`
| 11,749.06 | 85,113.22 | 0.4% | 0.01 | `EvictionProtection3Networks250Candidates`
| 1.95 | 514,043,503.49 | 0.2% | 0.01 | `FastRandom_1bit`
| 6.96 | 143,596,687.37 | 1.3% | 0.01 | `FastRandom_32bit`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 0.45 | 2,209,756,786.32 | 0.4% | 0.01 | `HASH_1MB`
| 0.70 | 1,430,511,772.84 | 0.3% | 0.01 | `HASH_256BYTES`
| 1.44 | 693,146,529.93 | 0.1% | 0.01 | `HASH_64BYTES`
| ns/elem | elem/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 16,383.60 | 61,036.63 | 0.5% | 0.01 | `MatchGCSFilter`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 1.71 | 585,234,378.50 | 0.2% | 0.01 | `MempoolCheck`
| 12,901.52 | 77,510.25 | 1.5% | 0.01 | `MempoolEviction`
| ns/leaf | leaf/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 100.83 | 9,917,550.24 | 0.3% | 0.01 | `MerkleRoot`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 3,826.66 | 261,324.49 | 0.1% | 0.01 | `MuHash`
| 3,181.70 | 314,297.76 | 0.8% | 0.01 | `MuHashDiv`
| 3,064.09 | 326,360.85 | 0.4% | 0.01 | `MuHashMul`
| 640.94 | 1,560,196.68 | 0.7% | 0.01 | `MuHashPrecompute`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 0.61 | 1,647,140,137.35 | 2.0% | 0.01 | `POLY1305_1MB`
| 0.63 | 1,597,537,163.94 | 1.2% | 0.01 | `POLY1305_256BYTES`
| 0.68 | 1,476,493,149.63 | 0.3% | 0.01 | `POLY1305_64BYTES`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 32.21 | 31,045,173.15 | 1.7% | 0.01 | `PrePadded`
| 3.38 | 296,252,812.00 | 2.6% | 0.01 | `PrevectorClearNontrivial`
| 6.39 | 156,526,424.87 | 0.4% | 0.01 | `PrevectorClearTrivial`
| 217.64 | 4,594,705.61 | 0.4% | 0.01 | `PrevectorDeserializeNontrivial`
| 13.40 | 74,619,022.60 | 1.3% | 0.01 | `PrevectorDeserializeTrivial`
| - | - | - | - | :boom: `PrevectorDestructorNontrivial` (iterations overflow. Maybe your code got optimized away?)
| - | - | - | - | :boom: `PrevectorDestructorTrivial` (iterations overflow. Maybe your code got optimized away?)
| 1.64 | 610,258,147.63 | 0.2% | 0.01 | `PrevectorResizeNontrivial`
| 3.27 | 306,072,750.48 | 0.4% | 0.01 | `PrevectorResizeTrivial`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 2.33 | 428,954,423.59 | 1.7% | 0.03 | `RIPEMD160`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 63.78 | 15,678,893.15 | 0.5% | 0.01 | `RegularPadded`
| 273.37 | 3,658,089.62 | 1.4% | 0.01 | `RollingBloom`
| 11,644.32 | 85,878.80 | 1.0% | 0.01 | `RollingBloomReset`
| 4,668,333.00 | 214.21 | 3.0% | 0.05 | `RpcMempool`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 1.34 | 745,133,717.97 | 0.4% | 0.01 | `SHA1`
| 0.45 | 2,214,532,871.97 | 0.3% | 0.01 | `SHA256`
| 1.58 | 632,002,453.33 | 1.1% | 0.01 | `SHA256D64_1024`
| 1.15 | 872,492,425.69 | 0.3% | 0.01 | `SHA256_32b`
| 1.60 | 624,609,618.99 | 0.2% | 0.02 | `SHA3_256_1M`
| 1.91 | 523,194,794.84 | 1.5% | 0.02 | `SHA512`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 34.31 | 29,149,872.12 | 1.5% | 0.01 | `SipHash_32b`
| 3.68 | 271,756,354.10 | 2.3% | 0.01 | `Trig`
| 40,136.23 | 24,915.14 | 0.4% | 0.01 | `VerifyNestedIfScript`
| 61,812.50 | 16,177.96 | 0.4% | 0.01 | `VerifyScriptBench`
| 12,390.00 | 80,710.25 | 0.1% | 0.01 | `WalletBalanceClean`
| 95,013.89 | 10,524.78 | 0.7% | 0.01 | `WalletBalanceDirty`
| 12,472.41 | 80,177.00 | 0.6% | 0.01 | `WalletBalanceMine`
| 15.84 | 63,123,215.29 | 0.3% | 0.01 | `WalletBalanceWatch`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment