A transaction parser for boost (Bitcoin protocol)
go-boost requires a supported release of Go.
go get -u github.com/bitcoinschema/go-boost
View the generated documentation
It takes a BOB formatted transaction and produces an easy-to-use BOOST struct with all protocol fields populated.
type Boost struct {
Redeem Redeem `json:"redeem" bson:"redeem"`
Spend Spend `json:"spend" bson:"spend"`
}
- V1 Bounty Spend
- V1 Bounty Redeem
- V2 Contract Spend
- V2 Contract Redeem
Get the package
go get github.com/bitcoinschema/go-boost
Import the package
import (
github.com/bitcoinschema/go-boost
)
Use to transform BOB formatted transactions.
var b *boost.Boost
b, err = boostNewFromTape(&bobData.In[0].Tape[0])
V1 Contract Spend Example
// Get BOB data from string
bobData, err := bob.NewFromRawTxString(boostTx)
if err != nil {
t.Fatalf("error occurred: %s", err.Error())
}
var b *Boost
b, err = boost.NewFromTape(&bobData.Out[0].Tape[0])thing": "else"
}
boost.BoostSpend Result:
{
"Content": "7332808b5283f8acedcc6240a42f669cc3d305413201527852061fd5b283d0d8",
"MinerAddress": "16nhPWCkbkR1bNACwPYULBWyvxQ5MCDZBo",
"Category": 1111,
"Difficulty": 0.01,
"Topic": "theory",
"AdditionalData": "this is the Boost whitepaper",
"Nonce": 137,
"Version": 1
}
More examples can be found in tests.
View the contributing guidelines and follow the code of conduct.
All kinds of contributions are welcome π! The most basic way to show your support is to star π the project, or to raise issues π¬. You can also support this project by becoming a sponsor on GitHub π or by making a bitcoin donation to ensure this journey continues indefinitely! π