prysm-pulse/proto/validator/accounts/v2/web_api.proto
Raul Jordan 366b98ac83
Add Node Connection Endpoint to Validator Client (#7171)
* add sync status checker
* register healthz
* simplify
2020-09-03 23:25:56 +00:00

173 lines
4.7 KiB
Protocol Buffer

syntax = "proto3";
package ethereum.validator.accounts.v2;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
service Wallet {
rpc CreateWallet(CreateWalletRequest) returns (WalletResponse) {
option (google.api.http) = {
post: "/v2/validator/wallet/create",
body: "*"
};
}
rpc EditConfig(EditWalletConfigRequest) returns (WalletResponse) {
option (google.api.http) = {
post: "/v2/validator/wallet/config/edit",
body: "*"
};
}
rpc WalletConfig(google.protobuf.Empty) returns (WalletResponse) {
option (google.api.http) = {
get: "/v2/validator/wallet"
};
}
rpc GenerateMnemonic(google.protobuf.Empty) returns (GenerateMnemonicResponse) {
option (google.api.http) = {
get: "/v2/validator/mnemonic/generate"
};
}
}
service Accounts {
rpc CreateAccount(google.protobuf.Empty) returns (CreateAccountResponse) {
option (google.api.http) = {
post: "/v2/validator/accounts/create",
body: "*"
};
}
rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) {
option (google.api.http) = {
get: "/v2/validator/accounts"
};
}
}
service Health {
rpc GetBeaconNodeConnection(google.protobuf.Empty) returns (NodeConnectionResponse) {
option (google.api.http) = {
get: "/v2/validator/health/node_connection"
};
}
}
service Auth {
rpc Login(AuthRequest) returns (AuthResponse) {
option (google.api.http) = {
post: "/v2/validator/login",
body: "*"
};
}
rpc Signup(AuthRequest) returns (AuthResponse) {
option (google.api.http) = {
post: "/v2/validator/signup",
body: "*"
};
}
}
message CreateWalletRequest {
// Path on disk where the wallet will be stored.
string wallet_path = 1;
// Type of key manager for the wallet, either direct, derived, or remote.
enum KeymanagerKind {
DERIVED = 0;
DIRECT = 1;
REMOTE = 2;
}
KeymanagerKind keymanager = 2;
// Password for the wallet.
string wallet_password = 3;
// Mnemonic in case the user is creating a derived wallet.
string mnemonic = 4;
// Number of accounts.
uint64 num_accounts = 5;
// JSON-encoded keystore files to import during wallet creation.
repeated string keystores_imported = 6;
// Password to unlock imported keystore files.
string keystores_password = 7;
// Remote address such as host.example.com:4000 for a gRPC remote signer server.
string remote_addr = 8;
// Path to client.crt for secure TLS connections to a remote signer server.
string remote_crt_path = 9;
// Path to client.key for secure TLS connections to a remote signer server.
string remote_key_path = 10;
// Path to ca.crt for secure TLS connections to a remote signer server.
string remote_ca_crt_path = 11;
}
message EditWalletConfigRequest {
string remote_addr = 1;
string remote_crt_path = 2;
string remote_key_path = 3;
string remote_ca_crt_path = 4;
}
message GenerateMnemonicResponse {
string mnemonic = 1;
}
message WalletResponse {
string wallet_path = 1;
// Key manager configs, this is meant to be some what generic.
// It'll later be encoded with json to represent in front end UI.
message KeymanagerConfig {
map<string, string> configs = 1;
}
KeymanagerConfig keymanager_config = 2;
}
message CreateAccountResponse {
Account account = 1;
}
message ListAccountsRequest {
// Whether or not to return the raw RLP deposit tx data.
bool get_deposit_tx_data = 1;
}
message ListAccountsResponse {
repeated Account accounts = 1;
}
message Account {
// The validating public key.
bytes validating_public_key = 1;
// The human readable account name.
string account_name = 2;
// The deposit data transaction RLP bytes.
bytes deposit_tx_data = 3;
// The derivation path (if using HD wallet).
string derivation_path = 4;
}
message AccountRequest {
// A list of validator public keys.
repeated bytes public_keys = 1;
// A list of validator indices.
repeated uint64 indices = 2;
}
message AuthRequest {
string password = 1;
}
message AuthResponse {
string token = 1;
uint64 token_expiration = 2;
}
message NodeConnectionResponse {
// The host address of the beacon node the validator
// client is connected to.
string beacon_node_endpoint = 1;
// Whether the connection is active.
bool connected = 2;
// Whether the beacon node is currently synchronizing to chain head.
bool syncing = 3;
}