GithubHelp home page GithubHelp logo

mycroft / chainstate Goto Github PK

View Code? Open in Web Editor NEW
88.0 10.0 59.0 27 KB

Bitcoin & altcoins chainstate (old & new formats) parser

Home Page: https://balances.crypto-nerdz.org/

License: MIT License

Makefile 5.77% C++ 88.18% Shell 6.04%
bitcoin chainstate-parser segwit bech32

chainstate's Introduction

Bitcoin core chainstate parser

It is based on bitcoin core 0.15.1 client.

The bitcoin core's chainstate stores all blockchain's UTXOs. By parsing it, you can know where bitcoins are, how much are stored on each wallets, etc.

This parser handles all types of bitcoins addresses, like P2PKH (starting by 1), P2SH (starting by 1 or 3) and newer P2WPKH (bech32).

Some code was ripped of the Bitcoin core client, by the way. So, this software is under MIT licence.

Deps

You need to get google's leveldb with C++ headers installed, or it won't compile/link.

Build

$ git submodule init
$ git submodule update
$ make
[...]
g++ -o chainstate chainstate.o hex.o varint.o pubkey.o -Lsecp256k1/.libs -lsecp256k1 -lcrypto -lleveldb -Llibbase58/.libs -lbase58 -Lbech32/ref/c -lbech32
$

If it doesn't build, you may have additional deps configured in a submodule. You will want to add those deps into the Makefile as well. Or you can also contribute by doing a proper Makefile ;)

How to run

You should stop bitcoin's client or daemon before copying the chainstate:

$ cp -Rp ~/.bitcoin/chainstate state
$ time ./chainstate >/tmp/cs.output 2>/tmp/cs.errors
real    8m36.144s
user    7m32.441s
sys     1m3.704s

$ head /tmp/cs.output
last block: 0000000000000000004e0f5635ad8b2e58ebd0a4f02c68c604d1b5697425ce72
eacfdcd42b27112ab6c8b435abec20181d05b0ba5d4f1829c002cc3ef0000000;1NwjXC31Enh5aqGHQbCtev9B7Rhk4knuEJ;1838
0118dd986e59473732239d39cb3b8890bf32677719dd8933b05f6614f4020000;32i3fvUTZkq2zeHBuosYDkiSCyMDhP62eo;132000
033e83e3204b0cc28724e147f6fd140529b2537249f9c61c9de9972750030000;1KaPHfvVWNZADup3Yc26SfVdkTDvvHySVX;65279
a53421b937be7bfe89ef6cc3f4124706b560af393b527e3e3d9d0c285b050000;1Lcd4mL7Zt53QTyR4wFJSksuyxCtfpTtws;2789

$ wc -l /tmp/cs.output /tmp/cs.errors
  59516004 /tmp/cs.output
    409643 /tmp/cs.errors
  59925647 total

$ grep 1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX /tmp/cs.output | awk -F ';' '{sum += $3} END {print sum}'
1804638579

Want to thank me ? More feature or more explanations ?

Please consider helping me:

  • BTC: 3G734WzCrphZxN7afnrbwunZjV8MBqWUUV
  • BCH: 1MQEd3csWAVRWcgVbqk8CoZYf312VM9vp1
  • LTC: MEQA2uDajDiT3EyH1opRvNwywTDLvskLnq

chainstate's People

Contributors

mycroft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chainstate's Issues

can NOT find my address in the result file with updated blockchain data

after bitcoin-qt synchronized with the whole net, I stop it, generate a file with 49,332,296 lines about 5.378 GB, but I suddenly found an address 1DNJgtkjF3hbn5QCPCuvvYfBH785UMD3AT not in the generated file, what's the matter, is there an error with my block chain data *.blk ? or with my chain state file *.ldb, thanks

Litecoin bech32 wrong format

Hey great tool, but the litecoin export seems to handle bech32 addresses incorrectly.. they appear in the bitcoin format starting with bc1 instead of ltc1.. did is miss a parameter or is there a way to convert those bc1 addresses to the correct format?

aborting with error

Hi @mycroft

I have installed the chainstate without errors/warnings but it won't run.

[xuser@power chainstate]$ time ./chainstate >/tmp/cs.output 2>/tmp/cs.errors
Aborted

real    0m0.024s
user    0m0.014s
sys     0m0.004s
[xuser@power chainstate]$

And I am getting

