Documentation ¶
Index ¶
- Constants
- type Config
- type Server
- func (s *Server) BackupAccounts(ctx context.Context, req *pb.BackupAccountsRequest) (*pb.BackupAccountsResponse, error)
- func (s *Server) ChangePassword(ctx context.Context, req *pb.ChangePasswordRequest) (*empty.Empty, error)
- func (s *Server) CreateWallet(ctx context.Context, req *pb.CreateWalletRequest) (*pb.CreateWalletResponse, error)
- func (s *Server) DeleteAccounts(ctx context.Context, req *pb.DeleteAccountsRequest) (*pb.DeleteAccountsResponse, error)
- func (s *Server) ExportSlashingProtection(ctx context.Context, _ *empty.Empty) (*pb.ExportSlashingProtectionResponse, error)
- func (s *Server) GenerateMnemonic(_ context.Context, _ *empty.Empty) (*pb.GenerateMnemonicResponse, error)
- func (s *Server) GetBeaconNodeConnection(ctx context.Context, _ *emptypb.Empty) (*pb.NodeConnectionResponse, error)
- func (s *Server) GetBeaconStatus(ctx context.Context, _ *empty.Empty) (*pb.BeaconStatusResponse, error)
- func (s *Server) GetLogsEndpoints(ctx context.Context, _ *emptypb.Empty) (*pb.LogsEndpointResponse, error)
- func (s *Server) GetPeers(ctx context.Context, _ *empty.Empty) (*ethpb.Peers, error)
- func (s *Server) GetValidatorBalances(ctx context.Context, req *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error)
- func (s *Server) GetValidatorParticipation(ctx context.Context, req *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error)
- func (s *Server) GetValidatorPerformance(ctx context.Context, req *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error)
- func (s *Server) GetValidatorQueue(ctx context.Context, _ *empty.Empty) (*ethpb.ValidatorQueue, error)
- func (s *Server) GetValidators(ctx context.Context, req *ethpb.ListValidatorsRequest) (*ethpb.Validators, error)
- func (s *Server) GetVersion(ctx context.Context, _ *emptypb.Empty) (*pb.VersionResponse, error)
- func (s *Server) HasUsedWeb(ctx context.Context, _ *empty.Empty) (*pb.HasUsedWebResponse, error)
- func (s *Server) ImportKeystores(ctx context.Context, req *pb.ImportKeystoresRequest) (*pb.ImportKeystoresResponse, error)
- func (s *Server) ImportSlashingProtection(ctx context.Context, req *pb.ImportSlashingProtectionRequest) (*emptypb.Empty, error)
- func (s *Server) JWTInterceptor() grpc.UnaryServerInterceptor
- func (s *Server) ListAccounts(ctx context.Context, req *pb.ListAccountsRequest) (*pb.ListAccountsResponse, error)
- func (s *Server) Login(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error)
- func (s *Server) Logout(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)
- func (s *Server) RecoverWallet(ctx context.Context, req *pb.RecoverWalletRequest) (*pb.CreateWalletResponse, error)
- func (s *Server) SaveHashedPassword(password string) error
- func (s *Server) Signup(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error)
- func (s *Server) Start()
- func (s *Server) Status() error
- func (s *Server) Stop() error
- func (s *Server) StreamBeaconLogs(req *emptypb.Empty, stream pb.Health_StreamBeaconLogsServer) error
- func (s *Server) StreamValidatorLogs(_ *emptypb.Empty, stream pb.Health_StreamValidatorLogsServer) error
- func (s *Server) VoluntaryExit(ctx context.Context, req *pb.VoluntaryExitRequest) (*pb.VoluntaryExitResponse, error)
- func (s *Server) WalletConfig(ctx context.Context, _ *empty.Empty) (*pb.WalletResponse, error)
Constants ¶
const (
// HashedRPCPassword for the validator RPC access.
HashedRPCPassword = "rpc-password-hash"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ValidatorGatewayHost string ValidatorGatewayPort int ValidatorMonitoringHost string ValidatorMonitoringPort int BeaconClientEndpoint string ClientMaxCallRecvMsgSize int ClientGrpcRetries uint ClientGrpcRetryDelay time.Duration ClientGrpcHeaders []string ClientWithCert string Host string Port string CertFlag string KeyFlag string ValDB db.Database WalletDir string ValidatorService *client.ValidatorService SyncChecker client.SyncChecker GenesisFetcher client.GenesisFetcher WalletInitializedFeed *event.Feed NodeGatewayEndpoint string Wallet *wallet.Wallet Keymanager keymanager.IKeymanager }
Config options for the gRPC server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server defining a gRPC server for the remote signer API.
func (*Server) BackupAccounts ¶ added in v1.2.0
func (s *Server) BackupAccounts( ctx context.Context, req *pb.BackupAccountsRequest, ) (*pb.BackupAccountsResponse, error)
BackupAccounts creates a zip file containing EIP-2335 keystores for the user's specified public keys by encrypting them with the specified password.
func (*Server) ChangePassword ¶
func (s *Server) ChangePassword(ctx context.Context, req *pb.ChangePasswordRequest) (*empty.Empty, error)
ChangePassword allows changing the RPC password via the API as an authenticated method.
func (*Server) CreateWallet ¶
func (s *Server) CreateWallet(ctx context.Context, req *pb.CreateWalletRequest) (*pb.CreateWalletResponse, error)
CreateWallet via an API request, allowing a user to save a new imported wallet via RPC.
func (*Server) DeleteAccounts ¶ added in v1.3.6
func (s *Server) DeleteAccounts( ctx context.Context, req *pb.DeleteAccountsRequest, ) (*pb.DeleteAccountsResponse, error)
DeleteAccounts deletes accounts from a user's wallet is an imported or derived wallet.
func (*Server) ExportSlashingProtection ¶ added in v1.3.7
func (s *Server) ExportSlashingProtection(ctx context.Context, _ *empty.Empty) (*pb.ExportSlashingProtectionResponse, error)
ExportSlashingProtection handles the rpc call returning the json slashing history. The format of the export follows the EIP-3076 standard which makes it easy to migrate machines or Ethereum consensus clients.
Steps:
- Call the function which exports the data from the validator's db into an EIP standard slashing protection format.
- Format and send JSON in the response.
func (*Server) GenerateMnemonic ¶
func (s *Server) GenerateMnemonic(_ context.Context, _ *empty.Empty) (*pb.GenerateMnemonicResponse, error)
GenerateMnemonic creates a new, random bip39 mnemonic phrase.
func (*Server) GetBeaconNodeConnection ¶
func (s *Server) GetBeaconNodeConnection(ctx context.Context, _ *emptypb.Empty) (*pb.NodeConnectionResponse, error)
GetBeaconNodeConnection retrieves the current beacon node connection information, as well as its sync status.
func (*Server) GetBeaconStatus ¶ added in v1.1.0
func (s *Server) GetBeaconStatus(ctx context.Context, _ *empty.Empty) (*pb.BeaconStatusResponse, error)
GetBeaconStatus retrieves information about the beacon node gRPC connection and certain chain metadata, such as the genesis time, the chain head, and the deposit contract address.
func (*Server) GetLogsEndpoints ¶ added in v1.0.1
func (s *Server) GetLogsEndpoints(ctx context.Context, _ *emptypb.Empty) (*pb.LogsEndpointResponse, error)
GetLogsEndpoints for the beacon and validator client.
func (*Server) GetPeers ¶ added in v1.1.0
GetPeers is a wrapper around the /eth/v1alpha1 endpoint of the same name.
func (*Server) GetValidatorBalances ¶ added in v1.1.0
func (s *Server) GetValidatorBalances( ctx context.Context, req *ethpb.ListValidatorBalancesRequest, ) (*ethpb.ValidatorBalances, error)
GetValidatorBalances is a wrapper around the /eth/v1alpha1 endpoint of the same name.
func (*Server) GetValidatorParticipation ¶ added in v1.1.0
func (s *Server) GetValidatorParticipation( ctx context.Context, req *ethpb.GetValidatorParticipationRequest, ) (*ethpb.ValidatorParticipationResponse, error)
GetValidatorParticipation is a wrapper around the /eth/v1alpha1 endpoint of the same name.
func (*Server) GetValidatorPerformance ¶ added in v1.1.0
func (s *Server) GetValidatorPerformance( ctx context.Context, req *ethpb.ValidatorPerformanceRequest, ) (*ethpb.ValidatorPerformanceResponse, error)
GetValidatorPerformance is a wrapper around the /eth/v1alpha1 endpoint of the same name.
func (*Server) GetValidatorQueue ¶ added in v1.1.0
func (s *Server) GetValidatorQueue( ctx context.Context, _ *empty.Empty, ) (*ethpb.ValidatorQueue, error)
GetValidatorQueue is a wrapper around the /eth/v1alpha1 endpoint of the same name.
func (*Server) GetValidators ¶ added in v1.1.0
func (s *Server) GetValidators( ctx context.Context, req *ethpb.ListValidatorsRequest, ) (*ethpb.Validators, error)
GetValidators is a wrapper around the /eth/v1alpha1 endpoint of the same name.
func (*Server) GetVersion ¶ added in v1.1.0
GetVersion --
func (*Server) HasUsedWeb ¶
HasUsedWeb checks if the user has authenticated via the web interface.
func (*Server) ImportKeystores ¶
func (s *Server) ImportKeystores( ctx context.Context, req *pb.ImportKeystoresRequest, ) (*pb.ImportKeystoresResponse, error)
ImportKeystores allows importing new keystores via RPC into the wallet which will be decrypted using the specified password .
func (*Server) ImportSlashingProtection ¶ added in v1.3.7
func (s *Server) ImportSlashingProtection(ctx context.Context, req *pb.ImportSlashingProtectionRequest) (*emptypb.Empty, error)
ImportSlashingProtection reads an input slashing protection EIP-3076 standard JSON string and inserts the data into validator DB.
Read the JSON string passed through rpc, then call the func which actually imports the data from the JSON file into our database.
func (*Server) JWTInterceptor ¶
func (s *Server) JWTInterceptor() grpc.UnaryServerInterceptor
JWTInterceptor is a gRPC unary interceptor to authorize incoming requests for methods that are NOT in the noAuthPaths configuration map.
func (*Server) ListAccounts ¶
func (s *Server) ListAccounts(ctx context.Context, req *pb.ListAccountsRequest) (*pb.ListAccountsResponse, error)
ListAccounts allows retrieval of validating keys and their petnames for a user's wallet via RPC.
func (*Server) Login ¶
func (s *Server) Login(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error)
Login to authenticate with the validator RPC API using a password.
func (*Server) RecoverWallet ¶ added in v1.3.7
func (s *Server) RecoverWallet(ctx context.Context, req *pb.RecoverWalletRequest) (*pb.CreateWalletResponse, error)
RecoverWallet via an API request, allowing a user to recover a derived. Generate the seed from the mnemonic + language + 25th passphrase(optional). Create N validator keystores from the seed specified by req.NumAccounts. Set the wallet password to req.WalletPassword, then create the wallet from the provided Mnemonic and return CreateWalletResponse.
func (*Server) SaveHashedPassword ¶
SaveHashedPassword to disk for the validator RPC.
func (*Server) Signup ¶
func (s *Server) Signup(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error)
Signup to authenticate access to the validator RPC API using bcrypt and a sufficiently strong password check.
func (*Server) StreamBeaconLogs ¶ added in v1.1.0
func (s *Server) StreamBeaconLogs(req *emptypb.Empty, stream pb.Health_StreamBeaconLogsServer) error
StreamBeaconLogs from the beacon node via a gRPC server-side stream.
func (*Server) StreamValidatorLogs ¶ added in v1.1.0
func (s *Server) StreamValidatorLogs(_ *emptypb.Empty, stream pb.Health_StreamValidatorLogsServer) error
StreamValidatorLogs from the validator client via a gRPC server-side stream.
func (*Server) VoluntaryExit ¶ added in v1.3.8
func (s *Server) VoluntaryExit( ctx context.Context, req *pb.VoluntaryExitRequest, ) (*pb.VoluntaryExitResponse, error)
VoluntaryExit performs a voluntary exit for the validator keys specified in a request.
func (*Server) WalletConfig ¶
WalletConfig returns the wallet's configuration. If no wallet exists, we return an empty response.