-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split MainchainService into ValidatorService and WalletService, update ValidatorService #5
Changes from all commits
bc5151d
8bc9ee2
f19e374
1f7a75c
6862f4a
6d0e2ca
b06e207
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* Common message types */ | ||
|
||
syntax = "proto3"; | ||
package cusf.mainchain.v1; | ||
|
||
import "google/protobuf/wrappers.proto"; | ||
|
||
/// Consensus-encoded hex | ||
message ConsensusHex { | ||
google.protobuf.StringValue hex = 1; | ||
} | ||
|
||
/// Reverse-encoded hex | ||
message ReverseHex { | ||
google.protobuf.StringValue hex = 1; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* CUSF mainchain wallet service */ | ||
|
||
syntax = "proto3"; | ||
package cusf.mainchain.v1; | ||
|
||
import "google/protobuf/wrappers.proto"; | ||
|
||
import "cusf/mainchain/v1/common.proto"; | ||
|
||
enum AddressType { | ||
ADDRESS_TYPE_UNSPECIFIED = 0; | ||
ADDRESS_TYPE_DEFAULT = 1; | ||
ADDRESS_TYPE_BECH32 = 2; | ||
ADDRESS_TYPE_LEGACY = 3; | ||
ADDRESS_TYPE_P2SH_SEGWIT = 4; | ||
} | ||
|
||
service WalletService { | ||
rpc BroadcastWithdrawalBundle(BroadcastWithdrawalBundleRequest) | ||
returns (BroadcastWithdrawalBundleResponse); | ||
rpc CreateBmmCriticalDataTransaction(CreateBmmCriticalDataTransactionRequest) | ||
returns (CreateBmmCriticalDataTransactionResponse); | ||
rpc CreateDepositTransaction(CreateDepositTransactionRequest) | ||
returns (CreateDepositTransactionResponse); | ||
rpc CreateNewAddress(CreateNewAddressRequest) | ||
returns (CreateNewAddressResponse); | ||
// Regtest only | ||
rpc GenerateBlocks(GenerateBlocksRequest) | ||
returns (GenerateBlocksResponse); | ||
Comment on lines
+28
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can be axed. Generating blocks currently happens through the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only for Regtest mode, so the signet script is irrelevant There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what I'm thinking for signet is:
For mining on regtest, the signet miner script could be modified to remove the signet parts, but keep the rest. Sidechain management on signet needs to be implemented anyways, and we need not too-cumbersome ways of doing this on regtest as well. I.e. not re-implement the block construction logic. The way |
||
} | ||
|
||
message BroadcastWithdrawalBundleRequest { | ||
google.protobuf.UInt32Value sidechain_id = 1; | ||
google.protobuf.BytesValue transaction = 2; | ||
} | ||
message BroadcastWithdrawalBundleResponse { | ||
} | ||
|
||
message CreateBmmCriticalDataTransactionRequest { | ||
google.protobuf.UInt32Value sidechain_id = 1; | ||
google.protobuf.UInt64Value value_sats = 2; | ||
google.protobuf.UInt32Value height = 3; | ||
ConsensusHex critical_hash = 4; | ||
ConsensusHex prev_bytes = 5; | ||
} | ||
message CreateBmmCriticalDataTransactionResponse { | ||
ConsensusHex txid = 1; | ||
} | ||
|
||
message CreateDepositTransactionRequest { | ||
uint32 sidechain_id = 1; | ||
string address = 2; | ||
uint64 value_sats = 3; | ||
uint64 fee_sats = 4; | ||
} | ||
message CreateDepositTransactionResponse { | ||
ConsensusHex txid = 1; | ||
} | ||
|
||
message CreateNewAddressRequest { | ||
optional string label = 1; | ||
AddressType address_type = 2; | ||
} | ||
message CreateNewAddressResponse { | ||
string address = 1; | ||
} | ||
|
||
message GenerateBlocksRequest { | ||
google.protobuf.UInt32Value blocks = 1; | ||
} | ||
message GenerateBlocksResponse { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to decode this data into a meaningful message? I.e.
version
,title
,description
and the two hasheshttps://github.com/bitcoin/bips/blob/master/bip-0300.mediawiki#m1----propose-sidechain