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
ab305b59
Commit
ab305b59
authored
Dec 13, 2022
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update proto
parent
61eaa9b7
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1413 additions
and
36 deletions
+1413
-36
eth_tx.proto
baseapi/base/v1/eth_tx.proto
+3
-3
request_response.proto
crypterapi/crypter/v1/request_response.proto
+3
-4
resource.proto
crypterapi/crypter/v1/resource.proto
+0
-9
customu256.go
custom/types/customu256.go
+130
-0
customu256_test.go
custom/types/customu256_test.go
+15
-0
service.proto
ethrpcapi/ethrpc/v1/service.proto
+3
-3
go.mod
go.mod
+1
-2
go.sum
go.sum
+1239
-0
request_response.proto
nebulaapi/txchecker/v1/request_response.proto
+3
-3
request_response.proto
p2papi/p2p/v1/request_response.proto
+4
-2
service.proto
ringapi/ring/v1/service.proto
+9
-9
service.proto
sentryapi/sentry/v1/service.proto
+3
-1
No files found.
baseapi/base/v1/eth_tx.proto
View file @
ab305b59
...
...
@@ -16,7 +16,7 @@ message EthTxParam {
BigInt
value
=
7
;
uint64
nonce
=
8
;
bytes
input
=
9
;
Eth
AccessList
accesslist
=
10
;
AccessList
accesslist
=
10
;
BigInt
chain_id
=
11
;
}
...
...
@@ -78,12 +78,12 @@ message EthTxLog {
bool
removed
=
9
;
}
message
Receipt
{
message
Eth
Receipt
{
uint32
type
=
1
;
bytes
root
=
2
;
uint64
status
=
3
;
uint64
cululative_gas_used
=
4
;
Eth
Bloom
bloom
=
5
;
Bloom
bloom
=
5
;
repeated
EthTxLog
logs
=
6
;
Hash
tx_hash
=
7
;
Address
contract_address
=
8
;
...
...
crypterapi/crypter/v1/request_response.proto
View file @
ab305b59
...
...
@@ -4,6 +4,7 @@ package crypter.v1;
import
"google/protobuf/field_mask.proto"
;
import
"google/protobuf/timestamp.proto"
;
import
"base/v1/meta.proto"
;
import
"crypter/v1/resource.proto"
;
...
...
@@ -27,22 +28,20 @@ message BatchVerifyResponse {
repeated
bool
verified
=
1
;
}
message
BatchRecoverRequest
{
repeated
bytes
data
=
1
;
repeated
bytes
signature
=
2
;
CryptType
crypt_type
=
3
;
}
message
BatchRecoverResponse
{
repeated
bytes
pubkey
=
1
;
}
message
BatchRecoverTxRequest
{
repeated
EthTx
raw_tx
=
1
;
repeated
base.v1.MetaTxBase
raw_tx
=
1
;
}
message
BatchRecoverTxResponse
{
repeated
RethTx
recover
_tx
=
1
;
repeated
base.v1.MetaTxBase
recoverd
_tx
=
1
;
}
crypterapi/crypter/v1/resource.proto
View file @
ab305b59
...
...
@@ -6,12 +6,3 @@ enum CryptType {
CRYPT_TYPE_INVALID
=
0
;
CRYPT_TYPE_SECP256K1
=
1
;
}
\ No newline at end of file
message
EthTx
{
bytes
rlp_data
=
1
;
}
message
RethTx
{
bytes
from
=
1
;
bytes
rlp_data
=
2
;
}
\ No newline at end of file
custom/types/customu256.go
0 → 100644
View file @
ab305b59
/*
Package custom contains custom types for test and example purposes.
These types are used by the test structures generated by gogoprotobuf.
*/
package
custom
import
(
"bytes"
"encoding/json"
"errors"
)
type
Uint256
[
4
]
uint64
func
(
u
Uint256
)
Marshal
()
([]
byte
,
error
)
{
buffer
:=
make
([]
byte
,
32
)
_
,
err
:=
u
.
MarshalTo
(
buffer
)
return
buffer
,
err
}
func
(
u
Uint256
)
MarshalTo
(
data
[]
byte
)
(
n
int
,
err
error
)
{
PutLittleEndianUint256
(
data
,
0
,
u
)
return
16
,
nil
}
func
GetLittleEndianUint64
(
b
[]
byte
,
offset
int
)
uint64
{
v
:=
uint64
(
b
[
offset
+
7
])
<<
56
v
+=
uint64
(
b
[
offset
+
6
])
<<
48
v
+=
uint64
(
b
[
offset
+
5
])
<<
40
v
+=
uint64
(
b
[
offset
+
4
])
<<
32
v
+=
uint64
(
b
[
offset
+
3
])
<<
24
v
+=
uint64
(
b
[
offset
+
2
])
<<
16
v
+=
uint64
(
b
[
offset
+
1
])
<<
8
v
+=
uint64
(
b
[
offset
])
return
v
}
func
PutLittleEndianUint64
(
b
[]
byte
,
offset
int
,
v
uint64
)
{
b
[
offset
]
=
byte
(
v
)
b
[
offset
+
1
]
=
byte
(
v
>>
8
)
b
[
offset
+
2
]
=
byte
(
v
>>
16
)
b
[
offset
+
3
]
=
byte
(
v
>>
24
)
b
[
offset
+
4
]
=
byte
(
v
>>
32
)
b
[
offset
+
5
]
=
byte
(
v
>>
40
)
b
[
offset
+
6
]
=
byte
(
v
>>
48
)
b
[
offset
+
7
]
=
byte
(
v
>>
56
)
}
func
PutLittleEndianUint256
(
buffer
[]
byte
,
offset
int
,
v
[
4
]
uint64
)
{
PutLittleEndianUint64
(
buffer
,
offset
,
v
[
0
])
PutLittleEndianUint64
(
buffer
,
offset
+
8
,
v
[
1
])
PutLittleEndianUint64
(
buffer
,
offset
+
16
,
v
[
2
])
PutLittleEndianUint64
(
buffer
,
offset
+
24
,
v
[
3
])
}
func
GetLittleEndianUint256
(
buffer
[]
byte
,
offset
int
)
(
value
[
4
]
uint64
)
{
value
[
0
]
=
GetLittleEndianUint64
(
buffer
,
offset
)
value
[
1
]
=
GetLittleEndianUint64
(
buffer
,
offset
+
8
)
value
[
2
]
=
GetLittleEndianUint64
(
buffer
,
offset
+
16
)
value
[
3
]
=
GetLittleEndianUint64
(
buffer
,
offset
+
24
)
return
}
func
(
u
*
Uint256
)
Unmarshal
(
data
[]
byte
)
error
{
if
data
==
nil
{
u
=
nil
return
nil
}
if
len
(
data
)
==
0
{
pu
:=
Uint256
{}
*
u
=
pu
return
nil
}
if
len
(
data
)
!=
32
{
return
errors
.
New
(
"Uint256: invalid length"
)
}
pu
:=
Uint256
(
GetLittleEndianUint256
(
data
,
0
))
*
u
=
pu
return
nil
}
func
(
u
Uint256
)
MarshalJSON
()
([]
byte
,
error
)
{
data
,
err
:=
u
.
Marshal
()
if
err
!=
nil
{
return
nil
,
err
}
return
json
.
Marshal
(
data
)
}
func
(
u
Uint256
)
Size
()
int
{
return
32
}
func
(
u
*
Uint256
)
UnmarshalJSON
(
data
[]
byte
)
error
{
v
:=
new
([]
byte
)
err
:=
json
.
Unmarshal
(
data
,
v
)
if
err
!=
nil
{
return
err
}
return
u
.
Unmarshal
(
*
v
)
}
func
(
this
Uint256
)
Equal
(
that
Uint256
)
bool
{
return
this
==
that
}
func
(
this
Uint256
)
Compare
(
that
Uint256
)
int
{
thisdata
,
err
:=
this
.
Marshal
()
if
err
!=
nil
{
panic
(
err
)
}
thatdata
,
err
:=
that
.
Marshal
()
if
err
!=
nil
{
panic
(
err
)
}
return
bytes
.
Compare
(
thisdata
,
thatdata
)
}
type
randy
interface
{
Intn
(
n
int
)
int
}
func
NewPopulatedUint256
(
r
randy
)
*
Uint256
{
data
:=
make
([]
byte
,
256
)
for
i
:=
0
;
i
<
32
;
i
++
{
data
[
i
]
=
byte
(
r
.
Intn
(
255
))
}
u
:=
Uint256
(
GetLittleEndianUint256
(
data
,
0
))
return
&
u
}
custom/types/customu256_test.go
0 → 100644
View file @
ab305b59
package
custom
import
(
"testing"
)
func
TestUint56
(
t
*
testing
.
T
)
{
var
uint256a
=
Uint256
{
0
,
1
,
2
,
3
}
buf
:=
make
([]
byte
,
32
)
PutLittleEndianUint256
(
buf
,
0
,
uint256a
)
uint256b
:=
GetLittleEndianUint256
(
buf
,
0
)
if
!
uint256a
.
Equal
(
uint256b
)
{
t
.
Fatalf
(
"%v != %v"
,
uint256a
,
uint256b
)
}
}
ethrpcapi/ethrpc/v1/service.proto
View file @
ab305b59
...
...
@@ -5,7 +5,7 @@ package ethrpc.v1;
import
"google/protobuf/empty.proto"
;
import
"ethrpc/v1/request_response.proto"
;
import
"ethrpc/v1/account_req_res.proto"
;
import
"base/v1/eth_tx.proto"
;
import
"base/v1/resource.proto"
;
...
...
@@ -63,8 +63,8 @@ service RpcService {
rpc
GetCode
(
GetCodeRequest
)
returns
(
GetCodeResponse
)
{};
rpc
Sign
(
SignRequest
)
returns
(
SignResponse
)
{};
rpc
SignTransaction
(
SignTransactionRequest
)
returns
(
SignTransactionResponse
)
{};
rpc
SendTransaction
(
base.v1.EthT
x
)
returns
(
SendTransactionResponse
)
{};
rpc
SendRawTransaction
(
base.v1.EthT
x
)
returns
(
SendRawTransactionResponse
)
{};
rpc
SendTransaction
(
base.v1.EthT
ransaction
)
returns
(
SendTransactionResponse
)
{};
rpc
SendRawTransaction
(
base.v1.EthT
ransaction
)
returns
(
SendRawTransactionResponse
)
{};
rpc
Call
(
CallRequest
)
returns
(
CallResponse
)
{};
// filter
...
...
go.mod
View file @
ab305b59
...
...
@@ -11,7 +11,7 @@ require (
require (
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/gogo/protobuf v1.3.2
// indirect
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
...
...
@@ -20,7 +20,6 @@ require (
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/tools v0.1.12 // indirect
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
google.golang.org/genproto v0.0.0-20221205194025-8222ab48f5fc // indirect
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 // indirect
google.golang.org/grpc/examples v0.0.0-20221202020918-001d234e1f2d // indirect
...
...
go.sum
View file @
ab305b59
This source diff could not be displayed because it is too large. You can
view the blob
instead.
nebulaapi/txchecker/v1/request_response.proto
View file @
ab305b59
...
...
@@ -2,16 +2,16 @@ syntax = "proto3";
package
txchecker
.
v1
;
import
"base/v1/
resource
.proto"
;
import
"base/v1/
meta
.proto"
;
// The standard BatchGet request definition.
message
BatchCheckTxRequest
{
repeated
base.v1.EthTx
txs
=
1
;
repeated
base.v1.MetaTxBase
txs
=
1
;
}
// The standard BatchGet response definition.
message
BatchCheckTxResponse
{
// The retrieved shelves.
repeated
bool
status
=
1
;
repeated
base.v1.MetaProofTx
checked_txs
=
1
;
}
p2papi/p2p/v1/request_response.proto
View file @
ab305b59
...
...
@@ -4,6 +4,8 @@ package p2p.v1;
import
"google/protobuf/field_mask.proto"
;
import
"google/protobuf/timestamp.proto"
;
import
"p2p/v1/resource.proto"
;
import
"base/v1/batchtx.proto"
;
import
"base/v1/meta.proto"
;
import
"base/v1/resource.proto"
;
message
BroadCastRequest
{
...
...
@@ -17,7 +19,7 @@ message BroadCastResponse {
message
BroadCastTxsRequest
{
repeated
base.v1.
Transaction
txs
=
1
;
repeated
base.v1.
BatchTx
txs
=
1
;
}
message
BroadCastTxsResponse
{
...
...
@@ -33,7 +35,7 @@ message BatchTxsHashRequest{
message
BatchTxsHashResponse
{
bytes
hash
=
1
;
repeated
base.v1.
Transaction
txs
=
2
;
repeated
base.v1.
MetaProofTx
txs
=
2
;
}
...
...
ringapi/ring/v1/service.proto
View file @
ab305b59
...
...
@@ -11,22 +11,22 @@ import "base/v1/resource.proto";
service
RingService
{
// account info service
rpc
SendTxAsEth
(
base.v1.TransactionEth
)
returns
(
SendRawTransactionResponse
)
{};
// account info service
, just for test.
//
rpc SendTxAsEth(base.v1.TransactionEth) returns (SendRawTransactionResponse) {};
rpc
SendRepeatedEthTx
(
base.v1.RepeatedEthTx
)
returns
(
SendRawTransactionResponse
)
{};
//
rpc SendRepeatedEthTx(base.v1.RepeatedEthTx) returns (SendRawTransactionResponse) {};
rpc
SendRepeatedStdTx
(
base.v1.RepeatedStdTx
)
returns
(
SendRawTransactionResponse
)
{};
//
rpc SendRepeatedStdTx(base.v1.RepeatedStdTx) returns (SendRawTransactionResponse) {};
rpc
SendTxAsStd
(
base.v1.TransactionStd
)
returns
(
SendRawTransactionResponse
)
{};
//
rpc SendTxAsStd(base.v1.TransactionStd) returns (SendRawTransactionResponse) {};
rpc
SendTxAsAny
(
base.v1.Transaction
)
returns
(
SendRawTransactionResponse
)
{};
//
rpc SendTxAsAny(base.v1.Transaction) returns (SendRawTransactionResponse) {};
rpc
SendTxAsBytes
(
base.v1.TransactionBytes
)
returns
(
SendRawTransactionResponse
)
{};
//
rpc SendTxAsBytes(base.v1.TransactionBytes) returns (SendRawTransactionResponse) {};
rpc
SendEmpty
(
google.protobuf.Empty
)
returns
(
google.protobuf.Empty
)
{};
//
rpc SendEmpty(google.protobuf.Empty) returns (google.protobuf.Empty) {};
rpc
SendEmptyMsg
(
EmptyRequest
)
returns
(
EmptyResponse
)
{};
//
rpc SendEmptyMsg(EmptyRequest) returns (EmptyResponse) {};
//rpc SendRawTransaction(base.v1.EthTx) returns (SendRawTransactionResponse) {};
rpc
Nonce
(
NonceRequest
)
returns
(
NonceResponse
)
{};
...
...
sentryapi/sentry/v1/service.proto
View file @
ab305b59
...
...
@@ -6,13 +6,15 @@ import "google/protobuf/empty.proto";
// SentryService methods for other module.
service
SentryService
{
// for ring
// LimitInfo get latest param for make batch tx.
rpc
GetLimitInfo
(
LimitInfoRequest
)
returns
(
LimitInfoResponse
)
{}
// CommitBatchTx used to commit batch tx to tx-sort-network
rpc
CommitBatchTx
(
CommitBatchTxRequest
)
returns
(
CommitBatchTxResponse
)
{}
// GetTxReceipt from tx-sort-network with txhash
rpc
GetBatchTxResult
(
GetReceiptRequest
)
returns
(
GetReceiptResponse
)
{}
//for val
//for validator
// GetNewBlock used for nebula get new virtual block info from contract with lastblock.
rpc
GetNewBlock
(
GetNewBlockRequest
)
returns
(
GetNewBlockResponse
)
{}
// CommitBlock used for nebula commit new block and state info to contract.
...
...
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