-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb21c4b
commit 753826f
Showing
17 changed files
with
2,227 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Perform the code generation for the protobuf files. | ||
fn main() -> std::io::Result<()> { | ||
let mut proto_build = prost_build::Config::new(); | ||
|
||
proto_build.out_dir("src/pb"); | ||
proto_build.compile_protos(&["proto/eth2-signer-api/lister.proto"], &["proto/eth2-signer-api"]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Protobuf definitions | ||
|
||
## Eth2 signer API | ||
|
||
The definitions in this folder are taken from the [eth2-signer-api][eth2-signer-api] package. | ||
|
||
[eth2-signer-api]: https://github.com/wealdtech/eth2-signer-api/tree/4aaf36e54f4e62d0cf4edc1b794e9a6354cf4f95/pb/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
syntax = "proto3"; | ||
|
||
package v1; | ||
|
||
import "google/api/annotations.proto"; | ||
import "responsestate.proto"; | ||
import "endpoint.proto"; | ||
|
||
option csharp_namespace = "Eth2Signer.v1"; | ||
option php_namespace = "Eth2Signer\\v1"; | ||
option go_package = "github.com/wealdtech/eth2-signer-api/pb/v1"; | ||
option java_package = "com.wealdtech.eth2signerapi.v1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "AccountManagerProto"; | ||
|
||
service AccountManager { | ||
rpc Unlock(UnlockAccountRequest) returns (UnlockAccountResponse) { | ||
option (google.api.http) = { | ||
get: "/v1/accountmanager/unlock" | ||
}; | ||
} | ||
|
||
rpc Lock(LockAccountRequest) returns (LockAccountResponse) { | ||
option (google.api.http) = { | ||
get: "/v1/accountmanager/lock" | ||
}; | ||
} | ||
|
||
rpc Generate(GenerateRequest) returns (GenerateResponse) { | ||
option (google.api.http) = { | ||
post: "/v1/accountmanager/generate" | ||
}; | ||
} | ||
} | ||
|
||
message UnlockAccountRequest { | ||
string account = 1; | ||
bytes passphrase = 2; | ||
} | ||
|
||
message LockAccountRequest { | ||
string account = 1; | ||
} | ||
|
||
message UnlockAccountResponse { | ||
ResponseState state = 1; | ||
} | ||
|
||
message LockAccountResponse { | ||
ResponseState state = 1; | ||
} | ||
|
||
message GenerateRequest { | ||
string account = 1; | ||
bytes passphrase = 2; | ||
uint32 participants = 3; | ||
uint32 signing_threshold = 4; | ||
} | ||
|
||
message GenerateResponse { | ||
ResponseState state = 1; | ||
string message = 2; | ||
bytes public_key = 3; | ||
repeated Endpoint participants = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
syntax = "proto3"; | ||
|
||
package v1; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "endpoint.proto"; | ||
|
||
option csharp_namespace = "Eth2Signer.v1"; | ||
option php_namespace = "Eth2Signer\\v1"; | ||
option go_package = "github.com/wealdtech/eth2-signer-api/pb/v1"; | ||
option java_package = "com.wealdtech.eth2signerapi.v1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "DKGProto"; | ||
|
||
// DKG is the internal protocol that runs between distributed key generators. | ||
service DKG { | ||
rpc Prepare(PrepareRequest) returns (google.protobuf.Empty) { } | ||
rpc Execute(ExecuteRequest) returns (google.protobuf.Empty) { } | ||
rpc Commit(CommitRequest) returns (CommitResponse) { } | ||
rpc Abort(AbortRequest) returns (google.protobuf.Empty) { } | ||
rpc Contribute(ContributeRequest) returns (ContributeResponse) { } | ||
} | ||
|
||
message PrepareRequest { | ||
// account is the name of the account. | ||
string account = 1; | ||
// threshold is the number of participants required to generate a valid signature. | ||
uint32 threshold = 2; | ||
// participants contains the endpoints of all participants. | ||
repeated Endpoint participants = 3; | ||
// passphrase is the passphrase of the account. | ||
bytes passphrase = 4; | ||
} | ||
|
||
message ExecuteRequest { | ||
// account is the name of the account. | ||
string account = 1; | ||
} | ||
|
||
message CommitRequest { | ||
// account is the name of the account. | ||
string account = 1; | ||
// confirmation data is data used to generate the confirmation signature. | ||
bytes confirmation_data = 2; | ||
} | ||
|
||
message CommitResponse { | ||
// public_key is the key generated by the process. | ||
bytes public_key = 1; | ||
// confirmation_signature is the signature generated by the individual secret key. | ||
bytes confirmation_signature = 2; | ||
} | ||
|
||
message AbortRequest { | ||
// account is the name of the account. | ||
string account = 1; | ||
} | ||
|
||
// ContributeRequest is sent by each part to all other parties with a contribution. | ||
message ContributeRequest { | ||
string account = 1; | ||
bytes secret = 2; | ||
repeated bytes verification_vector = 3; | ||
} | ||
|
||
// ContributeResponse receives the contribution from a participant. | ||
message ContributeResponse { | ||
bytes secret = 1; | ||
repeated bytes verification_vector = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
|
||
package v1; | ||
|
||
option csharp_namespace = "Eth2Signer.v1"; | ||
option php_namespace = "Eth2Signer\\v1"; | ||
option go_package = "github.com/wealdtech/eth2-signer-api/pb/v1"; | ||
option java_package = "com.wealdtech.eth2signerapi.v1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "EndpointProto"; | ||
|
||
message Endpoint { | ||
uint64 id = 1; | ||
string name = 2; | ||
uint32 port = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
syntax = "proto3"; | ||
|
||
package v1; | ||
|
||
option csharp_namespace = "Eth2Signer.v1"; | ||
option php_namespace = "Eth2Signer\\v1"; | ||
option go_package = "github.com/wealdtech/eth2-signer-api/pb/v1"; | ||
option java_package = "com.wealdtech.eth2signerapi.v1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "Eth2Proto"; | ||
|
||
// AttestationData is defined at https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#attestationdata | ||
message AttestationData { | ||
uint64 slot = 1; | ||
uint64 committee_index = 2; | ||
bytes beacon_block_root = 3; | ||
Checkpoint source = 4; | ||
Checkpoint target = 5; | ||
} | ||
|
||
// Checkpoint is defined at https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#checkpoint | ||
message Checkpoint { | ||
uint64 epoch = 1; | ||
bytes root = 2; | ||
} | ||
|
||
// BeaconBlockheader is defined at https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#beaconblockheader | ||
message BeaconBlockHeader { | ||
uint64 slot = 1; | ||
uint64 proposer_index = 2; | ||
bytes parent_root = 3; | ||
bytes state_root = 4; | ||
bytes body_root = 5; | ||
} |
31 changes: 31 additions & 0 deletions
31
bolt-cli/proto/eth2-signer-api/google/api/annotations.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) 2015, Google Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.api; | ||
|
||
import "google/api/http.proto"; | ||
import "google/protobuf/descriptor.proto"; | ||
|
||
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "AnnotationsProto"; | ||
option java_package = "com.google.api"; | ||
option objc_class_prefix = "GAPI"; | ||
|
||
extend google.protobuf.MethodOptions { | ||
// See `HttpRule`. | ||
HttpRule http = 72295728; | ||
} |
Oops, something went wrong.