Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 13-May-2020 | - | ||||
chainhash/ | H | 13-May-2020 | - | 545 | 385 | |
README.md | H A D | 13-May-2020 | 2.2 KiB | 86 | 63 | |
doc.go | H A D | 13-May-2020 | 2.5 KiB | 62 | 1 | |
genesis.go | H A D | 13-May-2020 | 7.4 KiB | 173 | 124 | |
genesis_test.go | H A D | 13-May-2020 | 13.9 KiB | 284 | 233 | |
params.go | H A D | 13-May-2020 | 27.8 KiB | 713 | 394 | |
params_test.go | H A D | 13-May-2020 | 943 | 36 | 19 | |
register_test.go | H A D | 13-May-2020 | 10.3 KiB | 509 | 499 |
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