lib

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxVarintLen16 = 3
	MaxVarintLen32 = 5
	MaxVarintLen64 = 10
)

Variables

View Source
var DNSSeeds = []string{
	"bitclout.coinbase.com",
	"bitclout.gemini.com",
	"bitclout.kraken.com",
	"bitclout.bitstamp.com",
	"bitclout.bitfinex.com",
	"bitclout.binance.com",
	"bitclout.hbg.com",
	"bitclout.okex.com",
	"bitclout.bithumb.com",
	"bitclout.upbit.com",
	"bitclout-seed-0.io",
	"bitclout-seed-1.io",
	"bitclout-seed-2.io",
	"bitclout-seed-3.io",
	"bitclout-seed-4.io",
	"bitclout-seed-5.io",
	"bitclout-seed-6.io",
	"bitclout-seed-7.io",
	"bitclout-seed-8.io",
	"bitclout-seed-9.io",
	"bitclout-seed-10.io",
	"bitclout-seed-11.io",
	"bitclout-seed-12.io",
	"bitclout-seed-13.io",
	"bitclout-seed-14.io",
	"bitclout-seed-15.io",
	"bitclout-seed-16.io",
	"bitclout-seed-17.io",
	"bitclout-seed-18.io",
	"bitclout-seed-19.io",
}
View Source
var MiniPostChan = make(chan MiniPost, 1024)

Functions

func Connect

func Connect(id string, ip net.IP)

func GatherValidIPs

func GatherValidIPs() []net.IP

func HashToBigint

func HashToBigint(hash *BlockHash) *big.Int

func IPsForHost

func IPsForHost(host string) []net.IP

func IntToBuf

func IntToBuf(xx int64) []byte

func PutUvarint

func PutUvarint(buf []byte, x uint64) int

func PutVarint

func PutVarint(buf []byte, x int64) int

func RandInt64

func RandInt64(max int64) int64

func ReadUvarint

func ReadUvarint(r io.Reader) (uint64, []byte)

func ReadVarString

func ReadVarString(rr io.Reader) []byte

func ReadVarint

func ReadVarint(r io.Reader) (int64, []byte)

func TestConnect

func TestConnect(id string, ip net.IP)

func UintToBuf

func UintToBuf(xx uint64) []byte

func Uvarint

func Uvarint(buf []byte) (uint64, int)

func Varint

func Varint(buf []byte) (int64, int)

Types

type BitCloutInput

type BitCloutInput UtxoKey

func NewBitCloutInput

func NewBitCloutInput() *BitCloutInput

type BitCloutOutput

type BitCloutOutput struct {
	PublicKey   []byte
	AmountNanos uint64
}

type BlockHash

type BlockHash [32]byte

func Sha256DoubleHash

func Sha256DoubleHash(input []byte) *BlockHash

func (*BlockHash) String

func (bh *BlockHash) String() string

type InvVect

type InvVect struct {
	Type uint32 // 0 tx
	Hash BlockHash
}

type MiniPeer

type MiniPeer struct {
	// contains filtered or unexported fields
}

func (*MiniPeer) ReadMessage

func (mp *MiniPeer) ReadMessage() interface{}

func (*MiniPeer) SendMempool

func (mp *MiniPeer) SendMempool()

func (*MiniPeer) SendNonce

func (mp *MiniPeer) SendNonce(n uint64)

func (*MiniPeer) SendPayloadWithType

func (mp *MiniPeer) SendPayloadWithType(mType int, payload []byte)

func (*MiniPeer) SendVersion

func (mp *MiniPeer) SendVersion() uint64

type MiniPost

type MiniPost struct {
	Timestamp     int64
	Body          string
	BodyLines     []string
	ImageURLs     []string
	PosterPub58   string
	PostHashHex   string
	PostExtraData map[string][]byte
	ParentStakeID []byte
}

type MsgBitCloutGetTransactions

type MsgBitCloutGetTransactions struct {
	HashList []*BlockHash
}

func (*MsgBitCloutGetTransactions) ToBytes

func (msg *MsgBitCloutGetTransactions) ToBytes() []byte

type MsgBitCloutInv

type MsgBitCloutInv struct {
	InvList        []*InvVect
	IsSyncResponse bool
}

func MsgBitCloutInvFromBytes

func MsgBitCloutInvFromBytes(data []byte) *MsgBitCloutInv

type MsgBitCloutTransactionBundle

type MsgBitCloutTransactionBundle struct {
	Transactions []*MsgBitCloutTxn
}

func MsgBitCloutTransactionBundleFromBytes

func MsgBitCloutTransactionBundleFromBytes(id string, data []byte) *MsgBitCloutTransactionBundle

type MsgBitCloutTxn

type MsgBitCloutTxn struct {
	TxInputs    []*BitCloutInput
	TxOutputs   []*BitCloutOutput
	TxnMeta     string //BitCloutTxnMetadata
	PublicKey   []byte
	ExtraData   map[string][]byte
	Signature   string
	TxnTypeJSON uint64
}

type MsgBitCloutVerack

type MsgBitCloutVerack struct {
	Nonce uint64
}

func MsgBitCloutVerackFromBytes

func MsgBitCloutVerackFromBytes(data []byte) *MsgBitCloutVerack

func (*MsgBitCloutVerack) ToBytes

func (msg *MsgBitCloutVerack) ToBytes() []byte

type MsgBitCloutVersion

type MsgBitCloutVersion struct {
	Version              uint64
	Services             uint64
	TstampSecs           int64
	Nonce                uint64
	UserAgent            string
	StartBlockHeight     uint32
	MinFeeRateNanosPerKB uint64
}

func MsgBitCloutVersionFromBytes

func MsgBitCloutVersionFromBytes(data []byte) *MsgBitCloutVersion

func (*MsgBitCloutVersion) ToBytes

func (msg *MsgBitCloutVersion) ToBytes() []byte

type SubmitPostMetadata

type SubmitPostMetadata struct {
	PostHashToModify         []byte
	ParentStakeID            []byte
	Body                     []byte
	CreatorBasisPoints       uint64
	StakeMultipleBasisPoints uint64
	TimestampNanos           uint64
	IsHidden                 bool
}

func SubmitPostMetadataFromBytes

func SubmitPostMetadataFromBytes(data []byte) *SubmitPostMetadata

type UtxoKey

type UtxoKey struct {
	TxID  BlockHash
	Index uint32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL