Commit graph

36 commits

Author SHA1 Message Date
Dave Collins 40df138193 Import btcnet repo into chaincfg directory.
This commit contains the entire btcnet repository along with several
changes needed to move all of the files into the chaincfg directory in
order to prepare it for merging.  This does NOT update btcd or any of the
other packages to use the new location as that will be done separately.

- All import paths in the old btcnet test files have been changed to the
  new location
- All references to btcnet as the package name have been changed to
  chaincfg
- The coveralls badge has been removed since it unfortunately doesn't
  support coverage of sub-packages

This is ongoing work toward #214.
2015-02-05 21:53:44 -06:00
Dave Collins 4dd7c939ed Update btcwire path import paths to new location. 2015-02-05 12:58:30 -06:00
Dave Collins 612ff7f813 Update btcchain import paths to new location. 2015-01-30 16:04:26 -06:00
Dave Collins 875d8e383c Update to new location in README.md too. 2015-01-16 23:22:13 -06:00
Dave Collins 5bdb50ece6 Update btcnet import paths to new location. 2015-01-16 17:23:38 -06:00
Dave Collins 578e615994 Update btcwire import paths to new location. 2015-01-16 15:05:40 -06:00
Dave Collins 320f5befd5 Update btcutil import paths to new location. 2015-01-15 10:39:54 -06:00
Dave Collins 68242fbba7 Update badges in README.md to SVG.
Also, while here:

- Add a license badge
- Add link to the copyfree website for the license for consistency
2014-12-22 22:34:07 -06:00
Dave Collins 2f74570188 Update TravisCI to goclean script.
Also, update to use the new container-based builds.
2014-12-22 22:33:26 -06:00
Jonathan Gillham 3eeb51ab54 Changed TxIn.PreviousOutpoint to TxIn.PreviousOutPoint after btcwire API change. 2014-10-01 13:48:07 +01:00
Dave Collins 3bbe8ff0ca Add checkpoint at block height 319400. 2014-09-18 19:04:01 -05:00
John C. Vernaleo 8e96f2cf55 Add go vet back and cleanup travis file. 2014-09-12 15:11:48 -04:00
Dave Collins 41c981348e Use byte literals to make go vet happy.
The go vet command complains about untagged struct initializers when
defining a ShaHash directly.  This seems to be a limitation where go vet
does not exclude the warning for types which are a constant size byte
array like it does for normal constant size byte array definition.

This commit simply modifies the code to use a constant definition cast to
a ShaHash to overcome the limitation of go vet.
2014-09-12 14:04:55 -05:00
John C. Vernaleo 0631a00d91 Hold off on go vet for now. 2014-09-08 09:16:09 -04:00
John C. Vernaleo ecacc006cd Add go vet and golint to TravisCI. 2014-09-08 09:08:19 -04:00
Dave Collins 0932dfeb12 WIP coin type 2014-08-12 10:37:58 -05:00
Dave Collins 0994bcf4b2 Add priv and public key bytes for HD wallet keys.
This commit introduces an HDPrivateKeyID and HDPublicKeyID field to the
params struct which are used by hierarchical deterministic extended keys
as defined by BIP0032.

In addition, a new function named HDPrivateKeyToPublicKeyID has been added
to allow the caller to get the associated public key ID given a private
key ID.

The tests have also been updated to maintain 100% test coverage.

ok @jrick
2014-07-19 03:19:19 -05:00
Dave Collins d7e4789eda goimports -w . 2014-07-02 19:42:29 -05:00
Josh Rickmar 6d79aa5ff1 Test panic for converting invalid sha strings.
ok @davecgh
2014-06-13 09:49:08 -05:00
Josh Rickmar 4bbcede9e0 Add tests for network registration.
While here, fix a bug found through testing.  Register will now return
ErrDuplicateNet if the caller attempts to register any of the standard
network parameters provided by this package.

