Documentation ¶
Index ¶
- Constants
- Variables
- func GetChainParams(chain string) *chaincfg.Params
- func NewOmotenashiCoinRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)
- type OmotenashiCoinParser
- func (p *OmotenashiCoinParser) GetAddrDescForUnknownInput(tx *bchain.Tx, input int) bchain.AddressDescriptor
- func (p *OmotenashiCoinParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ([]byte, error)
- func (p *OmotenashiCoinParser) ParseBlock(b []byte) (*bchain.Block, error)
- func (p *OmotenashiCoinParser) ParseTx(b []byte) (*bchain.Tx, error)
- func (p *OmotenashiCoinParser) ParseTxFromJson(msg json.RawMessage) (*bchain.Tx, error)
- func (p *OmotenashiCoinParser) TxFromMsgTx(t *wire.MsgTx, parseAddresses bool) bchain.Tx
- func (p *OmotenashiCoinParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error)
- type OmotenashiCoinRPC
Constants ¶
const ( MainnetMagic wire.BitcoinNet = 0xdda5b5d1 TestnetMagic wire.BitcoinNet = 0x54644363 // Zerocoin op codes OP_ZEROCOINMINT = 0xc1 OP_ZEROCOINSPEND = 0xc2 )
magic numbers
Variables ¶
var ( MainNetParams chaincfg.Params TestNetParams chaincfg.Params )
chain parameters
Functions ¶
func GetChainParams ¶
GetChainParams contains network parameters for the main OmotenashiCoin network
func NewOmotenashiCoinRPC ¶
func NewOmotenashiCoinRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)
NewOmotenashiCoinRPC returns new OmotenashiCoinRPC instance.
Types ¶
type OmotenashiCoinParser ¶
type OmotenashiCoinParser struct { *btc.BitcoinParser BitcoinOutputScriptToAddressesFunc btc.OutputScriptToAddressesFunc // contains filtered or unexported fields }
OmotenashiCoinParser handle
func NewOmotenashiCoinParser ¶
func NewOmotenashiCoinParser(params *chaincfg.Params, c *btc.Configuration) *OmotenashiCoinParser
NewOmotenashiCoinParser returns new OmotenashiCoinParser instance
func (*OmotenashiCoinParser) GetAddrDescForUnknownInput ¶
func (p *OmotenashiCoinParser) GetAddrDescForUnknownInput(tx *bchain.Tx, input int) bchain.AddressDescriptor
func (*OmotenashiCoinParser) PackTx ¶
func (p *OmotenashiCoinParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ([]byte, error)
PackTx packs transaction to byte array using protobuf
func (*OmotenashiCoinParser) ParseBlock ¶
func (p *OmotenashiCoinParser) ParseBlock(b []byte) (*bchain.Block, error)
ParseBlock parses raw block to our Block struct
func (*OmotenashiCoinParser) ParseTx ¶
func (p *OmotenashiCoinParser) ParseTx(b []byte) (*bchain.Tx, error)
ParseTx parses byte array containing transaction and returns Tx struct
func (*OmotenashiCoinParser) ParseTxFromJson ¶
func (p *OmotenashiCoinParser) ParseTxFromJson(msg json.RawMessage) (*bchain.Tx, error)
ParseTxFromJson parses JSON message containing transaction and returns Tx struct
func (*OmotenashiCoinParser) TxFromMsgTx ¶
TxFromMsgTx parses tx and adds handling for OP_ZEROCOINSPEND inputs
type OmotenashiCoinRPC ¶
type OmotenashiCoinRPC struct {
*btc.BitcoinRPC
}
OmotenashiCoinRPC is an interface to JSON-RPC bitcoind service.
func (*OmotenashiCoinRPC) Initialize ¶
func (b *OmotenashiCoinRPC) Initialize() error
Initialize initializes OmotenashiCoinRPC instance.