Skip to content

Instantly share code, notes, and snippets.

@devrandom
Last active September 27, 2024 01:02
Show Gist options
  • Save devrandom/806265 to your computer and use it in GitHub Desktop.
Save devrandom/806265 to your computer and use it in GitHub Desktop.
Building bitcoin with gitian-builder

This is obsolete, since Bitcoin Core has moved to a more modern build system.

# First run:
apt-get install apt-cacher python-vm-builder
vi /etc/default/apt-cacher # ensure autostart is enabled
sudo service apt-cacher start
git clone git://github.com/bitcoin/bitcoin.git
git clone git://github.com/devrandom/gitian-builder.git
mkdir gitian-builder/inputs
wget 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.5.tar.gz' -O gitian-builder/inputs/miniupnpc-1.5.tar.gz
wget 'http://downloads.sourceforge.net/project/wxwindows/2.9.1/wxWidgets-2.9.1.tar.bz2' -O gitian-builder/inputs/wxWidgets-2.9.1.tar.bz2
cd gitian-builder
bin/make-base-vm --arch i386
bin/make-base-vm --arch amd64
cd ..
# To build
cd bitcoin
git pull
cd ../gitian-builder
git pull
./bin/gbuild --commit bitcoin=a452d9ee2dea7e606ec102b0a1a411da4e5e5a91 ../bitcoin/contrib/gitian.yml
---
name: bitcoin
urls:
- https://gitian.org/bitcoin-0.3.21.zip
rss:
- url: http://sourceforge.net/api/file/index/project-id/244765/mtime/desc/limit/100/rss
xpath: //item/link/text()
pattern: bitcoin-\d+.\d+.\d+-linux.zip
signers:
0A82509767C7D4A5D14DA2301AE1D35043E08E54:
weight: 40
name: BlueMatt
key: bluematt
BF6273FAEF7CC0BA1F562E50989F6B3048A116B5:
weight: 40
name: Devrandom
key: devrandom
7F2C769E1C70136857067567669476EAAA76785A:
weight: 40
name: Sipa
key: sipa
keyid: D762373D24904A3E42F33B08B9A408E71DAAC974
1CDB743D775BDD2CAC0B95E436744B67A1EC02ED:
weight: 40
name: tcatm
key: tcatm
01CDF4627A3B88AAE4A571C87588242FBE38D3A8:
weight: 80
name: "Gavin Andresen"
key: gavinandresen
minimum_weight: 160

Use the Downloader

Links

https://github.com/devrandom/gitian-builder/blob/updater/share/gitian-updater
https://github.com/devrandom/gitian-builder/blob/updater/doc/DOWNLOADER.md

sample zip file:

https://gitian.org/bitcoin-0.3.21.zip

Running

gitian-updater --config bitcoin-download-config.yml --dest /tmp/bitcoin

Alternatively, embed the configuration in the script

gitian-updater --config bitcoin-download-config.yml -m bitcoin-updater

then run the result:

./bitcoin-updater --dest /tmp/bitcoin

Expected output

Downloading: bitcoin-0.3.21.zip Bytes: 11624355
   11665408  [100.35%]
Some of the files were not checksummed:
   src/obj/nogui/.gitignore
   src/obj/.gitignore
   src/cryptopp/obj/.gitignore
   src/.gitignore
Signatures from:
    Sipa : weight 20
    Devrandom : weight 20
    BlueMatt : weight 40
    ...
Successful with signature weight 80
@devrandom
Copy link
Author

For Bitcoin release 0.3.21. The output ends up in result/bitcoin-res.yml .

See https://github.com/devrandom/bitcoin-release for signed results.

@devrandom
Copy link
Author

Disassembly of section .text:

@@ -2612,10 +2612,12 @@
2d1b: 0f 84 af 00 00 00 je 0x2dd0
2d21: 4c 8b 7f 08 mov 0x8(%rdi),%r15
2d25: 31 db xor %ebx,%ebx

  • 2d27: eb 0a jmp 0x2d33
  • 2d29: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
  • 2d30: 4d 89 f7 mov %r14,%r15
  • 2d33: 49 39 df cmp %rbx,%r15
  • 2d27: 4c 39 fb cmp %r15,%rbx
  • 2d2a: 72 0c jb 0x2d38
  • 2d2c: eb 42 jmp 0x2d70
  • 2d2e: 66 90 nop
  • 2d30: 49 39 de cmp %rbx,%r14
  • 2d33: 4d 89 f7 mov %r14,%r15
    2d36: 76 38 jbe 0x2d70
    2d38: 4d 8d 34 1f lea (%r15,%rbx,1),%r14
    2d3c: 4c 89 e7 mov %r12,%rdi

@devrandom
Copy link
Author

@jrick
Copy link

jrick commented Nov 2, 2021

@devrandom this link appears obsolete as well (404)

@devrandom
Copy link
Author

I think Bitcoin Core moved to Guix based builds

@jrick
Copy link

jrick commented Nov 2, 2021

I believe so too, but found this gist linked from https://gitian.org/.

@Antonio1034
Copy link

Oh, my dream is to fly to Miami. Now I am only at the initial stage of my acquaintance with investments and trade. By the way, I found a good article https://tabtrader.com/articles/top-10-bitcoin-scams therefore, for newcomers, I recommend reading it. I hope I find out how it works and save enough money for life.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment