github.com/prysmaticlabs/prysm@v1.4.4/proto/validator/accounts/v2/web_api.proto (about)

     1  syntax = "proto3";
     2  package ethereum.validator.accounts.v2;
     3  
     4  import "proto/beacon/rpc/v1/health.proto";
     5  import "proto/eth/v1alpha1/beacon_chain.proto";
     6  import "proto/eth/v1alpha1/node.proto";
     7  import "google/api/annotations.proto";
     8  import "google/protobuf/empty.proto";
     9  
    10  service Wallet {
    11      rpc CreateWallet(CreateWalletRequest) returns (CreateWalletResponse) {
    12          option (google.api.http) = {
    13              post: "/v2/validator/wallet/create",
    14              body: "*"
    15          };
    16      }
    17      rpc WalletConfig(google.protobuf.Empty) returns (WalletResponse) {
    18          option (google.api.http) = {
    19              get: "/v2/validator/wallet"
    20          };
    21      }
    22      rpc GenerateMnemonic(google.protobuf.Empty) returns (GenerateMnemonicResponse) {
    23          option (google.api.http) = {
    24              get: "/v2/validator/mnemonic/generate"
    25          };
    26      }
    27      rpc ImportKeystores(ImportKeystoresRequest) returns (ImportKeystoresResponse) {
    28          option (google.api.http) = {
    29              post: "/v2/validator/wallet/keystores/import",
    30              body: "*"
    31          };
    32      }
    33      rpc RecoverWallet(RecoverWalletRequest) returns (CreateWalletResponse) {
    34          option (google.api.http) = {
    35              post: "/v2/validator/wallet/recover"
    36              body: "*"
    37          };
    38      }
    39  }
    40  
    41  service Accounts {
    42      rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) {
    43          option (google.api.http) = {
    44              get: "/v2/validator/accounts"
    45          };
    46      }
    47      rpc BackupAccounts(BackupAccountsRequest) returns (BackupAccountsResponse) {
    48          option (google.api.http) = {
    49              post: "/v2/validator/accounts/backup",
    50              body: "*"
    51          };
    52      }
    53      rpc DeleteAccounts(DeleteAccountsRequest) returns (DeleteAccountsResponse) {
    54          option (google.api.http) = {
    55              post: "/v2/validator/wallet/accounts/delete",
    56              body: "*"
    57          };
    58      }
    59      rpc ChangePassword(ChangePasswordRequest) returns (google.protobuf.Empty) {
    60          option (google.api.http) = {
    61              post: "/v2/validator/password/edit",
    62              body: "*"
    63          };
    64      }
    65      rpc VoluntaryExit(VoluntaryExitRequest) returns (VoluntaryExitResponse) {
    66          option (google.api.http) = {
    67              post: "/v2/validator/accounts/voluntary-exit",
    68              body: "*"
    69          };
    70      }
    71  }
    72  
    73  service Beacon {
    74      rpc GetBeaconStatus(google.protobuf.Empty) returns (BeaconStatusResponse) {
    75          option (google.api.http) = {
    76              get: "/v2/validator/beacon/status"
    77          };
    78      }
    79      rpc GetValidatorParticipation(
    80          ethereum.eth.v1alpha1.GetValidatorParticipationRequest
    81      ) returns (ethereum.eth.v1alpha1.ValidatorParticipationResponse) {
    82          option (google.api.http) = {
    83              get: "/v2/validator/beacon/participation"
    84          };
    85      }
    86      rpc GetValidatorPerformance(
    87          ethereum.eth.v1alpha1.ValidatorPerformanceRequest
    88      ) returns (ethereum.eth.v1alpha1.ValidatorPerformanceResponse) {
    89          option (google.api.http) = {
    90              get: "/v2/validator/beacon/performance"
    91          };
    92      }
    93      rpc GetValidators(
    94          ethereum.eth.v1alpha1.ListValidatorsRequest
    95      ) returns (ethereum.eth.v1alpha1.Validators) {
    96          option (google.api.http) = {
    97              get: "/v2/validator/beacon/validators"
    98          };
    99      }
   100      rpc GetValidatorBalances(
   101          ethereum.eth.v1alpha1.ListValidatorBalancesRequest
   102      ) returns (ethereum.eth.v1alpha1.ValidatorBalances) {
   103          option (google.api.http) = {
   104              get: "/v2/validator/beacon/balances"
   105          };
   106      }
   107      rpc GetValidatorQueue(google.protobuf.Empty) returns (ethereum.eth.v1alpha1.ValidatorQueue) {
   108          option (google.api.http) = {
   109              get: "/v2/validator/beacon/queue"
   110          };
   111      }
   112      rpc GetPeers(google.protobuf.Empty) returns (ethereum.eth.v1alpha1.Peers) {
   113          option (google.api.http) = {
   114              get: "/v2/validator/beacon/peers"
   115          };
   116      }
   117  }
   118  
   119  service SlashingProtection {
   120      rpc ExportSlashingProtection(google.protobuf.Empty) returns (ExportSlashingProtectionResponse) {
   121          option (google.api.http) = {
   122              post: "/v2/validator/slashing-protection/export"
   123              body: "*"
   124          };
   125      }
   126      rpc ImportSlashingProtection(ImportSlashingProtectionRequest) returns (google.protobuf.Empty) {
   127          option (google.api.http) = {
   128              post: "/v2/validator/slashing-protection/import"
   129              body: "*"
   130          };
   131      }
   132  }
   133  
   134  service Health {
   135      rpc GetBeaconNodeConnection(google.protobuf.Empty) returns (NodeConnectionResponse) {
   136          option (google.api.http) = {
   137              get: "/v2/validator/health/node_connection"
   138          };
   139      }
   140      rpc GetLogsEndpoints(google.protobuf.Empty) returns (LogsEndpointResponse) {
   141          option (google.api.http) = {
   142              get: "/v2/validator/health/logs/endpoints"
   143          };
   144      }
   145      rpc GetVersion(google.protobuf.Empty) returns (VersionResponse) {
   146          option (google.api.http) = {
   147              get: "/v2/validator/health/version"
   148          };
   149      }
   150      rpc StreamBeaconLogs(google.protobuf.Empty) returns (stream ethereum.beacon.rpc.v1.LogsResponse) {
   151          option (google.api.http) = {
   152              get: "/v2/validator/health/logs/beacon/stream"
   153          };
   154      }
   155      rpc StreamValidatorLogs(google.protobuf.Empty) returns (stream LogsResponse) {
   156          option (google.api.http) = {
   157              get: "/v2/validator/health/logs/validator/stream"
   158          };
   159      }
   160  }
   161  
   162  service Auth {
   163      rpc HasUsedWeb(google.protobuf.Empty) returns (HasUsedWebResponse) {
   164          option (google.api.http) = {
   165              get: "/v2/validator/initialized",
   166          };
   167      }
   168      rpc Login(AuthRequest) returns (AuthResponse) {
   169          option (google.api.http) = {
   170              post: "/v2/validator/login",
   171              body: "*"
   172          };
   173      }
   174      rpc Signup(AuthRequest) returns (AuthResponse) {
   175          option (google.api.http) = {
   176              post: "/v2/validator/signup",
   177              body: "*"
   178          };
   179      }
   180      rpc Logout(google.protobuf.Empty) returns (google.protobuf.Empty) {
   181          option (google.api.http) = {
   182              post: "/v2/validator/logout",
   183              body: "*"
   184          };
   185      }
   186  }
   187  
   188  // Type of key manager for the wallet, either direct, derived, or remote.
   189  enum KeymanagerKind {
   190      DERIVED = 0;
   191      IMPORTED = 1;
   192      REMOTE = 2;
   193  }
   194  
   195  message CreateWalletRequest {
   196      // Path on disk where the wallet will be stored.
   197      KeymanagerKind keymanager = 1;
   198  
   199      // Password for the wallet.
   200      string wallet_password = 2;
   201      // Mnemonic in case the user is creating a derived wallet.
   202      string mnemonic = 3;
   203      // Number of accounts.
   204      uint64 num_accounts = 4;
   205  
   206      // Remote address such as host.example.com:4000 for a gRPC remote signer server.
   207      string remote_addr = 5;
   208      // Path to client.crt for secure TLS connections to a remote signer server.
   209      string remote_crt_path = 6;
   210      // Path to client.key for secure TLS connections to a remote signer server.
   211      string remote_key_path = 7;
   212      // Path to ca.crt for secure TLS connections to a remote signer server.
   213      string remote_ca_crt_path = 8;
   214  }
   215  
   216  message CreateWalletResponse {
   217      WalletResponse wallet = 1;
   218  }
   219  
   220  message EditWalletConfigRequest {
   221      string remote_addr = 1;
   222      string remote_crt_path = 2;
   223      string remote_key_path = 3;
   224      string remote_ca_crt_path = 4;
   225  }
   226  
   227  message GenerateMnemonicResponse {
   228      string mnemonic = 1;
   229  }
   230  
   231  message WalletResponse {
   232      string wallet_path = 1;
   233      KeymanagerKind keymanager_kind = 2;
   234  }
   235  
   236  message RecoverWalletRequest {
   237      string mnemonic = 1;
   238      uint64 num_accounts = 2;
   239      string wallet_password = 3;
   240      string language = 4;
   241      string mnemonic25th_word = 5;
   242  }
   243  
   244  message ListAccountsRequest {
   245      // Whether or not to return the raw RLP deposit tx data.
   246      bool get_deposit_tx_data = 1;
   247  
   248      // The maximum number of accounts to return in the response.
   249      // This field is optional.
   250      int32 page_size = 2;
   251  
   252      // A pagination token returned from a previous call to `ListAccounts`
   253      // that indicates where this listing should continue from.
   254      // This field is optional.
   255      string page_token = 3;
   256  
   257      // Whether to return all available accounts in a single response.
   258      bool all = 4;
   259  }
   260  
   261  message ListAccountsResponse {
   262      repeated Account accounts = 1;
   263  
   264      // A pagination token returned from a previous call to `ListAccounts`
   265      // that indicates from where listing should continue.
   266      // This field is optional.
   267      string next_page_token = 2;
   268  
   269      // Total count matching the request.
   270      int32 total_size = 3;
   271  }
   272  
   273  message Account {
   274      // The validating public key.
   275      bytes validating_public_key = 1;
   276      // The human readable account name.
   277      string account_name = 2;
   278      // The deposit data transaction RLP bytes.
   279      bytes deposit_tx_data = 3;
   280      // The derivation path (if using HD wallet).
   281      string derivation_path = 4;
   282  }
   283  
   284  message AccountRequest {
   285      // A list of validator public keys.
   286      repeated bytes public_keys = 1;
   287      // A list of validator indices.
   288      repeated uint64 indices = 2;
   289  }
   290  
   291  message AuthRequest {
   292      string password = 1;
   293      string password_confirmation = 2;
   294  }
   295  
   296  message AuthResponse {
   297      string token = 1;
   298  
   299      uint64 token_expiration = 2;
   300  }
   301  
   302  message NodeConnectionResponse {
   303      // The host address of the beacon node the validator
   304      // client is connected to.
   305      string beacon_node_endpoint = 1;
   306      // Whether the connection is active.
   307      bool connected = 2;
   308      // Whether the beacon node is currently synchronizing to chain head.
   309      bool syncing = 3;
   310      // The chain genesis time.
   311      uint64 genesis_time = 4;
   312      // Address of the validator deposit contract in the eth1 chain.
   313      bytes deposit_contract_address = 5;
   314  }
   315  
   316  message LogsEndpointResponse {
   317  	string validator_logs_endpoint = 1;
   318  	string beacon_logs_endpoint = 2;
   319  }
   320  
   321  message VersionResponse {
   322  	string beacon = 1;
   323  	string validator = 2;
   324  }
   325  
   326  message ChangePasswordRequest {
   327      string current_password = 1;
   328      string password = 2;
   329      string password_confirmation = 3;
   330  }
   331  
   332  message HasWalletResponse {
   333      // Whether or not the user has a wallet on disk.
   334      bool wallet_exists = 1;
   335  }
   336  
   337  message ImportKeystoresRequest {
   338      // JSON-encoded keystore files to import during wallet creation.
   339      repeated string keystores_imported = 1;
   340  
   341      // Password to unlock imported keystore files.
   342      string keystores_password = 2;
   343  }
   344  
   345  message ImportKeystoresResponse {
   346      repeated bytes imported_public_keys = 1;
   347  }
   348  
   349  message HasUsedWebResponse {
   350      bool has_signed_up = 1;
   351      bool has_wallet = 2;
   352  }
   353  
   354  message LogsResponse {
   355      repeated string logs = 1;
   356  }
   357  
   358  message BeaconStatusResponse {
   359      // The host address of the beacon node the validator
   360      // client is connected to.
   361      string beacon_node_endpoint = 1;
   362      // Whether the connection is active.
   363      bool connected = 2;
   364      // Whether the beacon node is currently synchronizing to chain head.
   365      bool syncing = 3;
   366      // The chain genesis time.
   367      uint64 genesis_time = 4;
   368      // Address of the validator deposit contract in the eth1 chain.
   369      bytes deposit_contract_address = 5;
   370      // The head of the chain from the beacon node.
   371      ethereum.eth.v1alpha1.ChainHead chain_head = 6;
   372  }
   373  
   374  message VoluntaryExitRequest {
   375      // List of public keys to voluntarily exit.
   376      repeated bytes public_keys = 1;
   377  }
   378  
   379  message VoluntaryExitResponse {
   380      // List of keys that successfully exited.
   381      repeated bytes exited_keys = 1;
   382  }
   383  
   384  message BackupAccountsRequest {
   385      // List of public keys to backup.
   386      repeated bytes public_keys = 1;
   387  
   388      string backup_password = 2;
   389  }
   390  
   391  message BackupAccountsResponse {
   392      // Zip file containing backed up keystores.
   393      bytes zip_file = 1;
   394  }
   395  
   396  message DeleteAccountsRequest {
   397      // List of public keys to delete.
   398      repeated bytes public_keys_to_delete = 1;
   399  }
   400  
   401  message DeleteAccountsResponse {
   402      // List of public keys successfully deleted.
   403      repeated bytes deleted_keys = 1;
   404  }
   405  
   406  message ExportSlashingProtectionResponse {
   407      // JSON representation of the slash protection
   408      string file = 1;
   409  }
   410  
   411  message ImportSlashingProtectionRequest {
   412      // JSON representation of the slash protection
   413      string slashing_protection_json = 1;
   414  }