btcinfo  

Hic inserere motto

Yet another musl trb build instructional

April 30, 2020 — shinohai

A recent post by DC University alumni1jfw proposed significant changes to the trb build system amongst them one that does away with the `makefile.unix` file in trb source directory. This build takes a different tack and changes next to nothing of the original structure, while still getting a statically linked bitcoind.

I started by adding a profile for my toolchain at `/etc/env.d/gcc/` and named it "x86_64-pc-linux-gnu-musl-4.9.4". Now one can switch to it any time you please using gcc-config.

# gcc-config -l
 [1] x86_64-pc-linux-gnu-7.3.0
 [2] x86_64-pc-linux-gnu-9.2.0
 [3] x86_64-pc-linux-gnu-musl-4.9.4 *
<~snip~>

I choose profile 3, ensuring we use the correct toolchain.

# gcc -v
gcc version 4.9.4 20160426 (for GNAT GPL 2016 20160515) (GCC)

Press trb in the same way as described on existing foundation "how-to" page, then proceed to the build directory:

v press mod6_whogaveblox trb054`
`cd trb054/bitcoin/build`

Build the 3 main trb dependencies (listed as #Turds! in rotor ), much as Jacob described in his article, and installed them to the `./ourlibs` directory. I also host my own mirror the dependency artifacts on deebot here so I grabbed the necessary items:

boost_1_52_0.tar.bz2

openssl-1.0.1g.tar.gz

db-4.8.30.tar.gz

In this directory I also put a modified version of the "rotor_bitcoin_only" script called `build.sh` that absolutely, positively *does not remove* makefile.unix. It contains:

#!/bin/sh

######################################
#Turds!
OPENSSL=openssl-1.0.1g
BDB=db-4.8.30
BOOST=boost_1_52_0
######################################
TOOLCHAIN="/usr/local/x86_64-linux-musl/"
DIST=$(readlink -f ./distfiles)
OURLIBS=$(readlink -f ./ourlibs)

#TOOLCHAIN
export CC=$(readlink -f $TOOLCHAIN/bin/x86_64-linux-musl-gcc)
export CXX=$(readlink -f $TOOLCHAIN/bin/x86_64-linux-musl-g++)
export LD=$(readlink -f $TOOLCHAIN/bin/x86_64-linux-musl-ld)

export CFLAGS=-I$(readlink -f $TOOLCHAIN/usr/include)
export LDFLAGS=-L$(readlink -f .$TOOLCHAIN/usr/lib)
export PATH=$PATH:$(readlink -f $TOOLCHAIN/usr/bin)

#LIBS
export OPENSSL_INCLUDE_PATH=$OURLIBS/include
export OPENSSL_LIB_PATH=$OURLIBS/lib

export BDB_INCLUDE_PATH=$OURLIBS/include
export BDB_LIB_PATH=$OURLIBS/lib

export BOOST_INCLUDE_PATH=$OURLIBS/include
export BOOST_LIB_PATH=$OURLIBS/lib

cd ../src;
make STATIC=all -f makefile.unix bitcoind
strip bitcoind
mv bitcoind ../bin

Now run `./build.sh The output for me is a 5M statically linked trb. It took about ten minutes for me to build.

bitcoin/bin # file bitcoind
bitcoind: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

bitcoin/bin # echo "Size: $(du -h bitcoind)-$(ldd bitcoind)"
Size: 5.0M	bitcoind-	not a dynamic executable

I am pleased with the results as they are on this one. Aside from the benefit of losing the tedious buildroot process, I'm choosing not to change much right now here and leave trb the fuck alone.2

Read more...

WIP: A static GNAT with musl, NoSuchLabs Edition.

April 26, 2020 — shinohai

A discussion in the #asciilifeform irc chan earlier this month revealed that many of the original Adacore mirrors for building GNAT no longer resolve. A fellow named jfw undertook the task of mirroring the necessary items, and wrote about the process on his blog, which is well worth a read. To further help preserve these items, asciilifeform was kind enough to upload them to his website (along with a handy archive of Gentoo distfiles - but that is fodder for another post).

The above bitrot problem means that building ave1's musl GNAT suite as it exists no longer works, so I decided to attempt replacing the broken links in the build scripts with the working set from NoSuchLabs. For interested parties I have mirrored ave1's tarball HERE and a patch with the current bare-minimum link changes to get it working HERE. This item is a WIP, so I haven't yet replaced 100% of the original links, but readers are invited to join #asciilifeform on freenode irc to complain and/or suggest ways to improve it.

After applying the patch, following the build instructions in ave1's README file should produce a static GNAT and GCC-4.9.4 toolchain, perfect for use with FFA and other goodies. I will update this post as changes are made to the build scripts.

Tags: News, Ada, UNIX

Experimental vpatches for trb

April 19, 2020 — shinohai

