dcrd/chaincfg
Dave Collins 9536f0c88f
release: Bump module versions and deps.
This bumps the various module versions as follows:

- github.com/decred/dcrd/addrmgr@v1.0.2
- github.com/decred/dcrd/wire@v1.1.0
- github.com/decred/dcrd/chaincfg@v1.1.1
- github.com/decred/dcrd/connmgr@v1.0.1
- github.com/decred/dcrd/dcrutil@v1.1.1
- github.com/decred/dcrd/database@v1.0.1
- github.com/decred/dcrd/hdkeychain@v1.1.0
- github.com/decred/dcrd/txscript@v1.0.1
- github.com/decred/dcrd/blockchain/stake@v1.0.1
- github.com/decred/dcrd/gcs@v1.0.1
- github.com/decred/dcrd/blockchain@v1.0.1
- github.com/decred/dcrd/mining@v1.0.1
- github.com/decred/dcrd/mempool@v1.0.1
- github.com/decred/dcrd/peer@v1.0.1
- github.com/decred/dcrd/rpcclient@v1.0.1

It also updates all of the dependencies for every module accordingly and
adds a few missing overrides for transitive dependencies.
2018-08-09 14:30:22 -05:00
..
chainec multi: Remove unused secp256k1 sig parse parameter. 2018-07-04 12:27:34 -05:00
chainhash chainhash: Update go build module support. 2018-07-20 17:27:06 -05:00
doc.go Merge remaining dcrutil code into a dcrd package. 2017-10-11 22:06:36 -04:00
genesis_test.go multi: Reset testnet and bump to version 3. 2018-08-08 08:09:32 -05:00
genesis.go multi: Remove testnet version 2 defs and refs. 2018-08-08 08:10:22 -05:00
go.mod release: Bump module versions and deps. 2018-08-09 14:30:22 -05:00
go.sum build: Refine build module support. 2018-08-05 20:45:45 -05:00
init_test.go multi: Rename vote choice IsIgnore to IsAbstain. 2017-04-24 16:17:27 -05:00
init.go multi: Remove testnet version 2 defs and refs. 2018-08-08 08:10:22 -05:00
internal_test.go multi: Upstream chainhash abstraction sync 2016-11-16 12:48:40 -06:00
mainnetparams.go chaincfg: Add checkpoints for upcoming release. 2018-08-07 11:46:16 -05:00
params_test.go chainhash: Abstract hash logic to new package. (#729) 2016-08-08 14:04:33 -05:00
params.go multi: Remove testnet version 2 defs and refs. 2018-08-08 08:10:22 -05:00
premine.go multi: Remove testnet version 2 defs and refs. 2018-08-08 08:10:22 -05:00
README.md Merge remaining dcrutil code into a dcrd package. 2017-10-11 22:06:36 -04:00
register_test.go multi: Reset testnet and bump to version 3. 2018-08-08 08:09:32 -05:00
simnetparams.go multi: Introduce default coin type for SLIP0044. 2018-07-04 00:49:17 -05:00
testnetparams.go multi: Remove testnet version 2 defs and refs. 2018-08-08 08:10:22 -05:00

chaincfg

Build Status ISC License GoDoc

Package chaincfg defines chain configuration parameters for the three standard Decred networks and provides the ability for callers to define their own custom Decred networks.

Although this package was primarily written for dcrd, it has intentionally been designed so it can be used as a standalone package for any projects needing to use parameters for the standard Decred networks or for projects needing to define their own network.

Sample Use

package main

import (
	"flag"
	"fmt"
	"log"

	"github.com/decred/dcrd/dcrutil"
	"github.com/decred/dcrd/chaincfg"
)

var testnet = flag.Bool("testnet", false, "operate on the testnet Decred network")

// By default (without -testnet), use mainnet.
var chainParams = &chaincfg.MainNetParams

func main() {
	flag.Parse()

	// Modify active network parameters if operating on testnet.
	if *testnet {
		chainParams = &chaincfg.TestNetParams
	}

	// later...

	// Create and print new payment address, specific to the active network.
	pubKeyHash := make([]byte, 20)
	addr, err := btcutil.NewAddressPubKeyHash(pubKeyHash, chainParams)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(addr)
}

Installation and Updating

$ go get -u github.com/decred/dcrd/chaincfg

License

Package chaincfg is licensed under the copyfree ISC License.