forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.go
More file actions
67 lines (58 loc) · 1.55 KB
/
Copy pathconstants.go
File metadata and controls
67 lines (58 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright (C) 2019, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package version
import (
"encoding/json"
"time"
_ "embed"
)
const (
Client = "avalanchego"
// RPCChainVMProtocol should be bumped anytime changes are made which
// require the plugin vm to upgrade to latest avalanchego release to be
// compatible.
RPCChainVMProtocol uint = 44
CurrentDatabase = "v1.4.5"
PrevDatabase = "v1.0.0"
)
// These are globals that describe network upgrades and node versions
var (
Current = &Application{
Name: Client,
Major: 1,
Minor: 14,
Patch: 1,
}
MinimumCompatibleVersion = &Application{
Name: Client,
Major: 1,
Minor: 14,
Patch: 0,
}
PrevMinimumCompatibleVersion = &Application{
Name: Client,
Major: 1,
Minor: 13,
Patch: 0,
}
//go:embed compatibility.json
rpcChainVMProtocolCompatibilityBytes []byte
// RPCChainVMProtocolCompatibility maps RPCChainVMProtocol versions to the
// set of avalanchego versions that supported that version. This is not used
// by avalanchego, but is useful for downstream libraries.
RPCChainVMProtocolCompatibility map[uint][]string
)
func init() {
err := json.Unmarshal(rpcChainVMProtocolCompatibilityBytes, &RPCChainVMProtocolCompatibility)
if err != nil {
panic(err)
}
}
func GetCompatibility(upgradeTime time.Time) *Compatibility {
return &Compatibility{
Current: Current,
MinCompatibleAfterUpgrade: MinimumCompatibleVersion,
MinCompatible: PrevMinimumCompatibleVersion,
UpgradeTime: upgradeTime,
}
}