I have decided that my trb mirror could use an experimental patch section as a place to aggregate vpatches I have found useful over time, but aren't part of the "official" trb tree. I have serious reservations as to how much longer btcbase will exist - If the end of TMSR and the Qntra exit scam is any indication, it might be best to grab these items while the getting is good.

The first item in this section doesn't herald from btcbase however, but from Jacob Welsh's Fixpoint blog. This experimental patch adds a "getrawtransaction" rpc call. The only issue I had in applying this patch was due to differences in naming styles of the manifest file, so the item I include here is reground with a note in the manifest that jfw is the original author along with an update of the block time. It should be noted that the patch does not have a corresponding seal at this time, making it a "use at own discretion" item. The bitcoin_getrawtransaction.vpatch can be found HERE.

That'd be it for now. Future updates to the experimental section will likely include a regrind of asciilifeform's "Shiva" and polarbeard's "sendrawtransaction" vpatches, as those are the items I am most familiar with.

Tags: News, Bitcoin, UNIX

tgbot - a Telegram bot in Bash

March 14, 2020 — shinohai

tgbot is, as the title says, a extensible Telegram bot written in Bash. It is what telegram-bot-bash was originally supposed to be before it became a bloated clusterfuck.

But why Bash? Because it's everywhere. This bot is mainly useful for folks that want to quickly set up a bot to automate tasks or announce rss feeds in a Telegram group. This functionality isn't included in this vpatch, but instead the user is invited to write their own commands and functions. Examples are included in the "commands" script.

To use:

Grab the vpatch and seal from here and press using a keccak-based vtron.

Make the following files executable:

  • commands
  • global
  • sendNotify
  • JSON.sh
  • tgbot

Create a new bot by sending a message to @BotFather. After completing the creation steps, copy your token to the "token" file, and save with user-readable permissions.

Then start the bot in a tmux or screen session by simply running `./tgbot`. The bot writes it's logfile to "logfile.txt" in the directory it is running in.

Don't:

Run this bot with root permissions, even if "just testing"! Telegram is a cesspool and you will quickly come to grief.

Otherwise, enjoy.

Tags: News, UNIX

Trilema announces closure

March 12, 2020 — shinohai

Mircea Popescu published a blog post earlier this morning announcing the end of "TMSR" activities on Trilema, presumably so he can focus his time on other important activities such as hippo training.

For some strange reason, the burning fires and attrition rates in the past few years reminded me of an excerpt by Mark Twain:

We played robber now and then about a month, and then I resigned. All the boys did. We hadn’t robbed nobody, hadn’t killed any people, but only just pretended. We used to hop out of the woods and go charging down on hog-drivers and women in carts taking garden stuff to market, but we never hived any of them. Tom Sawyer called the hogs “ingots,” and he called the turnips and stuff “julery,” and we would go to the cave and powwow over what we had done, and how many people we had killed and marked. But I couldn’t see no profit in it. -Huckleberry Finn.

The future of other former TMSR endeavours, such as Qntra and Eulora, remain unclear at this time.

Tags: News, Lulz, TMSR

lam-par.sh genesis

March 10, 2020 — shinohai

This is a genesis vpatch for a bash script that takes all the functions of asciilifeform's lamport parachute and combines them into a single script for personal use.

(lam-par.genesis.kv.vpatch)
(lam-par.genesis.kv.vpatch.shinohai.sig)

Press using a keccak vtron of choice. Here I am using esthlos-v:

`v press lam-par.genesis.kv.vpatch lam-par/`

Change to the output directory, make the script executable, and run it:

lam-par # ./lam-par.sh --help
Options:

    --mkpriv     Generate a private key
    --priv2pub   Generate a public key from a private key
-s, --sign       Sign a message using your public key
-v, --verify     Verify a signed message using a public key

See http://www.loper-os.org/?p=1762 for more details

Tags: News, Cryptography, UNIX

Robinhood falls along with other fiat markets

March 09, 2020 — shinohai

On the heels of a previous outage, robinhood customers reported widespread issues again this morning shortly after markets opened. Monday started off poorly for fiat markets, with reports of trading halts of 15 Minutes or more after the S&P 500 tanked 7% rapidly in early morning trading.

Meanwhile at MPEX storm clouds brew with some users hoping to get their coins off the exchange before the 2020 Lardship list is published.

Tags: News, Bitcoin, Cryptocurrency, Fiat, TMSR, Lulz

Spot the SFYL

March 06, 2020 — shinohai

Happy Friday afternoon. this week on the SFYL channel we present the following (compressed) image of some derp from twitter showing off his new "secure" Nano Ledger Bitcoin wallet.

Simon the smacktard forgot, however, to obscure the paper containing his device's seed phrase, conveniently demonstrating that some people just aren't ready to use Bitcoin yet. (archived)

Tags: News, Bitcoin, Insecurity, Lulz