diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-31 21:53:42 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-31 21:53:42 +0800 |
commit | 4914a78c8c650d7fc74570f25a682598aaeb6973 (patch) | |
tree | eca4eef360d5202d51d5d8766072848ebcb185e3 /wire/README.md | |
parent | af34749a6b47ff8f9b4cb55d9ea65e1235d63b68 (diff) | |
download | go-tangerine-4914a78c8c650d7fc74570f25a682598aaeb6973.tar go-tangerine-4914a78c8c650d7fc74570f25a682598aaeb6973.tar.gz go-tangerine-4914a78c8c650d7fc74570f25a682598aaeb6973.tar.bz2 go-tangerine-4914a78c8c650d7fc74570f25a682598aaeb6973.tar.lz go-tangerine-4914a78c8c650d7fc74570f25a682598aaeb6973.tar.xz go-tangerine-4914a78c8c650d7fc74570f25a682598aaeb6973.tar.zst go-tangerine-4914a78c8c650d7fc74570f25a682598aaeb6973.zip |
ethwire => wire
Diffstat (limited to 'wire/README.md')
-rw-r--r-- | wire/README.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/wire/README.md b/wire/README.md new file mode 100644 index 000000000..7f63688b3 --- /dev/null +++ b/wire/README.md @@ -0,0 +1,36 @@ +# 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](http://wiki.ethereum.org/index.php/Wire_Protocol). + +# Reading Messages + +```go +// 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 + +```go +// 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{}{...}, +}) +``` |