diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-15 06:56:09 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-15 06:56:09 +0800 |
commit | f6d1bfe45bf3709d7bad40bf563b5c09228622e3 (patch) | |
tree | df48311a5a494c66c74dcd51f1056cc699f01507 /ethwire/README.md | |
parent | c2fb9f06ad018d01ce335c82b3542de16045a32d (diff) | |
download | dexon-f6d1bfe45bf3709d7bad40bf563b5c09228622e3.tar dexon-f6d1bfe45bf3709d7bad40bf563b5c09228622e3.tar.gz dexon-f6d1bfe45bf3709d7bad40bf563b5c09228622e3.tar.bz2 dexon-f6d1bfe45bf3709d7bad40bf563b5c09228622e3.tar.lz dexon-f6d1bfe45bf3709d7bad40bf563b5c09228622e3.tar.xz dexon-f6d1bfe45bf3709d7bad40bf563b5c09228622e3.tar.zst dexon-f6d1bfe45bf3709d7bad40bf563b5c09228622e3.zip |
The great merge
Diffstat (limited to 'ethwire/README.md')
-rw-r--r-- | ethwire/README.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ethwire/README.md b/ethwire/README.md new file mode 100644 index 000000000..7f63688b3 --- /dev/null +++ b/ethwire/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{}{...}, +}) +``` |