op-geth/ethwire
obscuren eaa2e8900d PoC 6 networking code.
* Added block pool for gathering blocks from the network (chunks)
* Re wrote syncing
2014-08-21 14:47:58 +02:00
..
.gitignore The great merge 2014-02-14 23:56:09 +01:00
README.md The great merge 2014-02-14 23:56:09 +01:00
client_identity.go ethwire.ClientIdentity now handles Client info sent in handshake + test 2014-07-03 17:28:27 +01:00
client_identity_test.go ethwire.ClientIdentity now handles Client info sent in handshake + test 2014-07-03 17:28:27 +01:00
messaging.go PoC 6 networking code. 2014-08-21 14:47:58 +02:00

README.md

ethwire

The ethwire package contains the ethereum wire protocol. The ethwire package is required to write and read from the ethereum network.

Installation

go get github.com/ethereum/ethwire-go

Messaging overview

The Ethereum Wire protocol defines the communication between the nodes running Ethereum. Further reader reading can be done on the Wiki.

Reading Messages

// Read and validate the next eth message from the provided connection.
// returns a error message with the details.
msg, err := ethwire.ReadMessage(conn)
if err != nil {
  // Handle error
}

Writing Messages

// Constructs a message which can be interpreted by the eth network.
// Write the inventory to network
err := ethwire.WriteMessage(conn, &Msg{
  Type: ethwire.MsgInvTy,
  Data : []interface{}{...},
})