Skip to content

Instantly share code, notes, and snippets.

@davecgh
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davecgh/9bfbcc18fc6a59366939 to your computer and use it in GitHub Desktop.
Save davecgh/9bfbcc18fc6a59366939 to your computer and use it in GitHub Desktop.
Btcd Code Reorg

What?

All of the Conformal Bitcoin-related code will be moving to a new home at the https://github.com/btcsuite organization.

When?

This will take place sometime during the next several weeks.

Why?

The main motivation is that the entire btcd codebase is maturing to the point it deserves its own organization. We want to make it clear that the code is intended to be a community project and have multiple contributors. Since we've made the decision to make this move, we also plan to take this opportunity to combine several of the core package repositories into the main btcd repository which has several benefits discussed below.

Code Reorganization

The first key point is that the internal architecture is NOT changing during this process. All of the current separation of packages will remain. They are simply being shuffled around between repositories, and in many cases, losing the btc prefix. Each individual package will continue to be designed as composable pieces just as they currently are.

Some benefits of making this change are:

  • Issue tracking across multiple repositories of highly-related code is cumbersome and makes it more difficult for all parties involved to stay on top of them
  • Pull requests that require changes in multiple packages do not work well with multiple repositories and continuous integration builds
  • Having less "external repository" dependencies (those in another repository) means there is far less chance of a user only updating btcd while not updating the core dependency packages. While it's true this is currently pretty trivial to avoid by using go get -u, it's an extra step that could be overlooked and lead to undesirable consequences
  • Reconstructing older versions is difficult with multiple core package repositories
  • Even though it's already extremely quick to download and compile btcd, it will be even faster to download a single repository with multiple sub-packages (for the core dependencies)

One notable con:

  • When a 3rd-party wants to use one of the sub-packages, say the current btcscript package, they have to now download the entire btcd repository instead of only the btcscript repository. However, we don't feel like this is too bad since the resulting binary will only contain the necessary deps and nothing more. It's simply a matter of downloading more data than you would have to with a different repo per package

For example:

$ go get -v github.com/btcsuite/btcd/txscript
github.com/btcsuite/btcd (download)
github.com/btcsuite/btcd/txscript

Plan of Action

Package Moves

The following bullets outline how the packages will be moved:

  • github.com/conformal/btcd -> github.com/btcsuite/btcd
  • All utilities in github.com/conformal/btcd/util/* -> github.com/btcsuite/btcd/cmd/*
  • The following currently independent repositories will be combined into the main btcd repo and renamed as follows:
    • github.com/conformal/btcchain -> github.com/btcsuite/btcd/blockchain
    • github.com/conformal/btcdb -> github.com/btcsuite/btcd/database
    • github.com/conformal/btcec -> github.com/btcsuite/btcd/btcec
    • github.com/conformal/btcjson -> github.com/btcsuite/btcd/btcjson
    • github.com/conformal/btcnet -> github.com/btcsuite/btcd/chaincfg
    • github.com/conformal/btcscript -> github.com/btcsuite/btcd/txscript
    • github.com/conformal/btcwire -> github.com/btcsuite/btcd/wire
    • github.com/conformal/btcws -> github.com/btcsuite/btcd/btcjson/btcws Note A
  • The following repositories will simply be moved as is:
    • github.com/conformal/btclog -> github.com/btcsuite/btclog
    • github.com/conformal/fastsha256 -> github.com/btcsuite/fastsha256
    • github.com/conformal/btcutil -> github.com/btcsuite/btcutil Note B
    • github.com/conformal/btcrpcclient -> github.com/btcsuite/btcrpcclient
    • github.com/conformal/btcsim -> github.com/btcsuite/btcsim
    • github.com/conformal/btcwallet -> github.com/btcsuite/btcwallet
    • github.com/conformal/btcgui -> github.com/btcsuite/btcgui
    • github.com/conformal/bolt -> github.com/btcsuite/bolt
    • github.com/conformal/blocksafari -> github.com/btcsuite/blocksafari
    • github.com/conformal/goleveldb -> github.com/btcsuite/goleveldb
    • github.com/conformal/websocket -> github.com/btcsuite/websocket
    • github.com/conformal/go-flags -> github.com/btcsuite/go-flags
    • github.com/conformal/seelog -> github.com/btcsuite/seelog
    • github.com/conformal/go-socks -> github.com/btcsuite/go-socks
    • github.com/conformal/winsvc -> github.com/btcsuite/winsvc

Issue Moves

All issues will be moved to the new repositories. Since Github doesn't have proper support for moving issues across repos, they will be moved using a mover tool which creates new issues in the target repo that include the initial issue author and creation times.

NOTES

### NOTE A The btcws package will ultimately be removed when the next version of btcjson, which is currently a WIP pull request, has been completed since all of its methods are offered as a part of the new version of btcjson. ### NOTE B The btcutil package is being kept separate for now since its functionality crosses multiple boundaries between server, client, and wallet. It will likely need some of its current functionality split into multiple packages that are then placed into the appropriate repositories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment