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
45ccf5c1
Commit
45ccf5c1
authored
Oct 12, 2022
by
xueqianLu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update module.
parent
6c194789
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
31 deletions
+82
-31
module.md
module.md
+82
-31
No files found.
module.md
View file @
45ccf5c1
## 模块汇总
## 模块
*
P2P 模块: 用于标识节点角色以及在网络中收发消息
*
MetaP2P: 用于节点协议发现和连接,标识节点角色以及在网络中收发消息
*
交易验证模块(Meta): 用于MetaRing验证交易是否合法, 交易模拟执行?
*
MetaRing: gateway给用户提供对外接口rpc/grpc,打包批量交易发送到v1网络和广播到v2网络
*
共识Client(MetaSentry): 与共识网络进行交互.
*
MetaSentry: 主要提供v1网络的交互.
*
MetaNebula 模块: 出块模块,核心模块.
*
验签模块: 统一提供签名和验签接口.
*
交易验证模块: 用于MetaRing验证交易,以及交易模拟执行.
*
MetaNebula: 验证者模块,出块,执行交易,核心模块.
## 验签模块
#### 功能
1.
签名
2.
恢复公钥
3.
验证签名
#### 模块交互
1.
交易验证模块恢复公钥
2.
其他模块签名和验证签名
#### 接口
```
go
func
Sign
(
bytes
data
)(
bytes
signature
);
func
Verify
(
bytes
pubkey
,
bytes
signature
)
(
bool
);
func
Recover
(
bytes
hash
,
bytes
signature
)(
bytes
pubkey
);
```
## MetaP2P
#### 功能
1.
节点间发现和连接协议
2.
广播数据
3.
单点发送数据
4.
订阅接收数据
#### 模块交互
1.
MetaRing广播交易原始数据
2.
MetaNebula请求原始交易
3.
MetaNebula订阅消息
#### 接口:
## P2P 模块
```
go
#### 功能:
func
BroadCast
(
bytes
data
);
1.
peer 发现和连接(libp2p)
func
SendTo
(
Peer
conn
,
bytes
data
);
a. 提供基础peer连接和验证交互协议
func
Subscribe
(
int
msgid
,
handler
func
)()();
```
2.
提供消息广播和订阅的接口
## MetaRing
#### 功能
1.
提供对外的rpc/grpc, 支持查询区块,交易,读合约,估算gas等操作
2.
txpool缓存交易入口及控制流量
3.
交易 nonce 排序
4.
验证交易合法
5.
提供交易模拟执行接口
6.
原始交易广播到P2P网络
7.
将交易分批次打包并发送到v1网络
#### 模块交互
1.
调用交易验证模块进行交易验证
2.
调用交易验证模块模拟执行交易
3.
调用P2P模块广播交易数据
4.
调用MetaNebula模块的grpc.
5.
调用MetaSentry向v1网络发送交易.
#### 接口
```
go
// all eth jsonrpc api.
// all eth jsonrpc=> grpc.
//
```
## MetaSentry
#### 功能
1.
订阅共识网络的新区块
2.
读写共识网络的共识合约
3.
向共识网络发送交易
#### 模块交互:
#### 模块交互:
1.
为 MetaRing 及 MetaNebula 模块提供接口
1.
为MetaNebula模块提供接口订阅区块
2.
为MetaNebula提供接口读写共识合约
3.
为MetaRing模块提供v1交易发送接口
#### 接口:
#### 接口:
a. 广播交易
```
go
b. 订阅消息类型
func
SubscribeBlock
();
c. 请求交易
// 读写共识合约
d. 其他需要增加的消息类型
func
BroadCastTx
();
```
## 交易验证模块
## 交易验证模块
#### 功能:
#### 功能:
1.
批量验签
1.
批量验签
2.
验证账户nonce连续性
2.
验证账户nonce连续性
3.
验证账户余额
3.
验证账户余额
4.
合约交易模拟执行
#### 模块交互:
#### 模块交互:
1.
为MetaNebula 模块提供批量验签接口
1.
为MetaNebula 模块提供批量验签接口
...
@@ -36,20 +101,6 @@ d. 其他需要增加的消息类型
...
@@ -36,20 +101,6 @@ d. 其他需要增加的消息类型
1.
批量验签接口(仅验签)
1.
批量验签接口(仅验签)
2.
交易验证接口(验签、nonce、余额校验)
2.
交易验证接口(验签、nonce、余额校验)
## 共识Client
#### 功能:
1.
订阅共识网络的新区块
2.
读写共识网络的共识合约
#### 模块交互:
1.
为MetaNebula模块提供接口订阅区块
2.
为MetaNebula提供接口读写共识合约
#### 接口:
1.
订阅区块
2.
读写共识合约,(具体依赖合约提供的接口)
## MetaNebula模块
## MetaNebula模块
#### 功能:
#### 功能:
1.
同步主网共识层生成的区块
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