forked from mrsone40/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidator.go
More file actions
84 lines (69 loc) · 1.85 KB
/
validator.go
File metadata and controls
84 lines (69 loc) · 1.85 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package network
import (
"context"
"net/http"
"github.com/cometbft/cometbft/node"
cmtclient "github.com/cometbft/cometbft/rpc/client"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"
"github.com/cosmos/cosmos-sdk/client"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/server/api"
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// Validator defines an in-process CometBFT validator node. Through this object,
// a client can make RPC and API calls and interact with any client command
// or handler.
type Validator struct {
AppConfig *srvconfig.Config
clientCtx client.Context
ctx *server.Context
dir string
nodeID string
pubKey cryptotypes.PubKey
moniker string
aPIAddress string
rPCAddress string
p2PAddress string
address sdk.AccAddress
valAddress sdk.ValAddress
rPCClient cmtclient.Client
app servertypes.Application
tmNode *node.Node
api *api.Server
grpc *grpc.Server
grpcWeb *http.Server
errGroup *errgroup.Group
cancelFn context.CancelFunc
}
var _ ValidatorI = &Validator{}
func (v *Validator) GetCtx() *server.Context {
return v.ctx
}
func (v *Validator) GetClientCtx() client.Context {
return v.clientCtx
}
func (v *Validator) GetAppConfig() *srvconfig.Config {
return v.AppConfig
}
func (v *Validator) GetAddress() sdk.AccAddress {
return v.address
}
func (v *Validator) GetValAddress() sdk.ValAddress {
return v.valAddress
}
func (v *Validator) GetAPIAddress() string {
return v.aPIAddress
}
func (v *Validator) GetRPCAddress() string {
return v.rPCAddress
}
func (v *Validator) GetPubKey() cryptotypes.PubKey {
return v.pubKey
}
func (v *Validator) GetMoniker() string {
return v.moniker
}