BARKS IN THE WIND

v.py updated for vtools

Posted on 2018-09-30 23:09 technical, vtools

As has been discussed in the logs, vtools doesn't stand on its own as a V implementation. Instead it's a collection of tools for working with vpatches. V authors can use vtools so as to not rely on often brittle GNU utilities.

On my own workbench I've been using a patched up version of original asciilifeform's v.py, where I replaced a call to GNU patch with one to vpatch. The replacement is essentially a drop in1, with the advantage of being much stricter about the vpatches that are accepted and also making sure that the press hashes are valid.

I have barely touched v.py otherwise2, so I consider this a proof of concept release. It consists of two patches, the original v.py version 99 genesis3 and my own modifications.

Unless you have a working keccak v, you'll need to bootstrap manually. Assuming you have a working vtools build,

PATH=path to vtools:$PATH
mkdir {wot,seals,patches}
curl --silent http://wot.deedbot.org/BDDE12104FE81BE7F83B698F5356DE4752432A9E.asc -o wot/phf.asc
gpg --import wot/phf.asc
curl --silent -o patches/v99.vpatch  http://btcbase.org/data/vpy/v99.vpatch
curl --silent -o patches/v98.vpatch  http://btcbase.org/data/vpy/v98.vpatch
curl --silent -o seals/v99.vpatch.phf.sig  http://btcbase.org/data/vpy/v99.vpatch.phf.sig
curl --silent -o seals/v98.vpatch.phf.sig  http://btcbase.org/data/vpy/v98.vpatch.phf.sig
gpg --verify seals/v99.vpatch.phf.sig patches/v99.vpatch
gpg --verify seals/v98.vpatch.phf.sig patches/v98.vpatch
cat patches/v99.vpatch patches/v98.vpatch | vpatch
pip install python-gnupg
chmod +x v/v.py
./v/v.py --wot ./wot -fingers --seals ./seals ./patches p ./patches/v98.vpatch v_press

You now have a self-pressed v.py in the v_press directory!

Some things to note: the bulk of bootstrapping effort is verifying the patch signatures, something that v does for you. On the other hand you can just cat any number of patches into vpatch utility and it will produce a verified press. Asciilifeform's v.py uses stock python, but it does depend on python-gnupg package, which can be installed through pip or whatever global packaging system (on gentoo it's emerge python-gnupg).

  1. right now vpatch doesn't support target directory, and presses into the current directory, so I had to do some changes to accommodate v.py's concept of destination. i also hardened the call out to an external process, though perhaps unnecessarily. []
  2. I have also added support for subkeys. []
  3. the first release of v.py is actually version 100, but the diff between 100 and 99 is in my opinion entirely cosmetic, so I avoided pedantically reconstructing the entire chain, and started with a canonical version of v.py. []