[xuser@power chainstate]$ cat /tmp/cs.errors
chainstate: chainstate.cc:82: int main(int, char**): Assertion `status.ok()' failed.
[xuser@power chainstate]$

CentOS 7 x64
LevelDB 1.12.0 (installed via yum from epel repo)

Any ideas?

Thanks in advance :)

The address balance isn't correct according to your example

@mycroft
I run the chainstate according your steps.

ubuntu@uat:~/chainstate$ cp -Rp ~/.bitcoin/chainstate state
ubuntu@uat:~/chainstate$ time ./chainstate >/tmp/cs.output 2>/tmp/cs.errors

real	9m0.811s
user	7m16.036s
sys	1m36.024s
ubuntu@uat:~/chainstate$ head /tmp/cs.output
a59f2e72830363c38a438d12236a15d1ca3074ce980873bd7f3a1699f7010000;0;19LMLe9TmMngKVxSpXZ5aGvtXzebV8pdrw;325380
9111f7091b26bd53fd363f0692bf0b027cf50a21d1c6e2e9a4ed2c3416030000;1;1CbK2GcXDwB7H15Eg38zVpAeQD4kpVDZPz;1600000
9111f7091b26bd53fd363f0692bf0b027cf50a21d1c6e2e9a4ed2c3416030000;2;17MsVhAcbpiBtH9mJG6edKCSiHcq36KsHA;409600000
033e83e3204b0cc28724e147f6fd140529b2537249f9c61c9de9972750030000;0;1KaPHfvVWNZADup3Yc26SfVdkTDvvHySVX;65279
e1c9467a885a156e56a29d9c854e65674d581ad75611b02290454b4862060000;1;1LpCmEejWLNfZigApMPwUY9nZTS8NTJCNS;9466355
9a2098c155b71bb78615c785ab164a53a85343a11a1611401e35486881060000;0;33RMC3Y7z2h27h5s11AQWPd3kpSq2QbDwv;6349
818f5b9e3ede69da765d4c24684e813057c9b1f059e098661369b0a2ee060000;0;18Y9yhjU9g2jjJmvaUy7TmUNZH9iPzQ4dd;300000
d2f5e439152d076593a145581f8d76ea2e48ed155285b9a245cd42dd06070000;0;1EKHTvovYWHfUJ6i9vsoidyTPQauCPH1qC;100000
ea0c69fbd2389556b01771948ffc0507cf303bdc5a1b91b31acf9ecf6a070000;1;1fkEhLpPKdmKtaxKdp4yDp1c87dF7GDub;27668
05eafead65250a24b1592f8a006cbeab16a7b17ed2616507c5e0bd67bd070000;1;15KmfJcGNfL29vpsSJ37uPzTQfr8Qe17Gq;32000
ubuntu@uat:~/chainstate$ wc -l /tmp/cs.output /tmp/cs.errors
  51365084 /tmp/cs.output
    410450 /tmp/cs.errors
  51775534 total
ubuntu@uat:~/chainstate$ grep 1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX /tmp/cs.output | awk -F ';' '{sum += $3} END {print sum}'
847
ubuntu@uat:~/chainstate$

the address 1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX balance is 19.47044453 BTC. It 's not the same as the result of chainstate.please help me check this issue.

ubuntu@uat:~/chainstate$ ls state/
232437.ldb  232711.ldb  232974.ldb  233235.ldb  233496.ldb  233757.ldb
232438.ldb  232712.ldb  232975.ldb  233236.ldb  233497.ldb  233758.ldb
232439.ldb  232713.ldb  232976.ldb  233237.ldb  233498.ldb  233759.ldb
232440.ldb  232714.ldb  232977.ldb  233238.ldb  233499.ldb  233760.ldb
232441.ldb  232715.ldb  232978.ldb  233239.ldb  233500.ldb  233761.ldb
232442.ldb  232716.ldb  232979.ldb  233240.ldb  233501.ldb  233762.ldb
232443.ldb  232717.ldb  232980.ldb  233241.ldb  233502.ldb  233763.ldb
232444.ldb  232718.ldb  232981.ldb  233242.ldb  233503.ldb  233764.ldb
232445.ldb  232719.ldb  232982.ldb  233243.ldb  233504.ldb  233765.ldb
232448.ldb  232720.ldb  232983.ldb  233244.ldb  233505.ldb  233766.ldb
232449.ldb  232721.ldb  232984.ldb  233245.ldb  233506.ldb  233767.ldb
232450.ldb  232722.ldb  232985.ldb  233246.ldb  233507.ldb  233768.ldb
232451.ldb  232723.ldb  232986.ldb  233247.ldb  233508.ldb  233769.ldb
232452.ldb  232724.ldb  232987.ldb  233248.ldb  233509.ldb  233770.ldb
232453.ldb  232725.ldb  232988.ldb  233249.ldb  233510.ldb  233771.ldb
232454.ldb  232726.ldb  232989.ldb  233250.ldb  233511.ldb  233772.ldb
232455.ldb  232727.ldb  232990.ldb  233251.ldb  233512.ldb  233773.ldb
232456.ldb  232728.ldb  232991.ldb  233252.ldb  233513.ldb  233774.ldb
232457.ldb  232729.ldb  232992.ldb  233253.ldb  233514.ldb  233775.ldb
232458.ldb  232730.ldb  232993.ldb  233254.ldb  233515.ldb  233776.ldb
232459.ldb  232731.ldb  232994.ldb  233255.ldb  233516.ldb  233777.ldb
232460.ldb  232732.ldb  232995.ldb  233256.ldb  233517.ldb  233778.ldb
232461.ldb  232733.ldb  232996.ldb  233257.ldb  233518.ldb  233779.ldb
232462.ldb  232734.ldb  232997.ldb  233258.ldb  233519.ldb  233780.ldb
232463.ldb  232735.ldb  232998.ldb  233259.ldb  233520.ldb  233781.ldb
232464.ldb  232736.ldb  232999.ldb  233260.ldb  233521.ldb  233782.ldb
232465.ldb  232737.ldb  233000.ldb  233261.ldb  233522.ldb  233783.ldb
232466.ldb  232738.ldb  233001.ldb  233262.ldb  233523.ldb  233784.ldb
232467.ldb  232739.ldb  233002.ldb  233263.ldb  233524.ldb  233785.ldb
232468.ldb  232740.ldb  233003.ldb  233264.ldb  233525.ldb  233786.ldb
232469.ldb  232741.ldb  233004.ldb  233265.ldb  233526.ldb  233787.ldb
232470.ldb  232742.ldb  233005.ldb  233266.ldb  233527.ldb  233788.ldb
232471.ldb  232743.ldb  233006.ldb  233267.ldb  233528.ldb  233789.ldb
232472.ldb  232744.ldb  233007.ldb  233268.ldb  233529.ldb  233790.ldb
232473.ldb  232745.ldb  233008.ldb  233269.ldb  233530.ldb  233791.ldb
232474.ldb  232746.ldb  233009.ldb  233270.ldb  233531.ldb  233792.ldb
232475.ldb  232747.ldb  233010.ldb  233271.ldb  233532.ldb  233793.ldb
232476.ldb  232748.ldb  233011.ldb  233272.ldb  233533.ldb  233794.ldb
232477.ldb  232749.ldb  233012.ldb  233273.ldb  233534.ldb  233795.ldb
232478.ldb  232750.ldb  233013.ldb  233274.ldb  233535.ldb  233796.ldb
232479.ldb  232751.ldb  233014.ldb  233275.ldb  233536.ldb  233797.ldb
232491.ldb  232752.ldb  233015.ldb  233276.ldb  233537.ldb  233798.ldb
232492.ldb  232753.ldb  233016.ldb  233277.ldb  233538.ldb  233799.ldb
232493.ldb  232754.ldb  233017.ldb  233278.ldb  233539.ldb  233800.ldb
232494.ldb  232755.ldb  233018.ldb  233279.ldb  233540.ldb  233801.ldb
232495.ldb  232756.ldb  233019.ldb  233280.ldb  233541.ldb  233802.ldb
232496.ldb  232757.ldb  233020.ldb  233281.ldb  233542.ldb  233803.ldb
232497.ldb  232758.ldb  233021.ldb  233282.ldb  233543.ldb  233804.ldb
232498.ldb  232759.ldb  233022.ldb  233283.ldb  233544.ldb  233805.ldb
232499.ldb  232760.ldb  233023.ldb  233284.ldb  233545.ldb  233806.ldb
232500.ldb  232761.ldb  233024.ldb  233285.ldb  233546.ldb  233807.ldb
232501.ldb  232762.ldb  233025.ldb  233286.ldb  233547.ldb  233808.ldb
232502.ldb  232763.ldb  233026.ldb  233287.ldb  233548.ldb  233809.ldb
232503.ldb  232764.ldb  233027.ldb  233288.ldb  233549.ldb  233810.ldb
232504.ldb  232765.ldb  233028.ldb  233289.ldb  233550.ldb  233811.ldb
232505.ldb  232766.ldb  233029.ldb  233290.ldb  233551.ldb  233812.ldb
232506.ldb  232767.ldb  233030.ldb  233291.ldb  233552.ldb  233813.ldb
232507.ldb  232768.ldb  233031.ldb  233292.ldb  233553.ldb  233814.ldb
232508.ldb  232769.ldb  233032.ldb  233293.ldb  233554.ldb  233815.ldb
232509.ldb  232770.ldb  233033.ldb  233294.ldb  233555.ldb  233816.ldb
232510.ldb  232771.ldb  233034.ldb  233295.ldb  233556.ldb  233817.ldb
232511.ldb  232772.ldb  233035.ldb  233296.ldb  233557.ldb  233818.ldb
232512.ldb  232773.ldb  233036.ldb  233297.ldb  233558.ldb  233819.ldb
232513.ldb  232774.ldb  233037.ldb  233298.ldb  233559.ldb  233820.ldb
232514.ldb  232775.ldb  233038.ldb  233299.ldb  233560.ldb  233821.ldb
232515.ldb  232776.ldb  233039.ldb  233300.ldb  233561.ldb  233822.ldb
232516.ldb  232777.ldb  233040.ldb  233301.ldb  233562.ldb  233823.ldb
232517.ldb  232778.ldb  233041.ldb  233302.ldb  233563.ldb  233824.ldb
232518.ldb  232779.ldb  233042.ldb  233303.ldb  233564.ldb  233825.ldb
232519.ldb  232780.ldb  233043.ldb  233304.ldb  233565.ldb  233826.ldb
232520.ldb  232781.ldb  233044.ldb  233305.ldb  233566.ldb  233827.ldb
232521.ldb  232782.ldb  233045.ldb  233306.ldb  233567.ldb  233828.ldb
232522.ldb  232783.ldb  233046.ldb  233307.ldb  233568.ldb  233829.ldb
232523.ldb  232784.ldb  233047.ldb  233308.ldb  233569.ldb  233830.ldb
232524.ldb  232785.ldb  233048.ldb  233309.ldb  233570.ldb  233831.ldb
232525.ldb  232786.ldb  233049.ldb  233310.ldb  233571.ldb  233832.ldb
232526.ldb  232787.ldb  233050.ldb  233311.ldb  233572.ldb  233833.ldb
232527.ldb  232788.ldb  233051.ldb  233312.ldb  233573.ldb  233834.ldb
232528.ldb  232789.ldb  233052.ldb  233313.ldb  233574.ldb  233835.ldb
232529.ldb  232790.ldb  233053.ldb  233314.ldb  233575.ldb  233836.ldb
232530.ldb  232791.ldb  233054.ldb  233316.ldb  233576.ldb  233837.ldb
232531.ldb  232792.ldb  233055.ldb  233317.ldb  233577.ldb  233838.ldb
232532.ldb  232793.ldb  233056.ldb  233318.ldb  233578.ldb  233839.ldb
232533.ldb  232794.ldb  233057.ldb  233319.ldb  233579.ldb  233840.ldb
232534.ldb  232795.ldb  233058.ldb  233320.ldb  233580.ldb  233841.ldb
232535.ldb  232796.ldb  233059.ldb  233321.ldb  233581.ldb  233842.ldb
232536.ldb  232797.ldb  233060.ldb  233322.ldb  233582.ldb  233843.ldb
232537.ldb  232798.ldb  233061.ldb  233323.ldb  233583.ldb  233844.ldb
232538.ldb  232799.ldb  233062.ldb  233324.ldb  233584.ldb  233845.ldb
232539.ldb  232800.ldb  233063.ldb  233325.ldb  233585.ldb  233846.ldb
232540.ldb  232801.ldb  233064.ldb  233326.ldb  233586.ldb  233847.ldb
232541.ldb  232802.ldb  233065.ldb  233327.ldb  233587.ldb  233848.ldb
232542.ldb  232803.ldb  233066.ldb  233328.ldb  233588.ldb  233849.ldb
232543.ldb  232804.ldb  233067.ldb  233329.ldb  233589.ldb  233850.ldb
232544.ldb  232805.ldb  233068.ldb  233330.ldb  233590.ldb  233851.ldb
232545.ldb  232806.ldb  233069.ldb  233331.ldb  233591.ldb  233852.ldb
232546.ldb  232807.ldb  233070.ldb  233332.ldb  233592.ldb  233855.ldb
232547.ldb  232808.ldb  233071.ldb  233333.ldb  233593.ldb  233856.ldb
232548.ldb  232809.ldb  233072.ldb  233334.ldb  233594.ldb  233857.ldb
232549.ldb  232810.ldb  233073.ldb  233335.ldb  233595.ldb  233858.ldb
232550.ldb  232811.ldb  233074.ldb  233336.ldb  233596.ldb  233859.ldb
232551.ldb  232812.ldb  233075.ldb  233337.ldb  233597.ldb  233860.ldb
232552.ldb  232813.ldb  233076.ldb  233338.ldb  233598.ldb  233861.ldb
232553.ldb  232814.ldb  233077.ldb  233339.ldb  233599.ldb  233862.ldb
232555.ldb  232815.ldb  233078.ldb  233340.ldb  233600.ldb  233863.ldb
232556.ldb  232816.ldb  233079.ldb  233341.ldb  233601.ldb  233864.ldb
232557.ldb  232817.ldb  233080.ldb  233342.ldb  233602.ldb  233865.ldb
232558.ldb  232818.ldb  233081.ldb  233343.ldb  233603.ldb  233866.ldb
232559.ldb  232819.ldb  233082.ldb  233344.ldb  233604.ldb  233873.ldb
232560.ldb  232820.ldb  233083.ldb  233345.ldb  233605.ldb  233874.ldb
232561.ldb  232821.ldb  233084.ldb  233346.ldb  233606.ldb  233875.ldb
232562.ldb  232822.ldb  233085.ldb  233347.ldb  233607.ldb  233876.ldb
232563.ldb  232823.ldb  233086.ldb  233348.ldb  233608.ldb  233877.ldb
232564.ldb  232824.ldb  233087.ldb  233349.ldb  233609.ldb  233878.ldb
232565.ldb  232825.ldb  233088.ldb  233350.ldb  233610.ldb  233879.ldb
232566.ldb  232826.ldb  233089.ldb  233351.ldb  233611.ldb  233880.ldb
232567.ldb  232827.ldb  233090.ldb  233352.ldb  233612.ldb  233881.ldb
232568.ldb  232828.ldb  233091.ldb  233353.ldb  233613.ldb  233882.ldb
232569.ldb  232829.ldb  233092.ldb  233354.ldb  233614.ldb  233883.ldb
232570.ldb  232830.ldb  233093.ldb  233355.ldb  233615.ldb  233884.ldb
232571.ldb  232831.ldb  233094.ldb  233356.ldb  233616.ldb  233885.ldb
232572.ldb  232832.ldb  233095.ldb  233357.ldb  233617.ldb  233886.ldb
232573.ldb  232833.ldb  233096.ldb  233358.ldb  233618.ldb  233887.ldb
232574.ldb  232834.ldb  233097.ldb  233359.ldb  233619.ldb  233888.ldb
232575.ldb  232835.ldb  233098.ldb  233360.ldb  233620.ldb  233889.ldb
232576.ldb  232836.ldb  233099.ldb  233361.ldb  233621.ldb  233890.ldb
232577.ldb  232837.ldb  233100.ldb  233362.ldb  233622.ldb  233891.ldb
232578.ldb  232838.ldb  233101.ldb  233363.ldb  233623.ldb  233892.ldb
232579.ldb  232839.ldb  233102.ldb  233364.ldb  233624.ldb  233893.ldb
232580.ldb  232840.ldb  233103.ldb  233365.ldb  233625.ldb  233894.ldb
232581.ldb  232841.ldb  233104.ldb  233366.ldb  233626.ldb  233895.ldb
232582.ldb  232842.ldb  233105.ldb  233367.ldb  233627.ldb  233896.ldb
232583.ldb  232843.ldb  233107.ldb  233368.ldb  233628.ldb  233897.ldb
232584.ldb  232844.ldb  233108.ldb  233369.ldb  233629.ldb  233898.ldb
232585.ldb  232845.ldb  233109.ldb  233370.ldb  233630.ldb  233899.ldb
232586.ldb  232846.ldb  233110.ldb  233371.ldb  233631.ldb  233900.ldb
232587.ldb  232847.ldb  233111.ldb  233372.ldb  233632.ldb  233901.ldb
232588.ldb  232848.ldb  233112.ldb  233373.ldb  233633.ldb  233902.ldb
232589.ldb  232849.ldb  233113.ldb  233374.ldb  233634.ldb  233903.ldb
232590.ldb  232850.ldb  233114.ldb  233375.ldb  233635.ldb  233904.ldb
232591.ldb  232851.ldb  233115.ldb  233376.ldb  233636.ldb  233905.ldb
232592.ldb  232852.ldb  233116.ldb  233377.ldb  233637.ldb  233906.ldb
232593.ldb  232853.ldb  233117.ldb  233378.ldb  233638.ldb  233907.ldb
232594.ldb  232854.ldb  233118.ldb  233379.ldb  233639.ldb  233908.ldb
232595.ldb  232855.ldb  233119.ldb  233380.ldb  233640.ldb  233909.ldb
232596.ldb  232856.ldb  233120.ldb  233381.ldb  233641.ldb  233910.ldb
232597.ldb  232857.ldb  233121.ldb  233382.ldb  233642.ldb  233911.ldb
232598.ldb  232858.ldb  233122.ldb  233383.ldb  233643.ldb  233912.ldb
232599.ldb  232859.ldb  233123.ldb  233384.ldb  233644.ldb  233913.ldb
232600.ldb  232860.ldb  233124.ldb  233385.ldb  233645.ldb  233914.ldb
232601.ldb  232861.ldb  233125.ldb  233386.ldb  233646.ldb  233915.ldb
232602.ldb  232862.ldb  233126.ldb  233387.ldb  233647.ldb  233916.ldb
232603.ldb  232863.ldb  233127.ldb  233388.ldb  233648.ldb  233917.ldb
232604.ldb  232864.ldb  233128.ldb  233389.ldb  233649.ldb  233918.ldb
232605.ldb  232865.ldb  233129.ldb  233390.ldb  233650.ldb  233919.ldb
232606.ldb  232866.ldb  233130.ldb  233391.ldb  233651.ldb  233920.ldb
232607.ldb  232867.ldb  233131.ldb  233392.ldb  233652.ldb  233921.ldb
232608.ldb  232868.ldb  233132.ldb  233393.ldb  233653.ldb  233922.ldb
232609.ldb  232869.ldb  233133.ldb  233394.ldb  233654.ldb  233923.ldb
232610.ldb  232870.ldb  233134.ldb  233395.ldb  233655.ldb  233924.ldb
232611.ldb  232871.ldb  233135.ldb  233396.ldb  233656.ldb  233925.ldb
232612.ldb  232872.ldb  233136.ldb  233397.ldb  233657.ldb  233926.ldb
232613.ldb  232874.ldb  233137.ldb  233398.ldb  233658.ldb  233927.ldb
232614.ldb  232875.ldb  233138.ldb  233399.ldb  233659.ldb  233928.ldb
232615.ldb  232876.ldb  233139.ldb  233400.ldb  233660.ldb  233929.ldb
232616.ldb  232877.ldb  233140.ldb  233401.ldb  233661.ldb  233930.ldb
232617.ldb  232878.ldb  233141.ldb  233402.ldb  233662.ldb  233931.ldb
232618.ldb  232879.ldb  233142.ldb  233403.ldb  233663.ldb  233932.ldb
232619.ldb  232880.ldb  233143.ldb  233404.ldb  233664.ldb  233933.ldb
232620.ldb  232881.ldb  233144.ldb  233405.ldb  233665.ldb  233934.ldb
232621.ldb  232882.ldb  233145.ldb  233406.ldb  233666.ldb  233935.ldb
232622.ldb  232883.ldb  233146.ldb  233407.ldb  233667.ldb  233936.ldb
232623.ldb  232884.ldb  233147.ldb  233408.ldb  233668.ldb  233937.ldb
232624.ldb  232885.ldb  233148.ldb  233409.ldb  233669.ldb  233938.ldb
232625.ldb  232886.ldb  233149.ldb  233410.ldb  233670.ldb  233939.ldb
232626.ldb  232887.ldb  233150.ldb  233411.ldb  233671.ldb  233940.ldb
232627.ldb  232888.ldb  233151.ldb  233412.ldb  233672.ldb  233941.ldb
232628.ldb  232889.ldb  233152.ldb  233413.ldb  233673.ldb  233942.ldb
232629.ldb  232890.ldb  233153.ldb  233414.ldb  233674.ldb  233943.ldb
232630.ldb  232891.ldb  233154.ldb  233415.ldb  233675.ldb  233944.ldb
232631.ldb  232892.ldb  233155.ldb  233416.ldb  233676.ldb  233945.ldb
232632.ldb  232893.ldb  233156.ldb  233417.ldb  233677.ldb  233946.ldb
232633.ldb  232894.ldb  233157.ldb  233418.ldb  233678.ldb  233947.ldb
232634.ldb  232895.ldb  233158.ldb  233419.ldb  233679.ldb  233948.ldb
232635.ldb  232896.ldb  233159.ldb  233420.ldb  233680.ldb  233949.ldb
232636.ldb  232897.ldb  233160.ldb  233421.ldb  233681.ldb  233950.ldb
232637.ldb  232898.ldb  233161.ldb  233422.ldb  233682.ldb  233951.ldb
232638.ldb  232899.ldb  233162.ldb  233423.ldb  233683.ldb  233952.ldb
232639.ldb  232900.ldb  233163.ldb  233424.ldb  233684.ldb  233953.ldb
232640.ldb  232901.ldb  233164.ldb  233425.ldb  233685.ldb  233954.ldb
232641.ldb  232902.ldb  233165.ldb  233426.ldb  233686.ldb  233955.ldb
232642.ldb  232904.ldb  233166.ldb  233427.ldb  233687.ldb  233956.ldb
232643.ldb  232905.ldb  233167.ldb  233428.ldb  233688.ldb  233957.ldb
232644.ldb  232906.ldb  233168.ldb  233429.ldb  233689.ldb  233958.ldb
232645.ldb  232907.ldb  233169.ldb  233430.ldb  233690.ldb  233959.ldb
232646.ldb  232908.ldb  233170.ldb  233431.ldb  233691.ldb  233960.ldb
232647.ldb  232909.ldb  233171.ldb  233432.ldb  233692.ldb  233961.ldb
232648.ldb  232910.ldb  233172.ldb  233433.ldb  233693.ldb  233962.ldb
232649.ldb  232911.ldb  233173.ldb  233434.ldb  233694.ldb  233963.ldb
232650.ldb  232912.ldb  233174.ldb  233435.ldb  233695.ldb  233964.ldb
232651.ldb  232913.ldb  233175.ldb  233436.ldb  233696.ldb  233965.ldb
232652.ldb  232914.ldb  233176.ldb  233437.ldb  233697.ldb  233966.ldb
232653.ldb  232915.ldb  233177.ldb  233438.ldb  233698.ldb  233967.ldb
232654.ldb  232916.ldb  233178.ldb  233439.ldb  233699.ldb  233968.ldb
232655.ldb  232917.ldb  233179.ldb  233440.ldb  233700.ldb  233969.ldb
232656.ldb  232918.ldb  233180.ldb  233441.ldb  233701.ldb  233970.ldb
232657.ldb  232919.ldb  233181.ldb  233442.ldb  233702.ldb  233971.ldb
232658.ldb  232920.ldb  233182.ldb  233443.ldb  233703.ldb  233972.ldb
232659.ldb  232921.ldb  233183.ldb  233444.ldb  233704.ldb  233973.ldb
232660.ldb  232922.ldb  233184.ldb  233445.ldb  233705.ldb  233974.ldb
232661.ldb  232923.ldb  233185.ldb  233446.ldb  233706.ldb  233975.ldb
232662.ldb  232924.ldb  233186.ldb  233447.ldb  233707.ldb  233976.ldb
232663.ldb  232925.ldb  233187.ldb  233448.ldb  233708.ldb  233977.ldb
232664.ldb  232926.ldb  233188.ldb  233449.ldb  233709.ldb  233978.ldb
232665.ldb  232927.ldb  233189.ldb  233450.ldb  233710.ldb  233979.ldb
232666.ldb  232928.ldb  233190.ldb  233451.ldb  233711.ldb  233980.ldb
232667.ldb  232929.ldb  233191.ldb  233452.ldb  233712.ldb  233981.ldb
232668.ldb  232930.ldb  233192.ldb  233453.ldb  233713.ldb  233982.ldb
232669.ldb  232931.ldb  233193.ldb  233454.ldb  233714.ldb  233983.ldb
232670.ldb  232932.ldb  233194.ldb  233455.ldb  233715.ldb  233984.ldb
232671.ldb  232933.ldb  233195.ldb  233456.ldb  233716.ldb  233985.ldb
232672.ldb  232934.ldb  233196.ldb  233457.ldb  233717.ldb  233986.ldb
232673.ldb  232935.ldb  233197.ldb  233458.ldb  233718.ldb  233987.ldb
232674.ldb  232936.ldb  233198.ldb  233459.ldb  233719.ldb  233988.ldb
232675.ldb  232937.ldb  233199.ldb  233460.ldb  233720.ldb  233989.ldb
232676.ldb  232938.ldb  233200.ldb  233461.ldb  233721.ldb  233990.ldb
232677.ldb  232939.ldb  233201.ldb  233462.ldb  233722.ldb  233991.ldb
232678.ldb  232940.ldb  233202.ldb  233463.ldb  233723.ldb  233992.ldb
232679.ldb  232941.ldb  233203.ldb  233464.ldb  233724.ldb  233993.ldb
232680.ldb  232942.ldb  233204.ldb  233465.ldb  233725.ldb  233994.ldb
232681.ldb  232943.ldb  233205.ldb  233466.ldb  233726.ldb  233995.ldb
232682.ldb  232944.ldb  233206.ldb  233467.ldb  233727.ldb  233996.ldb
232683.ldb  232946.ldb  233207.ldb  233468.ldb  233728.ldb  233997.ldb
232684.ldb  232947.ldb  233208.ldb  233469.ldb  233729.ldb  233998.ldb
232685.ldb  232948.ldb  233209.ldb  233470.ldb  233730.ldb  233999.ldb
232686.ldb  232949.ldb  233210.ldb  233471.ldb  233731.ldb  234000.ldb
232687.ldb  232950.ldb  233211.ldb  233472.ldb  233732.ldb  234001.ldb
232688.ldb  232951.ldb  233212.ldb  233473.ldb  233733.ldb  234002.ldb
232689.ldb  232952.ldb  233213.ldb  233474.ldb  233734.ldb  234003.ldb
232690.ldb  232953.ldb  233214.ldb  233475.ldb  233735.ldb  234004.ldb
232691.ldb  232954.ldb  233215.ldb  233476.ldb  233736.ldb  234005.ldb
232692.ldb  232955.ldb  233216.ldb  233477.ldb  233737.ldb  234006.ldb
232693.ldb  232956.ldb  233217.ldb  233478.ldb  233738.ldb  234007.ldb
232694.ldb  232957.ldb  233218.ldb  233479.ldb  233739.ldb  234008.ldb
232695.ldb  232958.ldb  233219.ldb  233480.ldb  233740.ldb  234009.ldb
232696.ldb  232959.ldb  233220.ldb  233481.ldb  233741.ldb  234010.ldb
232697.ldb  232960.ldb  233221.ldb  233482.ldb  233742.ldb  234011.ldb
232698.ldb  232961.ldb  233222.ldb  233483.ldb  233743.ldb  234012.ldb
232699.ldb  232962.ldb  233223.ldb  233484.ldb  233744.ldb  234013.ldb
232700.ldb  232963.ldb  233224.ldb  233485.ldb  233745.ldb  234014.ldb
232701.ldb  232964.ldb  233225.ldb  233486.ldb  233747.ldb  234015.ldb
232702.ldb  232965.ldb  233226.ldb  233487.ldb  233748.ldb  234021.log
232703.ldb  232966.ldb  233227.ldb  233488.ldb  233749.ldb  chainstate
232704.ldb  232967.ldb  233228.ldb  233489.ldb  233750.ldb  CURRENT
232705.ldb  232968.ldb  233229.ldb  233490.ldb  233751.ldb  LOCK
232706.ldb  232969.ldb  233230.ldb  233491.ldb  233752.ldb  LOG
232707.ldb  232970.ldb  233231.ldb  233492.ldb  233753.ldb  LOG.old
232708.ldb  232971.ldb  233232.ldb  233493.ldb  233754.ldb  MANIFEST-234020
232709.ldb  232972.ldb  233233.ldb  233494.ldb  233755.ldb
232710.ldb  232973.ldb  233234.ldb  233495.ldb  233756.ldb

project not compile

hi i run make and this result :

thor@thor-OptiPlex-3050:~/chainstate$ make
rm -f chainstate chainstate.o hex.o varint.o pubkey.o
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -std=c++0x -c -o chainstate.o chainstate.cc
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -std=c++0x -c -o hex.o hex.cc
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -std=c++0x -c -o varint.o varint.cc
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -std=c++0x -c -o pubkey.o pubkey.cc
g++ -o chainstate chainstate.o hex.o varint.o pubkey.o -Lsecp256k1/.libs -lsecp256k1 -lcrypto -lleveldb -Llibbase58/.libs -lbase58 -Lbech32/ref/c -lbech32
//usr/local/lib/libleveldb.a(table_builder.o) : Dans la fonction « leveldb::TableBuilder::WriteBlock(leveldb::BlockBuilder*, leveldb::BlockHandle*) » :
table_builder.cc:(.text+0x7f9) : référence indéfinie vers « snappy::MaxCompressedLength(unsigned long) »
table_builder.cc:(.text+0x826) : référence indéfinie vers « snappy::RawCompress(char const*, unsigned long, char*, unsigned long*) »
//usr/local/lib/libleveldb.a(port_posix.o) : Dans la fonction « leveldb::port::InitOnce(int*, void ()()) » :
port_posix.cc:(.text+0x145) : référence indéfinie vers « pthread_once »
//usr/local/lib/libleveldb.a(format.o) : Dans la fonction « leveldb::ReadBlock(leveldb::RandomAccessFile
, leveldb::ReadOptions const&, leveldb::BlockHandle const&, leveldb::BlockContents*) » :
format.cc:(.text+0x43a) : référence indéfinie vers « snappy::GetUncompressedLength(char const*, unsigned long, unsigned long*) »
format.cc:(.text+0x5c0) : référence indéfinie vers « snappy::RawUncompress(char const*, unsigned long, char*) »
//usr/local/lib/libleveldb.a(env_posix.o) : Dans la fonction « leveldb::(anonymous namespace)::PosixEnv::StartThread(void ()(void), void*) » :
env_posix.cc:(.text+0x5ab) : référence indéfinie vers « pthread_create »
//usr/local/lib/libleveldb.a(env_posix.o) : Dans la fonction « leveldb::(anonymous namespace)::PosixEnv::Schedule(void ()(void), void*) » :
env_posix.cc:(.text+0x863) : référence indéfinie vers « pthread_create »
//usr/local/lib/libleveldb.a(env_posix.o) : Dans la fonction « leveldb::Env::Default() » :
env_posix.cc:(.text+0x235f) : référence indéfinie vers « pthread_once »
collect2: error: ld returned 1 exit status
Makefile:11 : la recette pour la cible « chainstate » a échouée
make: *** [chainstate] Erreur 1

pubkey.cc:5:10:

pubkey.cc:5:10: fatal error: openssl/sha.h: No such file or directory
#include <openssl/sha.h>

i have this when i try make

Balance accuracy problem

First of all, thank you for your project.
I am using a newer version (bitcoin-core 0.18.0 for windows, haha), but it's chainstate seems compatible. I got own balances file through your tool, but some addresses have a little different balance, for example, after

cut -d';' -f3,4 cs.out | \
    sort | \
    awk -F ';' '{ if ($1 != cur) { if (cur != "") { printf "%s;%.0f\n", cur, sum }; sum = 0; cur = $1 }; sum += $2 } END { printf "%s;%.0f\n", cur, sum }' | \
    sort -t ';' -k 2 -g -r > ${BALANCES_FILE}

and head balances-* | grep "3Nxwenay9Z8Lc9JBiywExpnEFiLp6Afp8v\|1FeexV6bAHb8ybZjqQMjJrcCrHGW9sb6uF\|3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r" I received this:

3Nxwenay9Z8Lc9JBiywExpnEFiLp6Afp8v;10784828923592
1FeexV6bAHb8ybZjqQMjJrcCrHGW9sb6uF;7995720060915
3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r;7689307218486

But it's balances are 107848289_03408_, 79957200_36267_ and 7689307_172632_.
My BitcoinCore was correctly synced, state directory size: 3603436444, blocks: 266965543715, uname -a: Linux 388e60c19d8b 4.9.13-moby #1 SMP Tue Mar 21 21:21:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Do you have any ideas? Can you reproduce the issue?
Now I am syncing 0.15.0 version to try it's chainstate, but it takes time a little.

Dogecoin errors

Doge coin gives a ton of these errors on stderr:

Record type 14 is not handled.
Index: 0e006f62667573636174655f6b6579
Value: 0846e28e656731bb91

last block: 95dec2ba0d190a6e65fbb569d8c1c1a39db94ed008ed818739bbf6aab3b1c30b

ERROR type: o on TX: 73e749cae7eb3221f83bc28e3e91b662a068b5d9b770775deb09820b71f80a00 | Version: 1
Value: 010e03096f512103c5268d1b2c69b032c4c00f0badb250fcb0991653998146676d120eb22677d8d721024221b6ce38c3810ca479fea0c3ecf44496d3cac7556375b8edc3c8ed8c6f550f2>
Remaining: 6f512103c5268d1b2c69b032c4c00f0badb250fcb0991653998146676d120eb22677d8d721024221b6ce38c3810ca479fea0c3ecf44496d3cac7556375b8edc3c8ed8c6f550f2103d>
ERROR type: o on TX: 621b36d7203d72ac6f1975a02712bcc491180b09b163e53ca35c784b0e612300 | Version: 1

1.6MB of these lines.

a question need help,thanks

in bitcoin,if we need to parse an address's UTXO in order to count it's balance,even our bitcoin node has sync all the block data,we still can't use an official PRC API to list any address's UTXO,is that so?

Sorting the output by date - from the last to the beginning

Many thanks for the useful tool.
Is it possible to sort the output data by date - from the last to the beginning?
Unfortunately I could not find this feature. After the data is processed with the help of changestate, there are no ways to sort the data by date. :(
Thanks.

obfuscation key not found

at first i got this error

cat /tmp/cs.errors
chainstate: chainstate.cc:82: int main(int, char**): Assertion `status.ok()' failed

so i followed #7

and modified as per #7 (comment)

re make and now i have

cat /tmp/cs.errors
obfuscation key not found... Please check bitcoin's log and report if bitcoin's obfuscation key not 0000000000000000.

Compilation warnings

Hi, there were warnings during compilation, how can they affect the program's performance? How to fix it?
CentOS 7
g++ v.4.8.5

$ make
rm -f chainstate chainstate.o hex.o varint.o pubkey.o
g ++ -Wall -Wextra -pedantic -Wall -Wextra -Wold-style-cast -Woverloaded-virtual -Wfloat-equal -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wshadow -Weffc ++ -Wredundant- decls -Wdouble-promotion -Winit-self -Wswitch-default -Wswitch-enum -Wundef -Wlogical-op -Winline -I. -Ilibbase58 -Isecp256k1 / include -Ibech32 / ref / c -std = c ++ 0x -c -o chainstate.o chainstate.cc
chainstate.cc: In function "int main (int, char **)":
chainstate.cc:146:26: warning: conversion to "char" from "int" may alter its value [-Wconversion]
                 value [i] ^ = obfuscate_key [i% obfuscate_key.size ()];
                          ^
chainstate.cc:166:49: warning: conversion to "unsigned int" from "uint64_t {aka long unsigned int}" may alter its value [-Wconversion]
             unsigned int nMaskCode = (code / 8) + ((code & 6)! = 0? 0: 1);
                                                 ^
