Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Oct 29, 2020
1 parent 59892cd commit 2d67bfd
Showing 1 changed file with 139 additions and 23 deletions.
162 changes: 139 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,157 @@
# go-b
> Library for working with [B transactions](https://github.com/unwriter/B) (Bitcoin OP_RETURN protocol) in Go
A library for working with B transactions (Bitcoin OP_RETURN protocol)
[![Release](https://img.shields.io/github/release-pre/BitcoinSchema/go-b.svg?logo=github&style=flat&v=3)](https://github.com/BitcoinSchema/go-b/releases)
[![Build Status](https://travis-ci.com/BitcoinSchema/go-b.svg?branch=master&v=3)](https://travis-ci.com/BitcoinSchema/go-b)
[![Report](https://goreportcard.com/badge/github.com/BitcoinSchema/go-b?style=flat&v=3)](https://goreportcard.com/report/github.com/BitcoinSchema/go-b)
[![codecov](https://codecov.io/gh/BitcoinSchema/go-b/branch/master/graph/badge.svg?v=3)](https://codecov.io/gh/BitcoinSchema/go-b)
[![Go](https://img.shields.io/github/go-mod/go-version/BitcoinSchema/go-b?v=3)](https://golang.org/)
[![Sponsor](https://img.shields.io/badge/sponsor-BitcoinSchema-181717.svg?logo=github&style=flat&v=3)](https://github.com/sponsors/BitcoinSchema)
[![Donate](https://img.shields.io/badge/donate-bitcoin-ff9900.svg?logo=bitcoin&style=flat&v=3)](https://gobitcoinsv.com/#sponsor)

## B from a bob.Tape
<br/>

```go
import "github.com/rohenaz/go-b"
import "github.com/rohenaz/go-bob"
## Table of Contents
- [Installation](#installation)
- [Documentation](#documentation)
- [Examples & Tests](#examples--tests)
- [Benchmarks](#benchmarks)
- [Code Standards](#code-standards)
- [Usage](#usage)
- [Maintainers](#maintainers)
- [Contributing](#contributing)
- [License](#license)

// ... use gog-bob to get a bob.Tape
<br/>

bData := b.New()
bData.FromTape(tape)
## Installation

// Use it
log.Println("B data encoding:", bData.Encoding)
**go-b** requires a [supported release of Go](https://golang.org/doc/devel/release.html#policy).
```shell script
go get -u github.com/bitcoinschema/go-b
```

## BitFs
<br/>

There is a helper to get a BitFs URL. See https://bitfs.network for more info.
## Documentation
View the generated [documentation](https://pkg.go.dev/github.com/bitcoinschema/go-b)

```go
txid := "6ce94f75b88a6c24815d480437f4f06ae895afdab8039ddec10748660c29f910" // donkey kong country gif
[![GoDoc](https://godoc.org/github.com/bitcoinschema/go-b?status.svg&style=flat)](https://pkg.go.dev/github.com/bitcoinschema/go-b)

// pass the txid, output index, and script chunk
url := BitFsURL(txid, 0, 3)
### Features
- FromTape()
- DataURI()
- BitFsURL()

if url != "https://x.bitfs.network/6ce94f75b88a6c24815d480437f4f06ae895afdab8039ddec10748660c29f910.out.0.3" {
t.Error("Failed url", url)
}
<details>
<summary><strong><code>Package Dependencies</code></strong></summary>
<br/>

- [bitcoinschema/go-bob](https://github.com/bitcoinschema/go-bob)
</details>

<details>
<summary><strong><code>Library Deployment</code></strong></summary>
<br/>

[goreleaser](https://github.com/goreleaser/goreleaser) for easy binary or library deployment to Github and can be installed via: `brew install goreleaser`.

The [.goreleaser.yml](.goreleaser.yml) file is used to configure [goreleaser](https://github.com/goreleaser/goreleaser).

Use `make release-snap` to create a snapshot version of the release, and finally `make release` to ship to production.
</details>

<details>
<summary><strong><code>Makefile Commands</code></strong></summary>
<br/>

View all `makefile` commands
```shell script
make help
```

## DataURI
List of all current commands:
```text
all Runs multiple commands
clean Remove previous builds and any test cache data
clean-mods Remove all the Go mod cache
coverage Shows the test coverage
godocs Sync the latest tag with GoDocs
help Show this help message
install Install the application
install-go Install the application (Using Native Go)
lint Run the Go lint application
release Full production release (creates release in Github)
release Runs common.release then runs godocs
release-snap Test the full release (build binaries)
release-test Full production test release (everything except deploy)
replace-version Replaces the version in HTML/JS (pre-deploy)
tag Generate a new tag and push (tag version=0.0.0)
tag-remove Remove a tag if found (tag-remove version=0.0.0)
tag-update Update an existing tag to current commit (tag-update version=0.0.0)
test Runs vet, lint and ALL tests
test-short Runs vet, lint and tests (excludes integration tests)
test-travis Runs all tests via Travis (also exports coverage)
test-travis-short Runs unit tests via Travis (also exports coverage)
uninstall Uninstall the application (and remove files)
vet Run the Go vet application
```
</details>

<br/>

## Examples & Tests
All unit tests and [examples](examples) run via [Travis CI](https://travis-ci.com/bitcoinschema/go-b) and uses [Go version 1.15.x](https://golang.org/doc/go1.15). View the [deployment configuration file](.travis.yml).

Run all tests (including integration tests)
```shell script
make test
```

Run tests (excluding integration tests)
```shell script
make test-short
```

Provides a b64 Data URI from B
<br/>

```go
src := bData.DataURI()
## Benchmarks
Run the Go benchmarks:
```shell script
make bench
```

<br/>

## Code Standards
Read more about this Go project's [code standards](CODE_STANDARDS.md).

<br/>

## Usage
Checkout all the [examples](examples)!

<br/>

## Maintainers
| [<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) |
|:---:|:---:|
| [Satchmo](https://github.com/rohenaz) | [MrZ](https://github.com/mrz1836) |

<br/>

## Contributing

View the [contributing guidelines](CONTRIBUTING.md) and follow the [code of conduct](CODE_OF_CONDUCT.md).

### How can I help?
All kinds of contributions are welcome :raised_hands:!
The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:.
You can also support this project by [becoming a sponsor on GitHub](https://github.com/sponsors/BitcoinSchema) :clap:
or by making a [**bitcoin donation**](https://gobitcoinsv.com/#sponsor) to ensure this journey continues indefinitely! :rocket:

<br/>

## License

![License](https://img.shields.io/github/license/BitcoinSchema/go-b.svg?style=flat&v=3)

0 comments on commit 2d67bfd

Please sign in to comment.