filecoin-project / filecoin-project/venus
[venus-market] add proxy for venus-market / venus-market支持前置代理
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 493
- PR merge metrics
- No merged PRs in 30d
Description
### 链服务模块 / Chain Service Components
- [ ] venus
- [ ] venus-auth
- [ ] venus-gateway
- [ ] venus-messager
- [ ] venus-miner
- [ ] 文档 / docs
### 订单服务模块 / Deal Service Components
- [X] venus-market
- [ ] 文档 / docs
### 算力服务模块 / Storage Power Service Components
- [ ] venus-sector-manager
- [ ] venus-worker
- [ ] 文档 / docs
### 描述 / Description
# 动机
单一market承载能力比较有限, 如果存储检索的比较多, 会导致同时服务的客户请求比较少。 目前可以通过配置来限制检索请求的数量,但是这会导致个别请求长时间在排队状态。 如果放大服务数量,可能会导致机器承受不了,因此这里希望通过这个代理把请求分配到多个venus-market, 这样可以支持更多的检索请求,带来更好的检索体验。
## 设计
类似nginx,增加一个libp2p代理服务器,通过代理服务器把请求转发到下面的各个market服务器上。
## 实现
参考boost https://github.com/filecoin-project/boost/tree/main/protocolproxy
需要代理的协议如下(可能不全)
```go
//storage
storagemarket.AskProtocolID,
storagemarket.OldAskProtocolID,
storagemarket.DealProtocolID110,
storagemarket.DealProtocolID101,
storagemarket.DealProtocolID111,
storagemarket.OldDealStatusProtocolID,
storagemarket.DealStatusProtocolID,
//retrieval
retrievalmarket.QueryProtocolID,
retrievalmarket.OldQueryProtocolID,
network.ProtocolGraphsync_1_0_0,
network.ProtocolGraphsync_2_0_0,
```
需要增强的部分
1. 代理服务器和market服务器之间连接的维持。 market服务器断开连接后,代理服务器能够进行重连。
2. 代理服务器需要能够支持libp2p常用设置
3. 代理服务器考虑annonce 地址的问题
Contributor guide
Assessment
This issue has not been assessed yet.