aboutsummaryrefslogtreecommitdiffstats
path: root/eth/protocol.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-07-02 19:13:46 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-08-21 15:30:57 +0800
commitc51e153b5c5327f971e7b410e49e7babfc3f0b8e (patch)
tree3a2f25a668a887fcb1026ae323480ac5fda3548a /eth/protocol.go
parentd51d0022cee91d6588186455afbe6e54fae2cbf7 (diff)
downloaddexon-c51e153b5c5327f971e7b410e49e7babfc3f0b8e.tar
dexon-c51e153b5c5327f971e7b410e49e7babfc3f0b8e.tar.gz
dexon-c51e153b5c5327f971e7b410e49e7babfc3f0b8e.tar.bz2
dexon-c51e153b5c5327f971e7b410e49e7babfc3f0b8e.tar.lz
dexon-c51e153b5c5327f971e7b410e49e7babfc3f0b8e.tar.xz
dexon-c51e153b5c5327f971e7b410e49e7babfc3f0b8e.tar.zst
dexon-c51e153b5c5327f971e7b410e49e7babfc3f0b8e.zip
eth, metrics, p2p: prepare metrics and net packets to eth/62
Diffstat (limited to 'eth/protocol.go')
-rw-r--r--eth/protocol.go25
1 files changed, 19 insertions, 6 deletions
diff --git a/eth/protocol.go b/eth/protocol.go
index b8c9b50d0..fcc5f21e2 100644
--- a/eth/protocol.go
+++ b/eth/protocol.go
@@ -24,10 +24,10 @@ import (
)
// Supported versions of the eth protocol (first is primary).
-var ProtocolVersions = []uint{61, 60}
+var ProtocolVersions = []uint{62, 61, 60}
// Number of implemented message corresponding to different protocol versions.
-var ProtocolLengths = []uint64{9, 8}
+var ProtocolLengths = []uint64{13, 9, 8}
const (
NetworkId = 1
@@ -36,6 +36,7 @@ const (
// eth protocol message codes
const (
+ // Protocol messages belonging to eth/60
StatusMsg = iota
NewBlockHashesMsg
TxMsg
@@ -44,7 +45,15 @@ const (
GetBlocksMsg
BlocksMsg
NewBlockMsg
+
+ // Protocol messages belonging to eth/61
GetBlockHashesFromNumberMsg
+
+ // Protocol messages belonging to eth/62
+ GetBlockHeadersMsg
+ BlockHeadersMsg
+ GetNodeDataMsg
+ NodeDataMsg
)
type errCode int
@@ -102,15 +111,14 @@ type statusData struct {
GenesisBlock common.Hash
}
-// getBlockHashesData is the network packet for the hash based block retrieval
-// message.
+// getBlockHashesData is the network packet for the hash based hash retrieval.
type getBlockHashesData struct {
Hash common.Hash
Amount uint64
}
-// getBlockHashesFromNumberData is the network packet for the number based block
-// retrieval message.
+// getBlockHashesFromNumberData is the network packet for the number based hash
+// retrieval.
type getBlockHashesFromNumberData struct {
Number uint64
Amount uint64
@@ -121,3 +129,8 @@ type newBlockData struct {
Block *types.Block
TD *big.Int
}
+
+// nodeDataData is the network response packet for a node data retrieval.
+type nodeDataData []struct {
+ Value []byte
+}