mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 22:44:24 +00:00
e2e: integrate light clients (#6196)
This commit is contained in:
+11
-2
@@ -33,6 +33,7 @@ type Perturbation string
|
||||
const (
|
||||
ModeValidator Mode = "validator"
|
||||
ModeFull Mode = "full"
|
||||
ModeLight Mode = "light"
|
||||
ModeSeed Mode = "seed"
|
||||
|
||||
ProtocolBuiltin Protocol = "builtin"
|
||||
@@ -151,7 +152,7 @@ func LoadTestnet(file string) (*Testnet, error) {
|
||||
ProxyPort: proxyPortGen.Next(),
|
||||
Mode: ModeValidator,
|
||||
Database: "goleveldb",
|
||||
ABCIProtocol: ProtocolUNIX,
|
||||
ABCIProtocol: ProtocolBuiltin,
|
||||
PrivvalProtocol: ProtocolFile,
|
||||
StartAt: nodeManifest.StartAt,
|
||||
FastSync: nodeManifest.FastSync,
|
||||
@@ -327,6 +328,9 @@ func (n Node) Validate(testnet Testnet) error {
|
||||
default:
|
||||
return fmt.Errorf("invalid ABCI protocol setting %q", n.ABCIProtocol)
|
||||
}
|
||||
if n.Mode == ModeLight && n.ABCIProtocol != ProtocolBuiltin {
|
||||
return errors.New("light client must use builtin protocol")
|
||||
}
|
||||
switch n.PrivvalProtocol {
|
||||
case ProtocolFile, ProtocolTCP, ProtocolGRPC, ProtocolUNIX:
|
||||
default:
|
||||
@@ -402,7 +406,7 @@ func (t Testnet) LookupNode(name string) *Node {
|
||||
func (t Testnet) ArchiveNodes() []*Node {
|
||||
nodes := []*Node{}
|
||||
for _, node := range t.Nodes {
|
||||
if node.Mode != ModeSeed && node.StartAt == 0 && node.RetainBlocks == 0 {
|
||||
if !node.Stateless() && node.StartAt == 0 && node.RetainBlocks == 0 {
|
||||
nodes = append(nodes, node)
|
||||
}
|
||||
}
|
||||
@@ -476,6 +480,11 @@ func (n Node) Client() (*rpchttp.HTTP, error) {
|
||||
return rpchttp.New(fmt.Sprintf("http://127.0.0.1:%v", n.ProxyPort))
|
||||
}
|
||||
|
||||
// Stateless returns true if the node is either a seed node or a light node
|
||||
func (n Node) Stateless() bool {
|
||||
return n.Mode == ModeLight || n.Mode == ModeSeed
|
||||
}
|
||||
|
||||
// keyGenerator generates pseudorandom Ed25519 keys based on a seed.
|
||||
type keyGenerator struct {
|
||||
random *rand.Rand
|
||||
|
||||
Reference in New Issue
Block a user