tcpserver

package
v0.0.0-...-b8f9f05 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptData

func DecryptData(binaryTx *[]byte) ([]byte, []byte, []byte, error)

DecryptData is decrypting data

func HandleTCPRequest

func HandleTCPRequest(rw io.ReadWriter)

HandleTCPRequest proceed TCP requests

func ReadRequest

func ReadRequest(request interface{}, r io.Reader) error

ReadRequest is reading request

func SendRequest

func SendRequest(request interface{}, w io.Writer) error

SendRequest in sending request

func TcpListener

func TcpListener(laddr string) error

TcpListener is listening tcp address

func Type1

func Type1(r *DisRequest, rw io.ReadWriter) error

Type1 get the list of transactions which belong to the sender from 'disseminator' daemon do not load the blocks here because here could be the chain of blocks that are loaded for a long time download the transactions here, because they are small and definitely will be downloaded in 60 sec

Types

type ConfirmRequest

type ConfirmRequest struct {
	BlockID uint32
}

ConfirmRequest contains request data

type ConfirmResponse

type ConfirmResponse struct {
	ConfType uint8
	Hash     []byte `size:"32"`
}

ConfirmResponse contains response data

func Type4

func Type4(r *ConfirmRequest) (*ConfirmResponse, error)

Type4 writes the hash of the specified block The request is sent by 'confirmations' daemon

type DisHashResponse

type DisHashResponse struct {
	Data []byte
}

DisHashResponse contains response data

type DisRequest

type DisRequest struct {
	Data []byte
}

DisRequest contains request data

type DisTrResponse

type DisTrResponse struct{}

DisTrResponse contains response data

func Type2

func Type2(r *DisRequest) (*DisTrResponse, error)

Type2 serves requests from disseminator

type GetBodyRequest

type GetBodyRequest struct {
	BlockID uint32
}

GetBodyRequest contains BlockID

type GetBodyResponse

type GetBodyResponse struct {
	Data []byte
}

GetBodyResponse is Data []bytes

func Type7

func Type7(request *GetBodyRequest) (*GetBodyResponse, error)

Type7 writes the body of the specified block blocksCollection and queue_parser_blocks daemons send the request through p.GetBlocks()

type MaxBlockRequest

type MaxBlockRequest struct{}

MaxBlockRequest is max block request

type MaxBlockResponse

type MaxBlockResponse struct {
	BlockID uint32
}

MaxBlockResponse is max block response

func Type10

func Type10() (*MaxBlockResponse, error)

Type10 sends the last block ID blocksCollection daemon sends this request

type TransactionType

type TransactionType struct {
	Type uint16
}

TransactionType is type of transaction

Jump to

Keyboard shortcuts

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