chainstate.cc:242:88: warning: using deprecated cast to type [-Wold-style-cast]
                         ret = pubkey_decompress (type, value.c_str (), (unsigned char *) & pub, & publen);
                                                                                        ^
chainstate.cc:247:141: warning: using deprecated cast to type [-Wold-style-cast]
                         addr = get_addr (current_prefix.pubkey_prefix, current_prefix.pubkey_prefix_size, str_to_ripesha (string ((const char *) pub, PUBLIC_KEY_SIZE)));
                                                                                                                                             ^
chainstate.cc:299:41: warning: conversion to "int" from "uint64_t {aka long unsigned int}" may alter its value [-Wconversion]
             txn = get_next_varint (tx_num);
                                         ^
chainstate.cc:304:22: warning: conversion to "char" from "int" may alter its value [-Wconversion]
             value [i] ^ = obfuscate_key [i% obfuscate_key.size ()];
                      ^
chainstate.cc:308:24: warning: conversion to "uint32_t {aka unsigned int}" from "uint64_t {aka long unsigned int}" may alter its value [-Wconversion]
         nHeight = code >> 1;
                        ^
chainstate.cc:370:81: warning: using deprecated cast to type [-Wold-style-cast]
                 pubkey_decompress (script_type, value.c_str (), (unsigned char *) & pub, & publen);
                                                                                 ^
chainstate.cc:371:133: warning: using deprecated cast to type [-Wold-style-cast]
                 addr = get_addr (current_prefix.pubkey_prefix, current_prefix.pubkey_prefix_size, str_to_ripesha (string ((const char *) pub, PUBLIC_KEY_SIZE)));
                                                                                                                                     ^
g ++ -Wall -Wextra -pedantic -Wall -Wextra -Wold-style-cast -Woverloaded-virtual -Wfloat-equal -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wshadow -Weffc ++ -Wredundant- decls -Wdouble-promotion -Winit-self -Wswitch-default -Wswitch-enum -Wundef -Wlogical-op -Winline -I. -Ilibbase58 -Isecp256k1 / include -Ibech32 / ref / c -std = c ++ 0x -c -o hex.o hex.cc
hex.cc: In the function "std :: string hex_to_string (const string &)":
hex.cc:39:43: warning: conversion to "char" from "long int" may alter its value [-Wconversion]
         output.push_back (((p - lut) << 4) | (q - lut));
                                           ^
g ++ -Wall -Wextra -pedantic -Wall -Wextra -Wold-style-cast -Woverloaded-virtual -Wfloat-equal -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wshadow -Weffc ++ -Wredundant- decls -Wdouble-promotion -Winit-self -Wswitch-default -Wswitch-enum -Wundef -Wlogical-op -Winline -I. -Ilibbase58 -Isecp256k1 / include -Ibech32 / ref / c -std = c ++ 0x -c -o varint.o varint.cc
varint.cc: In function "uint64_t compress_amount (uint64_t)":
varint.cc:37:20: warning: conversion to "int" from "uint64_t {aka long unsigned int}" may alter its value [-Wconversion]
         int d = (n% 10);
                    ^
varint.cc: In the function "uint64_t decompress_amount (uint64_t)":
varint.cc:53:15: warning: conversion to "int" from "uint64_t {aka long unsigned int}" may alter its value [-Wconversion]
     int e = x% 10;
               ^
varint.cc:58:25: warning: conversion to "int" from "uint64_t {aka long unsigned int}" may alter its value [-Wconversion]
         int d = (x% 9) + 1;
                         ^
g ++ -Wall -Wextra -pedantic -Wall -Wextra -Wold-style-cast -Woverloaded-virtual -Wfloat-equal -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wshadow -Weffc ++ -Wredundant- decls -Wdouble-promotion -Winit-self -Wswitch-default -Wswitch-enum -Wundef -Wlogical-op -Winline -I. -Ilibbase58 -Isecp256k1 / include -Ibech32 / ref / c -std = c ++ 0x -c -o pubkey.o pubkey.cc
pubkey.cc: In the function "bool pubkey_decompress (unsigned int, const char *, unsigned char *, size_t *)":
pubkey.cc:20:19: warning: conversion to "unsigned char" from "unsigned int" may alter its value [-Wconversion]
     vch [0] = size - 2;
                   ^
pubkey.cc: In the function "std :: string get_addr (unsigned char *, size_t, std :: string)":
pubkey.cc:65:40: warning: using deprecated cast to type [-Wold-style-cast]
     sha256 ((unsigned char *) value.c_str (), value.size (), output);
                                        ^
