Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check market protocol before making boost deal #843

Merged
merged 4 commits into from
Sep 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/boost/deal_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ func dealCmdAction(cctx *cli.Context, isOnline bool) error {
return fmt.Errorf("failed to connect to peer %s: %w", addrInfo.ID, err)
}

x, err := n.Host.Peerstore().FirstSupportedProtocol(addrInfo.ID, DealProtocolv120)
if err != nil {
return fmt.Errorf("getting protocols for peer %s: %w", addrInfo.ID, err)
}

if len(x) == 0 {
return fmt.Errorf("boost client cannot make a deal with storage provider because it does not support protocol version 1.2.0")
}

dealUuid := uuid.New()

commp := cctx.String("commp")
Expand Down