This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
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
Showing
6 changed files
with
106 additions
and
75 deletions.
There are no files selected for viewing
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,3 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "gazelle", "go_prefix") | ||
|
||
go_prefix("github.com/iotaledger/entangled") |
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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
package(default_visibility=["//visibility:public"]) | ||
|
||
load("@org_pubref_rules_protobuf//protobuf:rules.bzl", "proto_language") | ||
load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cc_proto_library") | ||
load("@org_pubref_rules_protobuf//go:rules.bzl", "go_proto_library") | ||
load("@org_pubref_rules_protobuf//grpc_gateway:rules.bzl", | ||
"grpc_gateway_proto_library", "GRPC_GATEWAY_DEPS") | ||
|
||
filegroup( | ||
name="protos", | ||
srcs=["hub.proto"], ) | ||
filegroup(name="protos", srcs=["messages.proto"]) | ||
|
||
cc_proto_library( | ||
name="cpp", | ||
protos=[":protos"], | ||
protos=[":protos", "hub.proto"], | ||
verbose=0, | ||
with_grpc=True, ) | ||
|
||
# Currently broken in rules_protobuf. | ||
#grpc_gateway_proto_library( | ||
# name="gateway", | ||
# verbose=1, | ||
# protos=["gateway.proto", ":protos"], | ||
# visibility=["//visibility:public"], ) |
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,17 @@ | ||
syntax = "proto3"; | ||
|
||
package iota.rpc; | ||
|
||
import "proto/messages.proto"; | ||
import "google/api/annotations.proto"; | ||
|
||
service HubGateway { | ||
rpc CreateUser (CreateUserRequest) returns (CreateUserReply) { | ||
option (google.api.http) = { | ||
post: "/v1/createUser" | ||
body: "*" | ||
}; | ||
|
||
} | ||
} | ||
|
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,65 @@ | ||
syntax = "proto3"; | ||
|
||
package iota.rpc; | ||
|
||
enum ErrorCode { | ||
UNKNOWN = 0; | ||
USER_EXISTS = 1; | ||
USER_DOES_NOT_EXIST = 2; | ||
} | ||
message Error { | ||
ErrorCode code = 1; | ||
} | ||
|
||
message CreateUserRequest { | ||
string userId = 1; | ||
} | ||
|
||
message CreateUserReply {} | ||
|
||
message GetBalanceRequest { | ||
string userId = 1; | ||
} | ||
|
||
message GetBalanceReply { | ||
int64 available = 1; | ||
|
||
// TODO(th0br0): pendingSweep | ||
|
||
} | ||
|
||
message DepositAddressRequest { | ||
string userId = 1; | ||
} | ||
|
||
message DepositAddressReply { | ||
string address = 1; | ||
} | ||
|
||
message UserWithdrawRequest { | ||
string userId = 1; | ||
string address = 2; | ||
uint64 amount = 3; | ||
string note = 4; | ||
} | ||
|
||
message UserWithdrawReply { | ||
uint32 error = 1; | ||
string bundleHash = 2; | ||
} | ||
|
||
message StatsRequest {} | ||
|
||
message StatsReply {} | ||
|
||
message GetUserHistoryRequest {} | ||
|
||
message GetUserHistoryReply {} | ||
|
||
message UserBalanceSubscriptionRequest {} | ||
|
||
message UserBalanceEvent {} | ||
|
||
message ScheduleSweepRequest {} | ||
|
||
message ScheduleSweepReply {} |