pubkey.cc:65:40: warning: cast from type "const char *" to type "unsigned char *" casts away qualifiers [-Wcast-qual]
pubkey.cc:68:26: warning: using deprecated cast to type [-Wold-style-cast]
     value.append ((char *) output, 4);
                          ^
pubkey.cc: In the function "std :: string str_to_ripesha (std :: string, int)":
pubkey.cc:82:36: warning: using deprecated cast to type [-Wold-style-cast]
     sha256 ((unsigned char *) v.c_str (), size, output);
                                    ^
pubkey.cc:82:36: warning: cast from type "const char *" to type "unsigned char *" casts away qualifiers [-Wcast-qual]
pubkey.cc:85:32: warning: using deprecated cast to type [-Wold-style-cast]
     return string ((const char *) ripe_output, RIPEMD160_DIGEST_LENGTH);
                                ^
pubkey.cc: In the function "std :: string str_to_ripesha (std :: string)":
pubkey.cc:90:45: warning: conversion to "int" from "std :: basic_string <char> :: size_type {aka long unsigned int}" may alter its value [-Wconversion]
     return str_to_ripesha (value, value.size ());
                                             ^
pubkey.cc: In the "std :: string rebuild_bech32 (std :: string)" function:
pubkey.cc:104:48: warning: using deprecated cast to type [-Wold-style-cast]
     scriptpubkey = (unsigned char *) value.c_str ();
                                                ^
