Skip to content

Commit

Permalink
Merge pull request #334 from ipfs-force-community/feat/rename-project
Browse files Browse the repository at this point in the history
feat: replace market with droplet
  • Loading branch information
hunjixin authored Jun 9, 2023
2 parents 44270ab + 1fb501e commit 031305d
Show file tree
Hide file tree
Showing 165 changed files with 771 additions and 710 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build_upload:
uses: filecoin-project/venus/.github/workflows/common_build_upload.yml@master
with:
bin_name: 'venus-market'
bin_name: 'droplet'
has_ffi: true
secrets:
OSS_KEY_ID: ${{secrets.OSS_KEY_ID}}
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*.dylib
badgerStAskDb/
*.puml
/market-client
/venus-market
/droplet-client
/droplet
sequence_chart.md
.idea
.vscode
Expand Down
44 changes: 22 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# venus-market changelog
# droplet changelog

## v2.7.2

* 修复订单卡在 StorageDealStaged 状态 [[#324](https://github.com/filecoin-project/venus-market/pull/324)]
* 修复订单卡在 StorageDealStaged 状态 [[#324](https://github.com/ipfs-force-community/droplet/pull/324)]

## v2.7.1

Expand All @@ -17,30 +17,30 @@

### New Features

* feat: add status api to detect api ready by @hunjixin /添加状态检测接口 [[#282](https://github.com/filecoin-project/venus-market/pull/282)]
* feat: Add miner manager related commands @diwufeiwen /增加 miner manager 相关命令 [[#293](https://github.com/filecoin-project/venus-market/pull/293)]
* feat: add command to print signer deal detail by @simlecode /增加两个命令行用于输出单个存储订单和检索的详情 [[#298](https://github.com/filecoin-project/venus-market/pull/298)]
* feat: unsealed from sp through venus-gateway / 通过venus-gateway给SP下发unsealed请求 by @diwufeiwen [[#267](https://github.com/filecoin-project/venus-market/pull/267)]
* feat: opt deal list cmds by @simlecode / 订单查询优化 [[#301](https://github.com/filecoin-project/venus-market/pull/301)]
* feat: new api ReleaseDeals by @0x5459 /新增 ReleaseDeals 接口 [[#305](https://github.com/filecoin-project/venus-market/pull/305)]
* feat: add command to cancel data transfer by @simlecode / 根据条件取消检索订单 [[#307](https://github.com/filecoin-project/venus-market/pull/307)]
* feat: more time for query retrieval ask by @hunjixin /querytimeout从5秒改成5分钟[[#304](https://github.com/filecoin-project/venus-market/pull/304)]
* feat: destroy shards by @simlecode /添加DagstoreDestroyShard命令 [[#309](https://github.com/filecoin-project/venus-market/pull/309)]
* feat: update unseal api / 更新 unseal 的接口 by @LinZexiao [[#314](https://github.com/filecoin-project/venus-market/pull/314)]
* feat: add docker push by @hunjixin /增加推送到镜像仓库的功能 [[#316](https://github.com/filecoin-project/venus-market/pull/316)]
* feat: add command to expend claim term by @simlecode /添加续期命令 [[#315](https://github.com/filecoin-project/venus-market/pull/315)]
* feat: add status api to detect api ready by @hunjixin /添加状态检测接口 [[#282](https://github.com/ipfs-force-community/droplet/pull/282)]
* feat: Add miner manager related commands @diwufeiwen /增加 miner manager 相关命令 [[#293](https://github.com/ipfs-force-community/droplet/pull/293)]
* feat: add command to print signer deal detail by @simlecode /增加两个命令行用于输出单个存储订单和检索的详情 [[#298](https://github.com/ipfs-force-community/droplet/pull/298)]
* feat: unsealed from sp through sophon-gateway / 通过sophon-gateway给SP下发unsealed请求 by @diwufeiwen [[#267](https://github.com/ipfs-force-community/droplet/pull/267)]
* feat: opt deal list cmds by @simlecode / 订单查询优化 [[#301](https://github.com/ipfs-force-community/droplet/pull/301)]
* feat: new api ReleaseDeals by @0x5459 /新增 ReleaseDeals 接口 [[#305](https://github.com/ipfs-force-community/droplet/pull/305)]
* feat: add command to cancel data transfer by @simlecode / 根据条件取消检索订单 [[#307](https://github.com/ipfs-force-community/droplet/pull/307)]
* feat: more time for query retrieval ask by @hunjixin /querytimeout从5秒改成5分钟[[#304](https://github.com/ipfs-force-community/droplet/pull/304)]
* feat: destroy shards by @simlecode /添加DagstoreDestroyShard命令 [[#309](https://github.com/ipfs-force-community/droplet/pull/309)]
* feat: update unseal api / 更新 unseal 的接口 by @LinZexiao [[#314](https://github.com/ipfs-force-community/droplet/pull/314)]
* feat: add docker push by @hunjixin /增加推送到镜像仓库的功能 [[#316](https://github.com/ipfs-force-community/droplet/pull/316)]
* feat: add command to expend claim term by @simlecode /添加续期命令 [[#315](https://github.com/ipfs-force-community/droplet/pull/315)]


### Bug Fixes
* fix: add composite indexes by @simlecode / 添加联合索引 [[#294](https://github.com/filecoin-project/venus-market/pull/294)]
* fix: check deal state in ReleaseDeals by @0x5459 / ReleaseDeals 方法需要判断订单状态 [[#308](https://github.com/filecoin-project/venus-market/pull/308)]
* fix: add check for miner config by @simlecode / 未找到矿工配置时返回错误 [[#311](https://github.com/filecoin-project/venus-market/pull/311)]
* fix: Circular search for deals by @simlecode / 循环检索订单 [[#310](https://github.com/filecoin-project/venus-market/pull/310)]
* fix: PaymentAddress uses a fake address when retrieval data does not exist by @simlecode / 当检索数据不存在时,paymentaddress用个假地址 [[#312](https://github.com/filecoin-project/venus-market/pull/312)]
* fix: add composite indexes by @simlecode / 添加联合索引 [[#294](https://github.com/ipfs-force-community/droplet/pull/294)]
* fix: check deal state in ReleaseDeals by @0x5459 / ReleaseDeals 方法需要判断订单状态 [[#308](https://github.com/ipfs-force-community/droplet/pull/308)]
* fix: add check for miner config by @simlecode / 未找到矿工配置时返回错误 [[#311](https://github.com/ipfs-force-community/droplet/pull/311)]
* fix: Circular search for deals by @simlecode / 循环检索订单 [[#310](https://github.com/ipfs-force-community/droplet/pull/310)]
* fix: PaymentAddress uses a fake address when retrieval data does not exist by @simlecode / 当检索数据不存在时,paymentaddress用个假地址 [[#312](https://github.com/ipfs-force-community/droplet/pull/312)]

## v2.6.0

* 增加列出 storage/retrieval asks 命令行 [[#272](https://github.com/filecoin-project/venus-market/pull/272)]
* 重构 updatedealstatus 接口 [[#289](https://github.com/filecoin-project/venus-market/pull/289)]
* 升级 venus、venus-messager、venus-gateway 和 venus-auth 版本到 v1.10.0
* 增加列出 storage/retrieval asks 命令行 [[#272](https://github.com/ipfs-force-community/droplet/pull/272)]
* 重构 updatedealstatus 接口 [[#289](https://github.com/ipfs-force-community/droplet/pull/289)]
* 升级 venus、sophon-messager、sophon-gateway 和 sophon-auth 版本到 v1.10.0
* 升级 go-jsonrpc 版本到 v0.1.7
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ all: build
# git modules that need to be loaded
MODULES:=

ldflags=-X=github.com/filecoin-project/venus-market/v2/version.CurrentCommit=+git.$(subst -,.,$(shell git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || git rev-parse --short HEAD 2>/dev/null))
ldflags=-X=github.com/ipfs-force-community/droplet/v2/version.CurrentCommit=+git.$(subst -,.,$(shell git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || git rev-parse --short HEAD 2>/dev/null))
ifneq ($(strip $(LDFLAGS)),)
ldflags+=-extldflags=$(LDFLAGS)
endif
Expand Down Expand Up @@ -57,10 +57,10 @@ dist-clean:
git submodule deinit --all -f

build: $(BUILD_DEPS)
rm -f market-client
rm -f venus-market
go build -o ./market-client $(GOFLAGS) ./cmd/market-client
go build -o ./venus-market $(GOFLAGS) ./cmd/venus-market
rm -f droplet-client
rm -f droplet
go build -o ./droplet-client $(GOFLAGS) ./cmd/droplet-client
go build -o ./droplet $(GOFLAGS) ./cmd/droplet

add-debug-flag:
GOFLAGS+=-gcflags="all=-N -l"
Expand All @@ -77,17 +77,17 @@ ifdef DOCKERFILE
else
curl -O https://raw.githubusercontent.com/filecoin-project/venus-docs/master/script/docker/dockerfile
endif
docker build --build-arg HTTPS_PROXY=$(BUILD_DOCKER_PROXY) --build-arg BUILD_TARGET=venus-market -t venus-market .
docker build --build-arg HTTPS_PROXY=$(BUILD_DOCKER_PROXY) --build-arg BUILD_TARGET=market-client -t market-client .
docker tag venus-market filvenus/venus-market:$(TAG)
docker tag market-client filvenus/market-client:$(TAG)
docker build --build-arg HTTPS_PROXY=$(BUILD_DOCKER_PROXY) --build-arg BUILD_TARGET=droplet -t droplet .
docker build --build-arg HTTPS_PROXY=$(BUILD_DOCKER_PROXY) --build-arg BUILD_TARGET=droplet-client -t droplet-client .
docker tag droplet filvenus/droplet:$(TAG)
docker tag droplet-client filvenus/droplet-client:$(TAG)
ifdef PRIVATE_REGISTRY
docker tag venus-market $(PRIVATE_REGISTRY)/filvenus/venus-market:$(TAG)
docker tag market-client $(PRIVATE_REGISTRY)/filvenus/market-client:$(TAG)
docker tag droplet $(PRIVATE_REGISTRY)/filvenus/droplet:$(TAG)
docker tag droplet-client $(PRIVATE_REGISTRY)/filvenus/droplet-client:$(TAG)
endif



docker-push: docker
docker push $(PRIVATE_REGISTRY)/filvenus/venus-market:$(TAG)
docker push $(PRIVATE_REGISTRY)/filvenus/market-client:$(TAG)
docker push $(PRIVATE_REGISTRY)/filvenus/droplet:$(TAG)
docker push $(PRIVATE_REGISTRY)/filvenus/droplet-client:$(TAG)
52 changes: 25 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,73 @@
<h1 align="center">Venus Market</h1>
<h1 align="center">Droplet</h1>

<p align="center">
<a href="https://github.com/filecoin-project/venus-market/actions"><img src="https://github.com/filecoin-project/venus-market/actions/workflows/build_upload.yml/badge.svg"/></a>
<a href="https://codecov.io/gh/filecoin-project/venus-market"><img src="https://codecov.io/gh/filecoin-project/venus-market/branch/master/graph/badge.svg?token=J5QWYWkgHT"/></a>
<a href="https://goreportcard.com/report/github.com/filecoin-project/venus-market"><img src="https://goreportcard.com/badge/github.com/filecoin-project/venus-market"/></a>
<a href="https://github.com/filecoin-project/venus-market/tags"><img src="https://img.shields.io/github/v/tag/filecoin-project/venus-market"/></a>
<a href="https://github.com/ipfs-force-community/droplet/actions"><img src="https://github.com/ipfs-force-community/droplet/actions/workflows/build_upload.yml/badge.svg"/></a>
<a href="https://codecov.io/gh/ipfs-force-community/droplet"><img src="https://codecov.io/gh/ipfs-force-community/droplet/branch/master/graph/badge.svg?token=J5QWYWkgHT"/></a>
<a href="https://goreportcard.com/report/github.com/ipfs-force-community/droplet"><img src="https://goreportcard.com/badge/github.com/ipfs-force-community/droplet"/></a>
<a href="https://github.com/ipfs-force-community/droplet/tags"><img src="https://img.shields.io/github/v/tag/ipfs-force-community/droplet"/></a>
<br>
</p>

Use [Venus Issues](https://github.com/filecoin-project/venus/issues) for reporting issues about this repository.
droplet will deliver a complete deal making experience as what lotus offers. This includes compatibility with lotus client where one can make deal with droplet using lotus client, retrieve deal/data in the same way as lotus retrieves its data, setup storage ask and etc.

venus-market will deliver a complete deal making experience as what lotus offers. This includes compatibility with lotus client where one can make deal with venus-market using lotus client, retrieve deal/data in the same way as lotus retrieves its data, setup storage ask and etc.

Use [Venus Issues](https://github.com/filecoin-project/venus/issues) for reporting issues about this repository.
Use [Droplet Issues](https://github.com/ipfs-force-community/droplet/issues) for reporting issues about this repository.

## feature
1. market 2.0 mainly implements the aggregation of multiple storage miners. clients can issue orders or retrieve any providers registered to venus-market.
1. market 2.0 mainly implements the aggregation of multiple storage miners. clients can issue orders or retrieve any providers registered to droplet.
2. all metadata of provider server is stored in the mysql database that providing better data security.
3. providers do not need to pay attention for the details of the deal, only need to query the market regularly to see if you have any deal to seal.
4. market maintain a piece pool, that is, to provide the provider with the data for sealing deals, and it can also speed up the retrieval speed. ask miners for unseal operations, only when missing piece in venus-market.
3. providers do not need to pay attention for the details of the deal, only need to query the market regularly to see if you have any deal to seal.
4. market maintain a piece pool, that is, to provide the provider with the data for sealing deals, and it can also speed up the retrieval speed. ask miners for unseal operations, only when missing piece in droplet.
5. for clients, it is fully compatible with lotus.


## build

```sh
git clone https://github.com/filecoin-project/venus-market.git
cd venus-market
git clone https://github.com/ipfs-force-community/droplet.git
cd droplet
make
```
## how to set up venus-market
## how to set up droplet

run:

- run in chain service
```shell script
./venus-market run --auth-url=<auth url> --node-url=<node url> --messager-url=<messager url> --gateway-url=<signer url> --cs-token=<token of admin-authority> --signer-type="gateway"
./droplet run --auth-url=<auth url> --node-url=<node url> --messager-url=<messager url> --gateway-url=<signer url> --cs-token=<token of admin-authority> --signer-type="gateway"
```

- run in local, conn venus chain service and use lotus-wallet/venus-wallet to sign
```shell script
./venus-market run --auth-url=<auth url> --node-url=<node url> --messager-url=<messager url> --cs-token=<token of write-authority> --signer-type="wallet" --signer-url=<wallet url> --signer-token=<wallet token>
./droplet run --auth-url=<auth url> --node-url=<node url> --messager-url=<messager url> --cs-token=<token of write-authority> --signer-type="wallet" --signer-url=<wallet url> --signer-token=<wallet token>
```

- run in local, conn lotus full node and use lotus full node to sign
```shell script
./venus-market run --node-url=<node url> --messager-url=<node url> --cs-token=<token of lotus> --signer-type="lotusnode"
./droplet run --node-url=<node url> --messager-url=<node url> --cs-token=<token of lotus> --signer-type="lotusnode"
```

set peer id and address

```shell script
./venus-market net listen #query venus-market address and peerid
./venus-market actor set-peer-id --miner <f0xxxx> <id> #set peer id
./venus-market actor set-addrs --miner <f0xxxx> <addr> #set miner address
./venus-market actor info --miner <f0xxxx> #query miner address and peerid on chain
./droplet net listen #query droplet address and peerid
./droplet actor set-peer-id --miner <f0xxxx> <id> #set peer id
./droplet actor set-addrs --miner <f0xxxx> <addr> #set miner address
./droplet actor info --miner <f0xxxx> #query miner address and peerid on chain
```

set storage ask
```shell script
./venus-market storage-deals set-ask --price <price> --verified-price <price> --min-piece-size <minsize >=256B> --max-piece-size <max size <=sector-size> --miner <f0xxxx>
./droplet storage-deals set-ask --price <price> --verified-price <price> --min-piece-size <minsize >=256B> --max-piece-size <max size <=sector-size> --miner <f0xxxx>
```

set retrieval ask
```shell script
./venus-market retrieval-deals set-ask --price <pirce> --unseal-price <price> --payment-interval <bytes> --payment-interval-increase <bytes> --payment-addr <fxxx>
./droplet retrieval-deals set-ask --price <price> --unseal-price <price> --payment-interval <bytes> --payment-interval-increase <bytes> --payment-addr <f0xxx>
```

## how to setup market client
## how to setup droplet client

```shell script
./market-client run --node-url <node url> --node-token <auth token> --signer-url <wallet url> --signer-token <wallet token> --addr <client default address>
./droplet-client run --node-url <node url> --node-token <auth token> --signer-url <wallet url> --signer-token <wallet token> --addr <client default address>
```
Note:**please use a seperate address, or maybe nonce confiction**
Note:**please use a separate address, or maybe nonce conflict**
8 changes: 4 additions & 4 deletions api/clients/mix_msgclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"

"github.com/filecoin-project/venus-market/v2/api/clients/signer"
"github.com/filecoin-project/venus-market/v2/utils"
"github.com/ipfs-force-community/droplet/v2/api/clients/signer"
"github.com/ipfs-force-community/droplet/v2/utils"

v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
"github.com/filecoin-project/venus/venus-shared/types"
Expand Down Expand Up @@ -103,13 +103,13 @@ func (msgClient *MixMsgClient) PushMessage(ctx context.Context, msg *types.Messa
return cid.Undef, err
}

// from-account-signer handling moved to venus-gateway
// from-account-signer handling moved to sophon-gateway
_, err = msgClient.venusMessager.PushMessageWithId(ctx, msgID.String(), msg, nil)
if err != nil {
return cid.Undef, err
}

log.Infof("push message %s to venus-messager", msgID.String())
log.Warnf("push message %s to sophon-messager", msgID.String())

return msgID, nil
}
Expand Down
6 changes: 3 additions & 3 deletions api/clients/modules.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package clients

import (
"github.com/filecoin-project/venus-auth/jwtclient"
"github.com/ipfs-force-community/sophon-auth/jwtclient"
logging "github.com/ipfs/go-log/v2"

"github.com/ipfs-force-community/venus-common-utils/builder"

"github.com/filecoin-project/venus-market/v2/api/clients/signer"
"github.com/filecoin-project/venus-market/v2/config"
"github.com/ipfs-force-community/droplet/v2/api/clients/signer"
"github.com/ipfs-force-community/droplet/v2/config"

v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
)
Expand Down
4 changes: 2 additions & 2 deletions api/clients/node_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-jsonrpc"

"github.com/filecoin-project/venus-market/v2/config"
"github.com/filecoin-project/venus-market/v2/utils"
"github.com/ipfs-force-community/droplet/v2/config"
"github.com/ipfs-force-community/droplet/v2/utils"

"github.com/filecoin-project/venus/venus-shared/api"
v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
Expand Down
4 changes: 2 additions & 2 deletions api/clients/signer/gateway_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-jsonrpc"

"github.com/filecoin-project/venus-auth/jwtclient"
"github.com/ipfs-force-community/sophon-auth/jwtclient"

"github.com/filecoin-project/venus-market/v2/config"
"github.com/ipfs-force-community/droplet/v2/config"

vCrypto "github.com/filecoin-project/venus/pkg/crypto"
"github.com/filecoin-project/venus/venus-shared/api"
Expand Down
2 changes: 1 addition & 1 deletion api/clients/signer/lotusnode_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-jsonrpc"

"github.com/filecoin-project/venus-market/v2/config"
"github.com/ipfs-force-community/droplet/v2/config"

vCrypto "github.com/filecoin-project/venus/pkg/crypto"
"github.com/filecoin-project/venus/venus-shared/api"
Expand Down
6 changes: 3 additions & 3 deletions api/clients/signer/sign_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

"github.com/ipfs-force-community/metrics"

"github.com/filecoin-project/venus-auth/jwtclient"
"github.com/ipfs-force-community/sophon-auth/jwtclient"

"github.com/filecoin-project/venus-market/v2/config"
"github.com/ipfs-force-community/droplet/v2/config"

vCrypto "github.com/filecoin-project/venus/pkg/crypto"
vTypes "github.com/filecoin-project/venus/venus-shared/types"
Expand Down Expand Up @@ -43,7 +43,7 @@ func NewISignerClient(isServer bool, authClient jwtclient.IAuthClient) func(metr
// Signing through venus chain-service
case config.SignerTypeGateway:
if !isServer {
return nil, fmt.Errorf("signing through the venus-gateway cannot be used for market-client")
return nil, fmt.Errorf("signing through the sophon-gateway cannot be used for droplet-clientt")
}
signer, closer, err = newGatewayWalletClient(mCtx, signerCfg, authClient)
default:
Expand Down
2 changes: 1 addition & 1 deletion api/clients/signer/wallet_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-jsonrpc"

"github.com/filecoin-project/venus-market/v2/config"
"github.com/ipfs-force-community/droplet/v2/config"

vCrypto "github.com/filecoin-project/venus/pkg/crypto"
"github.com/filecoin-project/venus/venus-shared/api"
Expand Down
Loading

0 comments on commit 031305d

Please sign in to comment.