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
0162faf4
Commit
0162faf4
authored
Dec 08, 2022
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update base proto
parent
fdba2053
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
166 deletions
+57
-166
meta.proto
baseapi/base/v1/meta.proto
+50
-0
request_response.proto
baseapi/base/v1/request_response.proto
+0
-17
resource.proto
baseapi/base/v1/resource.proto
+7
-149
No files found.
baseapi/base/v1/meta.proto
0 → 100644
View file @
0162faf4
syntax
=
"proto3"
;
package
base
.
v1
;
import
"google/protobuf/timestamp.proto"
;
import
"google/protobuf/any.proto"
;
import
"base/v1/resource.proto"
;
message
MetaTxProof
{
bytes
rset
=
1
;
bytes
wset
=
2
;
bytes
proof
=
3
;
int64
state_block_num
=
4
;
}
message
MetaTxBase
{
EthTransaction
tx
=
1
;
Address
from
=
2
;
google.protobuf.Timestamp
receive_time
=
3
;
}
message
MetaTx
{
MetaTxBase
base
=
1
;
MetaTxProof
proof
=
2
;
}
message
MetaBlockHeader
{
Hash
parent_hash
=
1
;
Hash
block_hash
=
2
;
Address
miner
=
3
;
Hash
state_root
=
4
;
Hash
txs_root
=
5
;
Hash
receipts_root
=
6
;
BigInt
block_number
=
7
;
EthBloom
block_bloom
=
8
;
uint64
gas_limit
=
9
;
uint64
gas_used
=
10
;
uint64
timestamp
=
11
;
bytes
extra
=
12
;
}
message
MetaBlockBody
{
repeated
MetaTx
txs
=
1
;
}
message
MetaBlock
{
MetaBlockHeader
header
=
1
;
repeated
MetaTx
txs
=
2
;
}
baseapi/base/v1/request_response.proto
deleted
100644 → 0
View file @
fdba2053
syntax
=
"proto3"
;
package
base
.
v1
;
import
"base/v1/resource.proto"
;
message
RLPData
{
bytes
data
=
1
;
}
message
Account
{
Address
address
=
1
;
bytes
nonce
=
2
;
bytes
balance
=
3
;
Hash
state_root
=
4
;
}
baseapi/base/v1/resource.proto
View file @
0162faf4
...
@@ -26,155 +26,13 @@ message Address {
...
@@ -26,155 +26,13 @@ message Address {
bytes
address
=
1
;
bytes
address
=
1
;
}
}
message
RLPData
{
// // Lengths of hashes and addresses in bytes.
bytes
data
=
1
;
// const (
// // HashLength is the expected length of the hash
// HashLength = 32
// // AddressLength is the expected length of the address
// AddressLength = 20
// )
message
EthTx
{
EthTxData
Inner
=
1
;
google.protobuf.Timestamp
time
=
2
;
}
message
EthTxData
{
uint64
account_nonce
=
1
;
bytes
price
=
2
;
uint64
gas_limit
=
3
;
Address
recipient
=
4
;
bytes
amount
=
5
;
bytes
payload
=
6
;
bytes
v
=
7
;
bytes
r
=
8
;
bytes
s
=
9
;
//This is only used when marshaling to JSON.
Hash
hash
=
10
;
bytes
from
=
11
;
}
message
StdTxData
{
uint64
account_nonce
=
1
;
bytes
price
=
2
;
uint64
gas_limit
=
3
;
Address
recipient
=
4
;
bytes
amount
=
5
;
bytes
payload
=
6
;
bytes
v
=
7
;
bytes
r
=
8
;
bytes
s
=
9
;
//This is only used when marshaling to JSON.
Hash
hash
=
10
;
bytes
from
=
11
;
}
message
StdTx
{
StdTxData
Inner
=
1
;
google.protobuf.Timestamp
time
=
2
;
}
message
TxProof
{
bytes
rset
=
1
;
bytes
wset
=
2
;
bytes
proof
=
3
;
int64
state_block_num
=
4
;
}
// 1. any eth--> proto3 eth tx --> grpc --->proto3 eth tx --> eth
message
Transaction
{
TxProof
tx_proof
=
1
;
int64
timeout_block_num
=
2
;
google.protobuf.Any
tx
=
3
;
// EthTx StdTx
}
//2. eth std: proto3 eth tx --> grpc --->proto3 eth tx
// proto3 std tx --> grpc --->proto3 std tx
message
TransactionEth
{
TxProof
tx_proof
=
1
;
int64
timeout_block_num
=
2
;
EthTx
tx
=
3
;
}
message
RepeatedEthTx
{
repeated
TransactionEth
txs
=
1
;
}
message
TransactionStd
{
TxProof
tx_proof
=
1
;
int64
timeout_block_num
=
2
;
StdTx
tx
=
3
;
}
message
RepeatedStdTx
{
repeated
TransactionStd
txs
=
1
;
}
}
message
Account
{
//3. bytes
Address
address
=
1
;
message
TransactionBytes
{
bytes
nonce
=
2
;
TxProof
tx_proof
=
1
;
bytes
balance
=
3
;
int64
timeout_block_num
=
2
;
Hash
state_root
=
4
;
bytes
tx
=
3
;
// EthTx StdTx // proto3 定义的交易,没有对应的函数转bytes。
bytes
from
=
4
;
}
}
//ype checkTx struct{
// tx interface
// From []byte
// type
//}
// type tx struct{
// checkTx
// wset []byte
// rset []byte
// proof []byte
// stateblocknum int64
// }
// type Transaction struct {
// data txdata // Consensus contents of a transaction
// time time.Time // Time first seen locally (spam avoidance)
// // caches
// hash atomic.Value
// size atomic.Value
// from atomic.Value
// }
// type txdata struct {
// AccountNonce uint64 `json:"nonce" gencodec:"required"`
// Price *big.Int `json:"gasPrice" gencodec:"required"`
// GasLimit uint64 `json:"gas" gencodec:"required"`
// Recipient *common.Address `json:"to" rlp:"nil"` // nil means contract creation
// Amount *big.Int `json:"value" gencodec:"required"`
// Payload []byte `json:"input" gencodec:"required"`
// // Signature values
// V *big.Int `json:"v" gencodec:"required"`
// R *big.Int `json:"r" gencodec:"required"`
// S *big.Int `json:"s" gencodec:"required"`
// // This is only used when marshaling to JSON.
// Hash *common.Hash `json:"hash" rlp:"-"`
//
}
\ No newline at end of file
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