Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MetaProtocol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nebula
MetaProtocol
Commits
8942bc3a
Commit
8942bc3a
authored
Nov 03, 2022
by
Ubuntu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://code.wuban.net.cn/cmpchain/metaprotocol
parents
8590338e
4641f0b4
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
263 additions
and
152 deletions
+263
-152
Makefile
Makefile
+15
-15
go.mod
go.mod
+1
-1
main.go
main.go
+1
-1
account_req_res.proto
nebulaapi/nebula/v1/account_req_res.proto
+183
-49
block_req_res.proto
nebulaapi/nebula/v1/block_req_res.proto
+0
-31
service.proto
nebulaapi/nebula/v1/service.proto
+63
-24
transaction_req_res.proto
nebulaapi/nebula/v1/transaction_req_res.proto
+0
-31
No files found.
Makefile
View file @
8942bc3a
# Protobuf generated go files
PROTO_FILES
=
$(
shell
find
.
-path
-prune
-o
-type
f
-name
'*.proto'
-print
|
grep
-v
vendor
)
PROTO_GO_FILES
=
$
(
patsubst %.proto, %.pb.go,
$(PROTO_FILES)
)
PROTO_GO_FILES_REAL
=
$(
shell
find
.
-path
-prune
-o
-type
f
-name
'*.pb.go'
-print
|
grep
-v
vendor
)
PROTO_GO_FILES
=
$(
shell
find
.
-path
-prune
-o
-type
f
-name
'*.pb.go'
-print
|
grep
-v
vendor
)
#PROTO_GO_FILES = $(patsubst %.proto, %.pb.go, $(PROTO_FILES))
DEST
=
${
PWD
}
BIN
=
protocol
.PHONY
:
all build
deps clean codecheck
.PHONY
:
all build
generate deps clean lint
all
:
build codecheck
codecheck
:
$(PROTO_GO_FILES) main.go
@
go build
-o
$(BIN)
all
:
build generate lint
build
:
$(PROTO_GO_FILES)
@
buf build
lint
:
generate main.go
@
go build
-o
$(BIN)
# Implicit compile rule for GRPC/proto files (note since pb.go files no longer generated
# in same directory as proto file this just regenerates everything
%.pb.go
:
%.proto
protoc
-I
.
-I
protobuf
"
$<
"
--gogo_out
=
plugins
=
grpc:
${
DEST
}
generate
:
@
buf generate
deps
:
@
go get
-u
github.com/gogo/protobuf/protoc-gen-gogo
@
go get
-u
github.com/gogo/protobuf/protoc-gen-gogo
\
@go
install
github.com/bufbuild/buf/cmd/buf@v1.9.0
clean
:
@
rm
-f
$(PROTO_GO_FILES_REAL)
$(BIN)
@
rm
-f
$(PROTO_GO_FILES)
$(BIN)
\
@rm
-rf
gen
go.mod
View file @
8942bc3a
module github.com/cmpchain/metaprotocol
go 1.1
9
go 1.1
8
require (
google.golang.org/grpc v1.50.1
...
...
main.go
View file @
8942bc3a
...
...
@@ -22,7 +22,7 @@ type P2PServer struct {
}
type
NebulaServer
struct
{
metanebula
.
Unimplemented
Shelf
ServiceServer
metanebula
.
Unimplemented
Nebula
ServiceServer
}
type
SentryServer
struct
{
...
...
nebulaapi/nebula/v1/account_req_res.proto
View file @
8942bc3a
...
...
@@ -7,23 +7,7 @@ import "google/protobuf/field_mask.proto";
import
"google/protobuf/timestamp.proto"
;
import
"nebula/v1/resource.proto"
;
// The standard List request definition.
message
Example
{
// Only retrieve shelves after this time.
google.protobuf.Timestamp
after_time
=
1
;
// Only retrieve shelves before this time.
google.protobuf.Timestamp
before_time
=
2
;
// The start index for pagination.
uint64
start
=
3
;
// The maximum number of shelves to return.
uint64
max_size
=
4
;
// The unique id of the parent example for which to list the shelves.
string
example_id
=
5
;
}
message
NodeVersionRequest
{
string
id
=
1
;
}
message
NodeVersionRequest
{
}
message
NodeVersionResponse
{
bytes
version
=
1
;
...
...
@@ -39,33 +23,25 @@ message Sha3Response {
bytes
hash
=
1
;
}
message
NetVersionRequest
{
string
id
=
1
;
}
message
NetVersionRequest
{
}
message
NetVersionResponse
{
bytes
version
=
1
;
}
message
NetPeerCountRequest
{
string
id
=
1
;
}
message
NetPeerCountRequest
{
}
message
NetPeerCountResponse
{
uint32
peer_count
=
1
;
}
message
ProtocolVersionRequest
{
string
id
=
1
;
}
message
ProtocolVersionRequest
{
}
message
ProtocolVersionResponse
{
bytes
version
=
1
;
}
message
SyncingRequest
{
string
id
=
1
;
}
message
SyncingRequest
{
}
message
SyncingResponse
{
bytes
start
=
1
;
...
...
@@ -73,50 +49,38 @@ message SyncingResponse {
bytes
current
=
3
;
}
message
CoinbaseRequest
{
string
id
=
1
;
}
message
CoinbaseRequest
{
}
message
CoinbaseResponse
{
bytes
address
=
1
;
}
message
MiningRequest
{
string
id
=
1
;
}
message
MiningRequest
{
}
message
MiningResponse
{
string
status
=
1
;
}
message
HashRateRequest
{
string
id
=
1
;
}
message
HashRateRequest
{
}
message
HashRateResponse
{
string
result
=
1
;
}
message
GasPriceRequest
{
string
id
=
1
;
}
message
GasPriceRequest
{
}
message
GasPriceResponse
{
// gas price in wei.
bytes
gas_price
=
1
;
}
message
AccountsRequest
{
string
id
=
1
;
}
message
AccountsRequest
{
}
message
AccountsResponse
{
repeated
bytes
address
=
1
;
}
message
HeightRequest
{
string
id
=
1
;
}
message
HeightRequest
{
}
message
HeightResponse
{
bytes
height
=
1
;
...
...
@@ -151,7 +115,7 @@ message StorageResponse {
bytes
data
=
4
;
}
message
Get
NonceRequest
{
message
NonceRequest
{
// request address
bytes
address
=
1
;
// request block number
...
...
@@ -167,7 +131,7 @@ message NonceResponse {
bytes
nonce
=
3
;
}
message
Get
TransactionCountRequest
{
message
TransactionCountRequest
{
// request address
bytes
address
=
1
;
// request block number
...
...
@@ -264,3 +228,173 @@ message SendRawTransactionRequest {
message
SendRawTransactionResponse
{
bytes
tx_hash
=
1
;
}
message
CallRequest
{
bytes
signed_tx
=
1
;
}
message
CallResponse
{
bytes
result
=
1
;
}
message
EstimateGasRequest
{
bytes
signed_tx
=
1
;
}
message
EstimateGasResponse
{
bytes
result
=
1
;
uint32
gas
=
2
;
}
message
BlockByHashRequest
{
bytes
block_hash
=
1
;
}
message
BlockByHashResponse
{
bytes
block
=
1
;
}
message
BlockByNumberRequest
{
bytes
block_id
=
1
;
}
message
BlockByNumberResponse
{
bytes
block
=
1
;
}
message
TransactionByHashRequest
{
bytes
tx_hash
=
1
;
}
message
TransactionByHashResponse
{
bytes
tx_data
=
1
;
}
message
TransactionByBlockHashAndIndexRequest
{
bytes
block_hash
=
1
;
uint32
index
=
2
;
}
message
TransactionByBlockHashAndIndexResponse
{
bytes
tx_data
=
1
;
}
message
TransactionByBlockNumberAndIndexRequest
{
bytes
block_id
=
1
;
uint32
index
=
2
;
}
message
TransactionByBlockNumberAndIndexResponse
{
bytes
tx_data
=
1
;
}
message
TransactionReceiptRequest
{
bytes
tx_hash
=
1
;
}
message
TransactionReceiptResponse
{
bytes
tx_receipt
=
1
;
}
message
UncleByBlockHashAndIndexRequest
{
bytes
block_hash
=
1
;
uint32
index
=
2
;
}
message
UncleByBlockHashAndIndexResponse
{
bytes
uncle_block
=
1
;
}
message
UncleByBlockNumberAndIndexRequest
{
bytes
block_id
=
1
;
uint32
index
=
2
;
}
message
UncleByBlockNumberAndIndexResponse
{
bytes
uncle_block
=
1
;
}
message
CompilersRequest
{
}
message
CompilersResponse
{
bytes
compilers
=
1
;
}
message
CompileSolidityRequest
{
bytes
source
=
1
;
}
message
CompileSolidityResponse
{
bytes
code
=
1
;
}
message
CompileLLLRequest
{
bytes
source
=
1
;
}
message
CompileLLLResponse
{
bytes
code
=
1
;
}
message
CompileSerpentRequest
{
bytes
source
=
1
;
}
message
CompileSerpentResponse
{
bytes
code
=
1
;
}
message
NewFilterRequest
{
bytes
param
=
1
;
}
message
NewFilterResponse
{
bytes
filter_id
=
1
;
}
message
NewBlockFilterRequest
{
}
message
NewBlockFilterResponse
{
bytes
filter_id
=
1
;
}
message
PendingTransactionFilterRequest
{
}
message
PendingTransactionFilterResponse
{
bytes
filter_id
=
1
;
}
message
UninstallFilterRequest
{
bytes
filter_id
=
1
;
}
message
UninstallFilterResponse
{
bool
result
=
1
;
}
message
FilterChangesRequest
{
bytes
filter_id
=
1
;
}
message
FilterChangesResponse
{
bytes
info
=
1
;
}
message
FilterLogsRequest
{
bytes
filter_id
=
1
;
}
message
FilterLogsResponse
{
bytes
logs
=
1
;
}
message
LogsRequest
{
bytes
param
=
1
;
}
message
LogsResponse
{
bytes
logs
=
1
;
}
\ No newline at end of file
nebulaapi/nebula/v1/block_req_res.proto
deleted
100644 → 0
View file @
8590338e
syntax
=
"proto3"
;
package
nebula
.
v1
;
//option go_package = "nebulav1";
import
"google/protobuf/field_mask.proto"
;
import
"google/protobuf/timestamp.proto"
;
import
"nebula/v1/resource.proto"
;
// The standard List request definition.
// message Example {
// // Only retrieve shelves after this time.
// google.protobuf.Timestamp after_time = 1;
// // Only retrieve shelves before this time.
// google.protobuf.Timestamp before_time = 2;
// // The start index for pagination.
// uint64 start = 3;
// // The maximum number of shelves to return.
// uint64 max_size = 4;
// // The unique id of the parent example for which to list the shelves.
// string example_id = 5;
// }
// message GetBlockByNumberRequest {
// // request block number
// bytes block_id = 1;
// }
// message BlockResponse {
// bytes block_info = 1;
// }
nebulaapi/nebula/v1/service.proto
View file @
8942bc3a
...
...
@@ -2,41 +2,80 @@ syntax = "proto3";
package
nebula
.
v1
;
//option go_package = "nebulav1";
import
"google/protobuf/empty.proto"
;
import
"nebula/v1/request_response.proto"
;
import
"nebula/v1/block_req_res.proto"
;
import
"nebula/v1/account_req_res.proto"
;
service
NebulaService
{
// web3
rpc
Sha3
(
Sha3Request
)
returns
(
Sha3Response
)
{};
rpc
NodeVersion
(
google.protobuf.Empty
)
returns
(
NodeVersionResponse
)
{};
// network info service
rpc
NetVersion
(
google.protobuf.Empty
)
returns
(
NetVersionResponse
)
{};
rpc
NetPeerCount
(
google.protobuf.Empty
)
returns
(
NetPeerCountResponse
)
{};
// node status
rpc
ProtocolVersion
(
google.protobuf.Empty
)
returns
(
ProtocolVersionResponse
)
{};
rpc
Syncing
(
google.protobuf.Empty
)
returns
(
SyncingResponse
)
{};
rpc
Coinbase
(
google.protobuf.Empty
)
returns
(
CoinbaseResponse
)
{};
rpc
Mining
(
google.protobuf.Empty
)
returns
(
MiningResponse
)
{};
rpc
HashRate
(
google.protobuf.Empty
)
returns
(
HashRateResponse
)
{};
rpc
Accounts
(
google.protobuf.Empty
)
returns
(
AccountsResponse
)
{};
// tx operatoration
rpc
GasPrice
(
google.protobuf.Empty
)
returns
(
GasPriceResponse
)
{};
// block info service
// rpc
rpc
BlockNumber
(
google.protobuf.Empty
)
returns
(
HeightResponse
)
{};
rpc
BlockByHash
(
BlockByHashRequest
)
returns
(
BlockByHashResponse
)
{};
rpc
BlockByNumber
(
BlockByNumberRequest
)
returns
(
BlockByNumberResponse
)
{};
rpc
BlockTransactionCountByHash
(
BlockTransactionCountByHashRequest
)
returns
(
BlockTransactionCountByHashResponse
)
{};
rpc
BlockTransactionCountByNumber
(
BlockTransactionCountByNumberRequest
)
returns
(
BlockTransactionCountByNumberResponse
)
{};
rpc
UncleCountByHash
(
UncleCountByHashRequest
)
returns
(
UncleCountByHashResponse
)
{};
rpc
UncleCountByNumber
(
UncleCountByNumberRequest
)
returns
(
UncleCountByNumberResponse
)
{};
rpc
UncleByBlockHashAndIndex
(
UncleByBlockHashAndIndexRequest
)
returns
(
UncleByBlockHashAndIndexResponse
)
{};
rpc
UncleByBlockNumberAndIndex
(
UncleByBlockNumberAndIndexRequest
)
returns
(
UncleByBlockNumberAndIndexResponse
)
{};
// compiler
rpc
Compilers
(
CompilersRequest
)
returns
(
CompilersResponse
)
{};
rpc
CompileSolidity
(
CompileSolidityRequest
)
returns
(
CompileSolidityResponse
)
{};
rpc
CompileLLL
(
CompileLLLRequest
)
returns
(
CompileLLLResponse
)
{};
rpc
CompileSerpent
(
CompileSerpentRequest
)
returns
(
CompileSerpentResponse
)
{};
// transaction info service
rpc
EstimateGas
(
EstimateGasRequest
)
returns
(
EstimateGasResponse
)
{};
rpc
TransactionByHash
(
TransactionByHashRequest
)
returns
(
TransactionByHashResponse
)
{};
rpc
TransactionByBlockHashAndIndex
(
TransactionByBlockHashAndIndexRequest
)
returns
(
TransactionByBlockHashAndIndexResponse
)
{};
rpc
TransactionByBlockNumberAndIndex
(
TransactionByBlockNumberAndIndexRequest
)
returns
(
TransactionByBlockNumberAndIndexResponse
)
{};
rpc
TransactionReceipt
(
TransactionReceiptRequest
)
returns
(
TransactionReceiptResponse
)
{};
// account info service
rpc
Balance
(
BalanceRequest
)
returns
(
BalanceResponse
)
{};
rpc
Storage
(
StorageRequest
)
returns
(
StorageResponse
)
{};
rpc
Nonce
(
NonceRequest
)
returns
(
NonceResponse
)
{};
rpc
TransactionCount
(
TransactionCountRequest
)
returns
(
TransactionCountResponse
)
{};
rpc
GetCode
(
GetCodeRequest
)
returns
(
GetCodeResponse
)
{};
rpc
Sign
(
SignRequest
)
returns
(
SignResponse
)
{};
rpc
SignTransaction
(
SignTransactionRequest
)
returns
(
SignTransactionResponse
)
{};
rpc
SendTransaction
(
SendTransactionRequest
)
returns
(
SendTransactionResponse
)
{};
rpc
SendRawTransaction
(
SendRawTransactionRequest
)
returns
(
SendRawTransactionResponse
)
{};
rpc
Call
(
CallRequest
)
returns
(
CallResponse
)
{};
// network info service
// filter
rpc
NewFilter
(
NewFilterRequest
)
returns
(
NewFilterResponse
)
{};
rpc
NewBlockFilter
(
google.protobuf.Empty
)
returns
(
NewBlockFilterResponse
)
{};
rpc
PendingTransactionFilter
(
google.protobuf.Empty
)
returns
(
PendingTransactionFilterResponse
)
{};
rpc
UninstallFilter
(
UninstallFilterRequest
)
returns
(
UninstallFilterResponse
)
{};
rpc
FilterChanges
(
FilterChangesRequest
)
returns
(
FilterChangesResponse
)
{};
rpc
FilterLogs
(
FilterLogsRequest
)
returns
(
FilterLogsResponse
)
{};
rpc
Logs
(
LogsRequest
)
returns
(
LogsResponse
)
{};
// node info service
// consensus info service
//
}
// ShelfService defines methods for managing shelves.
service
ShelfService
{
// ListShelves retrieves a list of shelf resources from the server.
//rpc ListShelves(ListShelvesRequest) returns (ListShelvesResponse) {}
// BatchGetShelves retrieves multiple shelf resources from the server.
// rpc BatchGetShelves(BatchGetShelvesRequest) returns (BatchGetShelvesResponse) {}
// // GetShelf retrieves a single shelf resource from the server.
// rpc GetShelf(GetShelfRequest) returns (GetShelfResponse) {}
// // CreateShelf creates a new shelf resource on the server.
// rpc CreateShelf(CreateShelfRequest) returns (CreateShelfResponse) {}
// // UpdateShelf updates the shelf resource on the server.
// rpc UpdateShelf(UpdateShelfRequest) returns (UpdateShelfResponse) {}
// // DeleteShelf deletes the shelf resource from the server.
// rpc DeleteShelf(DeleteShelfRequest) returns (DeleteShelfResponse) {}
}
\ No newline at end of file
nebulaapi/nebula/v1/transaction_req_res.proto
deleted
100644 → 0
View file @
8590338e
syntax
=
"proto3"
;
package
nebula
.
v1
;
//option go_package = "nebulav1";
import
"google/protobuf/field_mask.proto"
;
import
"google/protobuf/timestamp.proto"
;
import
"nebula/v1/resource.proto"
;
// The standard List request definition.
// message Example {
// // Only retrieve shelves after this time.
// google.protobuf.Timestamp after_time = 1;
// // Only retrieve shelves before this time.
// google.protobuf.Timestamp before_time = 2;
// // The start index for pagination.
// uint64 start = 3;
// // The maximum number of shelves to return.
// uint64 max_size = 4;
// // The unique id of the parent example for which to list the shelves.
// string example_id = 5;
// }
message
GetBlockByNumberRequest
{
// request block number
bytes
block_id
=
1
;
}
message
BlockResponse
{
bytes
block_info
=
1
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment