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
21604207
Commit
21604207
authored
Sep 16, 2022
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add base struct.
parent
0f5a4ffc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
159 additions
and
1 deletion
+159
-1
README.md
README.md
+3
-1
base.proto
pb/base.proto
+15
-0
chain.proto
pb/chain.proto
+141
-0
No files found.
README.md
View file @
21604207
# MetaProtocol
Protocol Buffer
\ No newline at end of file
Protocol Buffer
Define base protocol-buffer.
\ No newline at end of file
pb/base.proto
0 → 100644
View file @
21604207
syntax
=
"proto3"
;
package
protocol
.
metadata
;
option
go_package
=
".;metadata"
;
// base data struct for tx.
message
TxWithFrom
{
bytes
From
=
1
;
bytes
TxData
=
2
;
}
message
NeuronTx
{
repeated
bytes
BatchHash
=
1
;
repeated
TxWithFrom
Txs
=
2
;
}
pb/chain.proto
0 → 100644
View file @
21604207
syntax
=
"proto3"
;
package
protocol
.
metaservice
;
option
go_package
=
".;"
;
// base data struct for tx.
message
TxWithFrom
{
bytes
From
=
1
;
bytes
TxData
=
2
;
}
message
NeuronTx
{
repeated
bytes
BatchHash
=
1
;
repeated
TxWithFrom
Txs
=
2
;
}
// CheckTx module message and service.
// checktx between MetaRing and Validator
message
RecoverTxRequest
{
repeated
bytes
TxDatas
=
1
;
}
message
RecoverTxResponse
{
repeated
TxWithFrom
Txs
=
1
;
}
message
CheckTxRequest
{
repeated
bytes
TxDatas
=
1
;
}
message
CheckTxResponse
{
repeated
TxWithFrom
Txs
=
1
;
repeated
bool
Valids
=
2
;
}
service
TxCheckerService
{
rpc
RecoverTx
(
RecoverTxRequest
)
returns
(
RecoverTxResponse
);
rpc
BatchCheckTx
(
CheckTxRequest
)
returns
(
CheckTxResponse
);
}
// P2P module message and service
// broadcast tx and request tx between peer.
message
BroadCastTxRequest
{
NeuronTx
BroadTx
=
1
;
}
message
BroadCastTxResponse
{
int32
PeerCount
=
1
;
}
message
RequestNeuronTx
{
bytes
Hash
=
1
;
}
message
ResponseNeuronTx
{
TxWithFrom
Tx
=
1
;
}
// service and interface define
service
P2PService
{
rpc
BroadCastTx
(
BroadCastTxRequest
)
returns
(
BroadCastTxResponse
);
rpc
FetchNeuronTx
(
RequestNeuronTx
)
returns
(
ResponseNeuronTx
);
}
// p2p connect and ping-pong protocol.
message
MessageData
{
// shared between all requests
string
clientVersion
=
1
;
// client version
int64
timestamp
=
2
;
// unix time
string
id
=
3
;
// allows requesters to use request data when processing a response
bool
gossip
=
4
;
// true to have receiver peer gossip the message to neighbors
string
nodeId
=
5
;
// id of node that created the message (not the peer that may have sent it). =base58(multihash(nodePubKey))
bytes
nodePubKey
=
6
;
// Authoring node Secp256k1 public key (32bytes) - protobufs serielized
bytes
sign
=
7
;
// signature of message data + method specific data by message authoring node.
}
message
PingRequest
{
MessageData
messageData
=
1
;
// method specific data
string
message
=
2
;
}
message
PingResponse
{
MessageData
messageData
=
1
;
// response specific data
string
message
=
2
;
}
// ConsensusClient module message and service
message
SubscribeRequest
{
int32
Chainid
=
1
;
}
message
SubscribeResponse
{
int32
Subid
=
1
;
}
// encoded block data.
message
BlockData
{
bytes
Block
=
1
;
}
message
CallContractRequest
{
string
Method
=
1
;
bytes
Input
=
2
;
}
message
CallContractResponse
{
bytes
Result
=
1
;
}
message
SendContractTxRequest
{
string
Method
=
1
;
bytes
Input
=
2
;
}
message
SendContractTxResponse
{
bytes
Result
=
1
;
}
service
ConsensusClientService
{
rpc
SubscribeBlock
(
SubscribeRequest
)
returns
(
SubscribeResponse
);
rpc
CallContract
(
CallContractRequest
)
returns
(
CallContractResponse
);
rpc
ContractTx
(
SendContractTxRequest
)
returns
(
SendContractTxResponse
);
}
// MetaNebula service interface
service
NebulaService
{
rpc
GetBalance
(
Account
)
returns
(
BigIntValue
);
rpc
GetNonce
(
Account
)
returns
(
BigIntValue
);
}
message
BigIntValue
{
string
Value
=
1
;
}
message
Account
{
bytes
Addr
=
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