|
1 |
| -# Go-Bitcoin |
| 1 | +# go-bitcoin |
| 2 | +> A small collection of utility functions for working with Bitcoin (BSV) |
2 | 3 |
|
3 |
| -A small collection of utility functions for working with Bitcoin (BSV) transactions. |
| 4 | +[](https://github.com/BitcoinSchema/go-bitcoin/releases) |
| 5 | +[](https://travis-ci.com/BitcoinSchema/go-bitcoin) |
| 6 | +[](https://goreportcard.com/report/github.com/BitcoinSchema/go-bitcoin) |
| 7 | +[](https://codecov.io/gh/BitcoinSchema/go-bitcoin) |
| 8 | +[](https://golang.org/) |
4 | 9 |
|
5 |
| -## Features |
| 10 | +<br/> |
6 | 11 |
|
7 |
| -- Sign / Verify Bitcoin Message |
8 |
| -- Private key (string) to Address (string) |
9 |
| -- Private key (string) to Private key (bsvec.PrivateKey) |
| 12 | +## Table of Contents |
| 13 | +- [Installation](#installation) |
| 14 | +- [Documentation](#documentation) |
| 15 | +- [Examples & Tests](#examples--tests) |
| 16 | +- [Benchmarks](#benchmarks) |
| 17 | +- [Code Standards](#code-standards) |
| 18 | +- [Usage](#usage) |
| 19 | +- [Maintainers](#maintainers) |
| 20 | +- [Contributing](#contributing) |
| 21 | +- [License](#license) |
10 | 22 |
|
11 |
| -## Dependencies |
| 23 | +<br/> |
12 | 24 |
|
13 |
| -- github.com/bitcoinsv/bsvd/ |
14 |
| -- github.com/bitcoinsv/bsvutil/ |
15 |
| -- github.com/itchyny/base58-go |
16 |
| -- github.com/piotrnar/gocoin/lib/secp256k1 |
| 25 | +## Installation |
17 | 26 |
|
18 |
| -## Notes |
| 27 | +**go-bitcoin** requires a [supported release of Go](https://golang.org/doc/devel/release.html#policy). |
| 28 | +```shell script |
| 29 | +go get -u github.com/bitcoinschema/go-bitcoin |
| 30 | +``` |
19 | 31 |
|
20 |
| -Adding more to this library as needed. PRs and suggestions welcome. |
| 32 | +<br/> |
| 33 | + |
| 34 | +## Documentation |
| 35 | +View the generated [documentation](https://pkg.go.dev/github.com/bitcoinschema/go-bitcoin) |
| 36 | + |
| 37 | +[](https://pkg.go.dev/github.com/bitcoinschema/go-bitcoin) |
| 38 | + |
| 39 | +### Features |
| 40 | +- [Sign](sign.go) / [Verify](verify.go) Bitcoin Message |
| 41 | +- [Private key (string) to Address (string)](address.go) |
| 42 | +- [Address from Private key (bsvec.PrivateKey)](address.go) |
| 43 | +- [Create Private Key](private_key.go) |
| 44 | + |
| 45 | + |
| 46 | +<details> |
| 47 | +<summary><strong><code>Package Dependencies</code></strong></summary> |
| 48 | +<br/> |
| 49 | + |
| 50 | +- [bitcoinsv/bsvd](https://github.com/bitcoinsv/bsvd) |
| 51 | +- [bitcoinsv/bsvutil](https://github.com/bitcoinsv/bsvutil) |
| 52 | +- [itchyny/base58-go](https://github.com/itchyny/base58-go) |
| 53 | +- [piotrnar/gocoin](https://github.com/piotrnar/gocoin) |
| 54 | +</details> |
| 55 | + |
| 56 | +<details> |
| 57 | +<summary><strong><code>Library Deployment</code></strong></summary> |
| 58 | +<br/> |
| 59 | + |
| 60 | +[goreleaser](https://github.com/goreleaser/goreleaser) for easy binary or library deployment to Github and can be installed via: `brew install goreleaser`. |
| 61 | + |
| 62 | +The [.goreleaser.yml](.goreleaser.yml) file is used to configure [goreleaser](https://github.com/goreleaser/goreleaser). |
| 63 | + |
| 64 | +Use `make release-snap` to create a snapshot version of the release, and finally `make release` to ship to production. |
| 65 | +</details> |
| 66 | + |
| 67 | +<details> |
| 68 | +<summary><strong><code>Makefile Commands</code></strong></summary> |
| 69 | +<br/> |
| 70 | + |
| 71 | +View all `makefile` commands |
| 72 | +```shell script |
| 73 | +make help |
| 74 | +``` |
| 75 | + |
| 76 | +List of all current commands: |
| 77 | +```text |
| 78 | +all Runs multiple commands |
| 79 | +clean Remove previous builds and any test cache data |
| 80 | +clean-mods Remove all the Go mod cache |
| 81 | +coverage Shows the test coverage |
| 82 | +godocs Sync the latest tag with GoDocs |
| 83 | +help Show this help message |
| 84 | +install Install the application |
| 85 | +install-go Install the application (Using Native Go) |
| 86 | +lint Run the Go lint application |
| 87 | +release Full production release (creates release in Github) |
| 88 | +release Runs common.release then runs godocs |
| 89 | +release-snap Test the full release (build binaries) |
| 90 | +release-test Full production test release (everything except deploy) |
| 91 | +replace-version Replaces the version in HTML/JS (pre-deploy) |
| 92 | +tag Generate a new tag and push (tag version=0.0.0) |
| 93 | +tag-remove Remove a tag if found (tag-remove version=0.0.0) |
| 94 | +tag-update Update an existing tag to current commit (tag-update version=0.0.0) |
| 95 | +test Runs vet, lint and ALL tests |
| 96 | +test-short Runs vet, lint and tests (excludes integration tests) |
| 97 | +test-travis Runs all tests via Travis (also exports coverage) |
| 98 | +test-travis-short Runs unit tests via Travis (also exports coverage) |
| 99 | +uninstall Uninstall the application (and remove files) |
| 100 | +vet Run the Go vet application |
| 101 | +``` |
| 102 | +</details> |
| 103 | + |
| 104 | +<br/> |
| 105 | + |
| 106 | +## Examples & Tests |
| 107 | +All unit tests and [examples](examples) run via [Travis CI](https://travis-ci.com/bitcoinschema/go-bitcoin) and uses [Go version 1.15.x](https://golang.org/doc/go1.15). View the [deployment configuration file](.travis.yml). |
| 108 | + |
| 109 | +Run all tests (including integration tests) |
| 110 | +```shell script |
| 111 | +make test |
| 112 | +``` |
| 113 | + |
| 114 | +Run tests (excluding integration tests) |
| 115 | +```shell script |
| 116 | +make test-short |
| 117 | +``` |
| 118 | + |
| 119 | +<br/> |
| 120 | + |
| 121 | +## Benchmarks |
| 122 | +Run the Go benchmarks: |
| 123 | +```shell script |
| 124 | +make bench |
| 125 | +``` |
| 126 | + |
| 127 | +<br/> |
| 128 | + |
| 129 | +## Code Standards |
| 130 | +Read more about this Go project's [code standards](CODE_STANDARDS.md). |
| 131 | + |
| 132 | +<br/> |
| 133 | + |
| 134 | +## Usage |
| 135 | +Checkout all the [examples](examples)! |
| 136 | + |
| 137 | +<br/> |
| 138 | + |
| 139 | +## Maintainers |
| 140 | +| [<img src="https://github.com/rohenaz.png" height="50" alt="MrZ" />](https://github.com/rohenaz) | [<img src="https://github.com/mrz1836.png" height="50" alt="MrZ" />](https://github.com/mrz1836) | |
| 141 | +|:---:|:---:| |
| 142 | +| [Satchmo](https://github.com/rohenaz) | [MrZ](https://github.com/mrz1836) | |
| 143 | + |
| 144 | +<br/> |
| 145 | + |
| 146 | +## Contributing |
| 147 | + |
| 148 | +View the [contributing guidelines](CONTRIBUTING.md) and follow the [code of conduct](CODE_OF_CONDUCT.md). |
| 149 | + |
| 150 | +### How can I help? |
| 151 | +All kinds of contributions are welcome :raised_hands:! |
| 152 | +The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:. |
| 153 | +You can also support this project by [becoming a sponsor on GitHub](https://github.com/sponsors/BitcoinSchema) :clap: |
| 154 | +or by making a [**bitcoin donation**](https://gobitcoinsv.com/?af=go-bitcoin) to ensure this journey continues indefinitely! :rocket: |
| 155 | + |
| 156 | +<br/> |
| 157 | + |
| 158 | +## License |
| 159 | + |
| 160 | + |
0 commit comments