• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..13-May-2020-

chainhash/H13-May-2020-545385

README.mdH A D13-May-20202.2 KiB8663

doc.goH A D13-May-20202.5 KiB621

genesis.goH A D13-May-20207.4 KiB173124

genesis_test.goH A D13-May-202013.9 KiB284233

params.goH A D13-May-202027.8 KiB713394

params_test.goH A D13-May-2020943 3619

register_test.goH A D13-May-202010.3 KiB509499

README.md

1chaincfg
2========
3
4[![Build Status](http://img.shields.io/travis/btcsuite/btcd.svg)](https://travis-ci.org/btcsuite/btcd)
5[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)
6[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/btcsuite/btcd/chaincfg)
7
8Package chaincfg defines chain configuration parameters for the three standard
9Bitcoin networks and provides the ability for callers to define their own custom
10Bitcoin networks.
11
12Although this package was primarily written for btcd, it has intentionally been
13designed so it can be used as a standalone package for any projects needing to
14use parameters for the standard Bitcoin networks or for projects needing to
15define their own network.
16
17## Sample Use
18
19```Go
20package main
21
22import (
23	"flag"
24	"fmt"
25	"log"
26
27	"github.com/btcsuite/btcutil"
28	"github.com/btcsuite/btcd/chaincfg"
29)
30
31var testnet = flag.Bool("testnet", false, "operate on the testnet Bitcoin network")
32
33// By default (without -testnet), use mainnet.
34var chainParams = &chaincfg.MainNetParams
35
36func main() {
37	flag.Parse()
38
39	// Modify active network parameters if operating on testnet.
40	if *testnet {
41		chainParams = &chaincfg.TestNet3Params
42	}
43
44	// later...
45
46	// Create and print new payment address, specific to the active network.
47	pubKeyHash := make([]byte, 20)
48	addr, err := btcutil.NewAddressPubKeyHash(pubKeyHash, chainParams)
49	if err != nil {
50		log.Fatal(err)
51	}
52	fmt.Println(addr)
53}
54```
55
56## Installation and Updating
57
58```bash
59$ go get -u github.com/btcsuite/btcd/chaincfg
60```
61
62## GPG Verification Key
63
64All official release tags are signed by Conformal so users can ensure the code
65has not been tampered with and is coming from the btcsuite developers.  To
66verify the signature perform the following:
67
68- Download the public key from the Conformal website at
69  https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt
70
71- Import the public key into your GPG keyring:
72  ```bash
73  gpg --import GIT-GPG-KEY-conformal.txt
74  ```
75
76- Verify the release tag with the following command where `TAG_NAME` is a
77  placeholder for the specific tag:
78  ```bash
79  git tag -v TAG_NAME
80  ```
81
82## License
83
84Package chaincfg is licensed under the [copyfree](http://copyfree.org) ISC
85License.
86