gobtc

package module
v0.0.0-...-d660ae2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2011 License: LGPL-3.0 Imports: 8 Imported by: 0

README

gobtc

Introduction

Bitcoin library in Go language (golang).

Features

Current status:

  • just started
  • basic TCP handling
  • basic parsing of version cmd

Using

To build standalone with supplied example file:

make

To run the example:

make run

To reformat the code:

make gofmt

Installing

goinstall github.com/dpc/gobtc

License

LGPL (see LICENSE file)

Documentation

Index

Constants

View Source
const MAGIC_MAIN = 0xD9B4BEF9
View Source
const MAGIC_TESTNET = 0xDAB5BFFA

Variables

This section is empty.

Functions

This section is empty.

Types

type MsgHeader

type MsgHeader struct {
	Magic    uint32
	Command  [12]byte
	Length   uint32
	Checksum uint32
}

type NetAddr

type NetAddr struct {
	Time    uint32
	Service uint64
	IP      [16]byte
	Port    uint16
}

type Peer

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

func NewPeer

func NewPeer(s *Server, conn net.Conn, incoming bool) (peer *Peer)

Create new Peer from connection. Connection must be already opened.

type Server

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

func NewServer

func NewServer(addr string) (*Server, error)

func (*Server) AddPeer

func (s *Server) AddPeer(peer *Peer)

func (*Server) SetLogger

func (s *Server) SetLogger(log *log.Logger)

func (*Server) Start

func (s *Server) Start()

func (*Server) Wait

func (s *Server) Wait()

type VersionCmdHeader

type VersionCmdHeader struct {
	Version       int32
	Services      uint64
	Timestamp     int64
	AddrRecv      NetAddr
	AddrFrom      NetAddr
	Nonce         uint64
	SubversionNum string
	StartHeight   int32
}

Jump to

Keyboard shortcuts

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