rpc

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2020 License: GPL-3.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
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
	Host                    string
	Port                    string
	CertFlag                string
	KeyFlag                 string
	ValDB                   db.Database
	WalletDir               string
	ValidatorService        *client.ValidatorService
	SyncChecker             client.SyncChecker
	GenesisFetcher          client.GenesisFetcher
	BeaconNodeInfoFetcher   client.BeaconNodeInfoFetcher
	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 NewServer

func NewServer(ctx context.Context, cfg *Config) *Server

NewServer instantiates a new gRPC server.

func (*Server) ChangePassword

func (s *Server) ChangePassword(ctx context.Context, req *pb.ChangePasswordRequest) (*ptypes.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 derived, imported, or remote wallet.

func (*Server) GenerateMnemonic

func (s *Server) GenerateMnemonic(_ context.Context, _ *ptypes.Empty) (*pb.GenerateMnemonicResponse, error)

GenerateMnemonic creates a new, random bip39 mnemonic phrase.

func (*Server) GetBeaconNodeConnection

func (s *Server) GetBeaconNodeConnection(ctx context.Context, _ *ptypes.Empty) (*pb.NodeConnectionResponse, error)

GetBeaconNodeConnection retrieves the current beacon node connection information, as well as its sync status.

func (*Server) GetLogsEndpoints added in v1.0.1

func (s *Server) GetLogsEndpoints(ctx context.Context, _ *ptypes.Empty) (*pb.LogsEndpointResponse, error)

GetLogsEndpoints for the beacon and validator client.

func (*Server) HasUsedWeb

func (s *Server) HasUsedWeb(ctx context.Context, _ *ptypes.Empty) (*pb.HasUsedWebResponse, error)

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) 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) Logout

func (s *Server) Logout(ctx context.Context, _ *ptypes.Empty) (*ptypes.Empty, error)

Logout a user by invalidating their JWT key.

func (*Server) SaveHashedPassword

func (s *Server) SaveHashedPassword(password string) error

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) Start

func (s *Server) Start()

Start the gRPC server.

func (*Server) Status

func (s *Server) Status() error

Status returns nil or credentialError.

func (*Server) Stop

func (s *Server) Stop() error

Stop the gRPC server.

func (*Server) WalletConfig

func (s *Server) WalletConfig(ctx context.Context, _ *ptypes.Empty) (*pb.WalletResponse, error)

WalletConfig returns the wallet's configuration. If no wallet exists, we return an empty response.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL