aboutsummaryrefslogtreecommitdiffstats
path: root/eth/protocol.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-09-01 22:35:14 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-10-19 15:03:09 +0800
commit92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8 (patch)
tree77a19060ee7b46cd7819894babe24130b952c4ca /eth/protocol.go
parent10ed107ba2001d1aabba3d319ba88c5ce6e8fdc0 (diff)
downloaddexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.tar.gz
dexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.tar.zst
dexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.zip
cmd, eth: support switching client modes of operation
Diffstat (limited to 'eth/protocol.go')
-rw-r--r--eth/protocol.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/eth/protocol.go b/eth/protocol.go
index 49f096a3b..0d2b5128d 100644
--- a/eth/protocol.go
+++ b/eth/protocol.go
@@ -26,6 +26,15 @@ import (
"github.com/ethereum/go-ethereum/rlp"
)
+// Mode represents the mode of operation of the eth client.
+type Mode int
+
+const (
+ ArchiveMode Mode = iota // Maintain the entire blockchain history
+ FullMode // Maintain only a recent view of the blockchain
+ LightMode // Don't maintain any history, rather fetch on demand
+)
+
// Constants to match up protocol versions and messages
const (
eth61 = 61
@@ -34,6 +43,14 @@ const (
eth64 = 64
)
+// minimumProtocolVersion is the minimum version of the protocol eth must run to
+// support the desired mode of operation.
+var minimumProtocolVersion = map[Mode]uint{
+ ArchiveMode: eth61,
+ FullMode: eth63,
+ LightMode: eth64,
+}
+
// Supported versions of the eth protocol (first is primary).
var ProtocolVersions = []uint{eth64, eth63, eth62, eth61}