bitcoinops / taproot-workshop

Taproot & Schnorr Python Library & Documentation.
MIT License
369 stars 111 forks source link

Add Google Colab support #157

Closed 0xB10C closed 4 years ago

0xB10C commented 4 years ago

This is a pull request to the Colab branch, not the master branch.

This PR adds support for Google Colab - a free Jupyter Notebook runner in the Google cloud - to the Taproot workshop notebooks. This provides users with a completely ready-to-code environment for the workshop in less than 30 seconds and thus greatly reduces the friction of the setup process. Code written by a user is automatically saved to the users Google account.

This functionality is split up into two commits.

  1. commit: Adds a shell script that sets up the Google Colab environment by e.g. cloning the Optech Bitcoin Core fork and the Taproot workshop repositories, downloading a statically-linked, Colab-compatible and taproot-enabled bitcoind binary (only use this binary on Colab!) and writing some config files.
  2. commit: Adds two cells to the top of each existing notebook. The first with a markdown description for the second code cell. The code cell downloads the shell script from the first commit and executes it to set up the environment.

Reviewing this by trying out the notebooks as-is is not possible. The notebooks try to load the shell script added in the first commit. Reviewing modifying the shell script URL to point to my feature-branch (https://raw.githubusercontent.com/0xB10C/taproot-workshop/2019-11-add-colab-setup/setup-colab-env.sh). A sophisticated reviewer could try to complete other notebooks than the 0.1-test-notebook.ipynb, which has been tested in multiple PoCs before. For example 2.0-taproot-introduction.ipynb.

Example notebooks on my feature branch:

closes #145

now I myself don't have an excuse to not do the workshop anymore..

0xB10C commented 4 years ago

@jnewbery noted that we don't need to clone the Optech fork of Bitcoin Core anymore. Removed that from the setup script in a force push.

jnewbery commented 4 years ago

ACK https://github.com/bitcoinops/taproot-workshop/pull/157/commits/8e293fdef3fa996b7531b528f7d83d2536ea9c7b

I haven't been able to test, but have reviewed the code. Happy to merge this to the Colab branch without testing.

justinmoon commented 4 years ago

Just tried it briefly and it worked well