github.com/dashpay/godash@v0.0.0-20160726055534-e038a21e0e3d/chaincfg/README.md (about)

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