ok @davecgh
2014-06-13 09:49:02 -05:00
Dave Collins 41dce5796d Update to coveralls.io for test coverage reporting.
Also add a test coverage badge to the README.md.
2014-06-12 18:44:34 -05:00
Dave Collins acda2044a0 Add godoc reference badge to README.md. 2014-06-12 18:40:44 -05:00
Dave Collins 3cbba55822 Add support for TravisCI.
Also add TravisCI build status badge to README.md.
2014-06-12 18:37:35 -05:00
Dave Collins 0f23236f43 Make subsidy halving interval for simnet 210000.
This value matches testnet and mainnet and makes more sense because it
allows way more coins to be generated which is useful during simulation
testing.

NOTE: this will invalidate existing simnet chains, but since they
are only intended to be short lived for the duration of a simulation test,
this is a non-issue.
2014-06-12 18:20:51 -05:00
Dave Collins c71988f668 Add comments for prefixes the encoding IDs map to. 2014-06-12 18:14:46 -05:00
GeertJohan a3091847b3 Fix adding wrong HashAddrID to pubKeyHashAddrIDs 2014-06-13 01:00:59 +02:00
Dave Collins dc967b7cc8 Add params for new simulation testing network.
ok @jrick
2014-05-29 15:22:00 -05:00
Dave Collins 218f8df5ba Add a default net port parameter to each network.
ok @jrick
2014-05-29 12:45:44 -05:00
Dave Collins 01799eeff1 Define genesis blocks internally.
The genesis block for each network is a parameter for the network.  As
such, it makes more sense to define them in this package instead of in the
wire protocol package.

ok @jrick
2014-05-28 09:08:20 -05:00
Josh Rickmar 6b3e878cd9 Add ISC license.
Spotted by @davecgh.
2014-05-28 00:15:11 -05:00
Josh Rickmar 81c37e551f Fix documentation code examples.
The examples uses a btcutil API that was recently updated from passing
btcwire.BitcoinNet to *btcnet.Params.  This change updates the btcutil
call in the examples, as well as modifying the example in the README
to match that in doc.go (where errors were handled slightly
differently).
2014-05-27 20:41:30 -05:00
Josh Rickmar 18794e4cfc Fix errors after deciding on the Register API.
The ParamsForNet function was removed, so likewise this change removes
ErrUnknownNet error that it used to return.

As network registration is now necessary for correct handling of
alternate network encoding magics, and therefore the ErrDuplicateNet
error returned by Register is here to stay, kill the comment about the
error being removed later.
2014-05-27 20:35:35 -05:00
Josh Rickmar 6f76171a82 Additions for btcutil.
ok @davecgh
2014-05-27 17:39:09 -05:00
Dave Collins fb8ab4200f Add more chain-related fields and checkpoints.
This commit adds more chain-related fields to the parameters as a part of
converting btcchain to work with btcnet parameters instead of coding the
network-specific knowledge into the package itself.

It also moves the checkpoints from btcchain since checkpoints are a
network parameter and make more sense here.

ok @jrick
2014-05-27 10:07:19 -05:00
Josh Rickmar 536c1e3c29 Add parameters used by btcd.
This change adds two parameters to the Params struct which are used by
btcd to alter behavior based on the active network, rather than
hardcoding checks for a particular network.

The first, ResetMinDifficulty, specifies whether the target difficulty
can change between the retarget intervals.

The second, RelayNonStdTxs, specifies whether standard transaction
checks should not be performed when accepting mempool transactions.

The zero values (false) for both of these bools are the correct
parameter values for mainnet.

While here, rename the test network version 3 to "testnet3", as both
btcd and btcwallet will include additional handling to rename this to
"testnet" for directory names, and a switch to "testnet3" is planned
in the future.
2014-05-23 00:55:21 -05:00
Josh Rickmar 55ef07ca61 Initial commit. 2014-05-22 13:08:32 -05:00