pubkey.cc:104:48: warning: cast from type "const char *" to type "unsigned char *" casts away qualifiers [-Wcast-qual]
g ++ -o chainstate chainstate.o hex.o varint.o pubkey.o -Lsecp256k1 / .libs -lsecp256k1 -lcrypto -lleveldb -Llibbase58 / .libs -lbase58 -Lbech32 / ref / c -lbech32

All balances

In your example the balance is output for one address 1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX. can make a balance output for all addresses?

error make

rm -f chainstate chainstate.o hex.o varint.o pubkey.o
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -c -o chainstate.o chainstate.cc
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -c -o hex.o hex.cc
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -c -o varint.o varint.cc
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -c -o pubkey.o pubkey.cc
g++ -o chainstate chainstate.o hex.o varint.o pubkey.o -Lsecp256k1/.libs -lsecp256k1 -lcrypto -lleveldb -Llibbase58/.libs -lbase58 -Lbech32/ref/c -lbech32
secp256k1/.libs/libsecp256k1.a(libsecp256k1_la-secp256k1.o): In function secp256k1_num_set_bin': /home/roman/chainstate/secp256k1/src/num_gmp_impl.h:49: undefined reference to __gmpn_set_str'
/home/roman/chainstate/secp256k1/src/num_gmp_impl.h:49: undefined reference to __gmpn_set_str' secp256k1/.libs/libsecp256k1.a(libsecp256k1_la-secp256k1.o): In function secp256k1_num_mod_inverse':
/home/roman/chainstate/secp256k1/src/num_gmp_impl.h:128: undefined reference to __gmpn_gcdext' secp256k1/.libs/libsecp256k1.a(libsecp256k1_la-secp256k1.o): In function secp256k1_num_get_bin':
/home/roman/chainstate/secp256k1/src/num_gmp_impl.h:34: undefined reference to __gmpn_get_str' secp256k1/.libs/libsecp256k1.a(libsecp256k1_la-secp256k1.o): In function __gmpn_sub':
/usr/include/x86_64-linux-gnu/gmp.h:2190: undefined reference to `__gmpn_sub_n'
collect2: error: ld returned 1 exit status

CLI options?

Great tool, thank you for this!

Is there a way to give arguments via cli to only output the addresses and amounts, as opposed to the whole thing?

And perhaps pointing to the chainstate location instead of copying it to the script first?

Sorry, I don't know C++, or programming in general that well to understand all the files.

Thanks.

Parsing litecoin -> terminate called after throwing an instance of 'std::out_of_range'

Hi there

I am trying to parse the litecoin chainstate. I haven't downloaded the full blockchain yet, as I wanted to get this working before I start working through the full chain.

note* Parsing Bitcoin and Dashcore chainstate worked successfully for me.

I get the following in the error file when I run the following on the litecoin chainstate:
time ./chainstate >/tmp/cs.out 2>/tmp/cs.err

cat /tmp/cs.err
Record type 14 is not handled.
Index: 0e006f62667573636174655f6b6579
Value: 085add9921d08be924

last block: 14bf5ffe0ebc17c441bea2e4ed171dd0efc44518eba5228f8b26b0c3b7f41a39

terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr: __pos (which is 1) > this->size() (which is 0)
Aborted (core dumped)

Let me know if I can provide you with more information?

obfuscation key not found...

ey not found... Please check bitcoin's log and report if bitcoin's obfuscation key not 0000000000000000.
The situation is the same as his .#15
How to solve this problem?

terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 1) > this->size() (which is 0)

Hello, starmyc!

I add REDEN (https://github.com/RedenCore/Reden/blob/master/src/chainparams.cpp)

{ "reden", { 0x3c }, 1, { 0x10 }, 1 }, // Also uses 60, 16

But have error in cs.errors:

using obfuscation key 6ae3411e08c3ee64
Record type 14 is not handled.
Index: 0e006f62667573636174655f6b6579
Value: 086ae3411e08c3ee64

last block: 64eec3081c401b2fefce63148a8e8621edef23cac15154aa4d51a6714d95ddca

terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr: __pos (which is 1) > this->size() (which is 0)

can NOT find my address in the result file with updated blockchain data

after bitcoin-qt synchronized with the whole net, I stop it, generate a file with 49,332,296 lines about 5.378 GB, but I suddenly found an address 1DNJgtkjF3hbn5QCPCuvvYfBH785UMD3AT not in the generated file, what's the matter, is there an error with my block chain data *.blk ? or with my chain state file *.ldb, thanks

all address

how to get all addresses on which there were transactions

Ubuntu 16.04 build error !

root@osboxes:~/chainstate# make
rm -f chainstate chainstate.o hex.o varint.o pubkey.o
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -c -o chainstate.o chainstate.cc

g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -c -o hex.o hex.cc
g++ -Wall -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -c -o varint.o varint.cc
varint.cc:5:1: error: ‘uint64_t’ does not name a type
uint64_t read_varint(uint64_t n)
^
varint.cc:24:1: error: ‘uint64_t’ does not name a type
uint64_t get_next_varint(string& str)
^
varint.cc:44:1: error: ‘uint64_t’ does not name a type
uint64_t decompress_amount(uint64_t x)
^
Makefile:14: recipe for target 'varint.o' failed
make: *** [varint.o] Error 1
screenshot_187

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.