Official Go implementation of the Ethereum protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
go-ethereum/ethwire
obscuren a760ce05b9 Updated chain for filtering 10 years ago
..
.gitignore The great merge 11 years ago
README.md The great merge 11 years ago
client_identity.go ethwire.ClientIdentity now handles Client info sent in handshake + test 11 years ago
client_identity_test.go ethwire.ClientIdentity now handles Client info sent in handshake + test 11 years ago
messaging.go Updated chain for filtering 10 years ago

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{}{...},
})