Skip to content

310 itest wo docker #1

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
17 changes: 13 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,28 @@ jobs:
command: |
make lotus-images

- run: make itest-poc1
- run: make itest-poc2js
# - run: make itest-poc1
# - run: make itest-poc2js
#
# - run: docker build -t consensys/fc-retrieval/itest -f itest/Dockerfile .

- run: docker build -t consensys/fc-retrieval/itest -f itest/Dockerfile .
## debugging
- run: docker build -t consensys/fc-retrieval/gateway -f gateway/Dockerfile .
- run: docker build -t consensys/fc-retrieval/provider -f provider/Dockerfile .
- run: docker build -t consensys/fc-retrieval/register -f register/Dockerfile .

- run: sudo sh -c 'cat itest/.hosts >> /etc/hosts'
- run: cat /etc/hosts
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/lotus-full-node
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/client-gateway
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/client-init
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/provider-admin
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/poc1
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/poc2_group_offer
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/poc2_new_gateway
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/poc2_dht_offer
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/poc2_dht_offer_ack
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/poc2_dht_offer_new_gateway
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/poc2_new_gateway
- run: cd itest; go test -p 1 -count=1 -v github.com/ConsenSys/fc-retrieval/itest/pkg/poc2js

- run:
Expand Down
8 changes: 8 additions & 0 deletions client/pkg/api/clientapi/client_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type Client struct {

type ClientApi interface {
RequestDHTOfferDiscover(
clientApiEndpoint string,
gatewayInfo register.GatewayRegistrar,
gatewayIDs []nodeid.NodeID,
contentID *cid.ContentID,
Expand All @@ -25,6 +26,7 @@ type ClientApi interface {
) ([]GatewaySubOffers, error)

RequestDHTDiscover(
clientApiEndpoint string,
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand All @@ -36,6 +38,7 @@ type ClientApi interface {
) ([]nodeid.NodeID, []fcrmessages.FCRMessage, []nodeid.NodeID, error)

RequestDHTDiscoverV2(
clientApiEndpoint string,
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand All @@ -47,19 +50,22 @@ type ClientApi interface {
) ([]nodeid.NodeID, []fcrmessages.FCRMessage, []nodeid.NodeID, bool, string, error)

RequestDHTOfferAck(
clientApiEndpoint string,
providerInfo register.ProviderRegistrar,
contentID *cid.ContentID,
gatewayID *nodeid.NodeID,
) (bool, *fcrmessages.FCRMessage, *fcrmessages.FCRMessage, error)

RequestEstablishment(
clientApiEndpoint string,
gatewayInfo register.GatewayRegistrar,
challenge []byte,
clientID *nodeid.NodeID,
ttl int64,
) error

RequestStandardDiscoverOffer(
clientApiEndpoint string,
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand All @@ -70,6 +76,7 @@ type ClientApi interface {
) ([]cidoffer.SubCIDOffer, error)

RequestStandardDiscover(
clientApiEndpoint string,
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand All @@ -79,6 +86,7 @@ type ClientApi interface {
) ([]cidoffer.SubCIDOffer, error)

RequestStandardDiscoverV2(
clientApiEndpoint string,
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand Down
3 changes: 2 additions & 1 deletion client/pkg/api/clientapi/dht_discover_offer_requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type GatewaySubOffers struct {
}

func (c *Client) RequestDHTOfferDiscover(
clientApiEndpoint string,
gatewayRegistrar register.GatewayRegistrar,
gatewayIDs []nodeid.NodeID,
contentID *cid.ContentID,
Expand All @@ -54,7 +55,7 @@ func (c *Client) RequestDHTOfferDiscover(
}

// Send request and get response
response, err := c.httpCommunicator.SendMessage(gatewayRegistrar.GetNetworkInfoClient(), request)
response, err := c.httpCommunicator.SendMessage(clientApiEndpoint, request)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion client/pkg/api/clientapi/dht_discover_requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

// RequestDHTDiscover requests a dht discover to a given gateway for a given contentID, nonce and ttl.
func (c *Client) RequestDHTDiscover(
clientApiEndpoint string,
gatewayRegistrar register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand All @@ -45,7 +46,7 @@ func (c *Client) RequestDHTDiscover(
}

// Send request and get response
response, err := c.httpCommunicator.SendMessage(gatewayRegistrar.GetNetworkInfoClient(), request)
response, err := c.httpCommunicator.SendMessage(clientApiEndpoint, request)
if err != nil {
return nil, nil, nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion client/pkg/api/clientapi/dht_discover_requester_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

// RequestDHTDiscoverV2 requests a dht discover to a given gateway for a given contentID, nonce and ttl.
func (c *Client) RequestDHTDiscoverV2(
clientApiEndpoint string,
gatewayRegistrar register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand All @@ -42,7 +43,7 @@ func (c *Client) RequestDHTDiscoverV2(
}

// Send request and get response
response, err := c.httpCommunicator.SendMessage(gatewayRegistrar.GetNetworkInfoClient(), request)
response, err := c.httpCommunicator.SendMessage(clientApiEndpoint, request)
if err != nil {
return nil, nil, nil, false, "", fmt.Errorf("error sending DHT discover message to gateway ID: %s, error: %s", gatewayRegistrar.GetNodeID(), err.Error())
}
Expand Down
3 changes: 2 additions & 1 deletion client/pkg/api/clientapi/dht_offer_ack_requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

// RequestDHTOfferAck requests a dht offer ack to a given provider for a pair of cid and gateway id
func (c *Client) RequestDHTOfferAck(
clientApiEndpoint string,
gatewayRegistrar register.ProviderRegistrar,
contentID *cid.ContentID,
gatewayID *nodeid.NodeID,
Expand All @@ -39,7 +40,7 @@ func (c *Client) RequestDHTOfferAck(
}

// Send request and get response
response, err := c.httpCommunicator.SendMessage(gatewayRegistrar.GetNetworkInfoClient(), request)
response, err := c.httpCommunicator.SendMessage(clientApiEndpoint, request)
if err != nil {
return false, nil, nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion client/pkg/api/clientapi/establishment_requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

// RequestEstablishment requests an establishment to a given gateway for a given challenge, client id and ttl.
func (c *Client) RequestEstablishment(
clientApiEndpoint string,
gatewayRegistrar register.GatewayRegistrar,
challenge []byte,
clientID *nodeid.NodeID,
Expand All @@ -45,7 +46,7 @@ func (c *Client) RequestEstablishment(
return err
}

response, err := c.httpCommunicator.SendMessage(gatewayRegistrar.GetNetworkInfoClient(), request)
response, err := c.httpCommunicator.SendMessage(clientApiEndpoint, request)
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

// RequestStandardDiscoverOffer requests a standard discover to a given gateway for a given contentID, nonce and ttl.
func (c *Client) RequestStandardDiscoverOffer(
clientApiEndpoint string,
gatewayRegistrar register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand All @@ -44,7 +45,7 @@ func (c *Client) RequestStandardDiscoverOffer(
}

// Send request and get response
response, err := c.httpCommunicator.SendMessage(gatewayRegistrar.GetNetworkInfoClient(), request)
response, err := c.httpCommunicator.SendMessage(clientApiEndpoint, request)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion client/pkg/api/clientapi/standard_discover_requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

// RequestStandardDiscover requests a standard discover to a given gateway for a given contentID, nonce and ttl.
func (c *Client) RequestStandardDiscover(
clientApiEndpoint string,
gatewayRegistrar register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand All @@ -42,7 +43,7 @@ func (c *Client) RequestStandardDiscover(
}

// Send request and get response
response, err := c.httpCommunicator.SendMessage(gatewayRegistrar.GetNetworkInfoClient(), request)
response, err := c.httpCommunicator.SendMessage(clientApiEndpoint, request)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion client/pkg/api/clientapi/standard_discover_requester_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

// RequestStandardDiscoverV2 requests a standard discover to a given gateway for a given contentID, nonce and ttl.
func (c *Client) RequestStandardDiscoverV2(
clientApiEndpoint string,
gatewayRegistrar register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
Expand All @@ -41,7 +42,7 @@ func (c *Client) RequestStandardDiscoverV2(
}

// Send request and get response
response, err := c.httpCommunicator.SendMessage(gatewayRegistrar.GetNetworkInfoClient(), request)
response, err := c.httpCommunicator.SendMessage(clientApiEndpoint, request)
if err != nil {
return nil, false, "", fmt.Errorf("error sending message to gateway ID: %s, error: %s", gatewayRegistrar.GetNodeID(), err.Error())
}
Expand Down
32 changes: 16 additions & 16 deletions client/pkg/fcrclient/filecoin_retrieval_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (c *FilecoinRetrievalClient) GetGatewaysToUse() []*nodeid.NodeID {

// AddActiveGateways adds one or more gateways to active gateway map.
// Returns the number of gateways added.
func (c *FilecoinRetrievalClient) AddActiveGateways(gwNodeIDs []*nodeid.NodeID) int {
func (c *FilecoinRetrievalClient) AddActiveGateways(clientApiEndpoint string, gwNodeIDs []*nodeid.NodeID) int {
numAdded := 0
for _, gwToAddID := range gwNodeIDs {
c.ActiveGatewaysLock.RLock()
Expand All @@ -230,7 +230,7 @@ func (c *FilecoinRetrievalClient) AddActiveGateways(gwNodeIDs []*nodeid.NodeID)
challenge := make([]byte, 32)
rand.Read(challenge)
ttl := time.Now().Unix() + c.Settings.EstablishmentTTL()
err := c.clientApi.RequestEstablishment(gatewayRegistrar, challenge, c.Settings.ClientID(), ttl)
err := c.clientApi.RequestEstablishment(clientApiEndpoint, gatewayRegistrar, challenge, c.Settings.ClientID(), ttl)
if err != nil {
logging.Error("Error in initial establishment: %v", err.Error())
continue
Expand Down Expand Up @@ -291,7 +291,7 @@ func (c *FilecoinRetrievalClient) GetActiveGateways() []*nodeid.NodeID {
}

// FindOffersStandardDiscovery finds offer using standard discovery from given gateways
func (c *FilecoinRetrievalClient) FindOffersStandardDiscovery(contentID *cid.ContentID, gatewayID *nodeid.NodeID) ([]cidoffer.SubCIDOffer, error) {
func (c *FilecoinRetrievalClient) FindOffersStandardDiscovery(clientApiEndpoint string, contentID *cid.ContentID, gatewayID *nodeid.NodeID) ([]cidoffer.SubCIDOffer, error) {
c.ActiveGatewaysLock.RLock()
defer c.ActiveGatewaysLock.RUnlock()

Expand All @@ -300,7 +300,7 @@ func (c *FilecoinRetrievalClient) FindOffersStandardDiscovery(contentID *cid.Con
return make([]cidoffer.SubCIDOffer, 0), errors.New("given gatewayID is not in active nodes map")
}
// TODO need to do nonce management
offers, err := c.clientApi.RequestStandardDiscover(gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), "", "")
offers, err := c.clientApi.RequestStandardDiscover(clientApiEndpoint, gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), "", "")
if err != nil {
logging.Warn("GatewayStdDiscovery error. Gateway: %s, Error: %s", gw.GetNodeID(), err)
return make([]cidoffer.SubCIDOffer, 0), errors.New("error in requesting standard discovery")
Expand Down Expand Up @@ -340,7 +340,7 @@ func (c *FilecoinRetrievalClient) FindOffersStandardDiscovery(contentID *cid.Con
}

// FindOffersDHTDiscovery finds offer using dht discovery from given gateways
func (c *FilecoinRetrievalClient) FindOffersDHTDiscovery(contentID *cid.ContentID, gatewayID *nodeid.NodeID, numDHT int64) (map[string]*[]cidoffer.SubCIDOffer, error) {
func (c *FilecoinRetrievalClient) FindOffersDHTDiscovery(clientApiEndpoint string, contentID *cid.ContentID, gatewayID *nodeid.NodeID, numDHT int64) (map[string]*[]cidoffer.SubCIDOffer, error) {
c.ActiveGatewaysLock.RLock()
defer c.ActiveGatewaysLock.RUnlock()

Expand All @@ -351,7 +351,7 @@ func (c *FilecoinRetrievalClient) FindOffersDHTDiscovery(contentID *cid.ContentI
return offersMap, errors.New("given gatewayID is not in active nodes map")
}
// TODO need to do nonce management
contacted, contactedResp, uncontactable, err := c.clientApi.RequestDHTDiscover(gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), numDHT, false, "", "")
contacted, contactedResp, uncontactable, err := c.clientApi.RequestDHTDiscover(clientApiEndpoint, gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), numDHT, false, "", "")
if err != nil {
logging.Warn("GatewayDHTDiscovery error. Gateway: %s, Error: %s", gw.GetNodeID(), err)
return offersMap, errors.New("error in requesting dht discovery")
Expand Down Expand Up @@ -428,7 +428,7 @@ func (c *FilecoinRetrievalClient) FindOffersDHTDiscovery(contentID *cid.ContentI

// FindOffersDHTDiscoveryV2 finds offer using dht discovery from given gateway with maximum number of offers
// offersNumberLimit - maximum number of offers the client asking to have
func (c *FilecoinRetrievalClient) FindOffersDHTDiscoveryV2(contentID *cid.ContentID, gatewayID *nodeid.NodeID, numDHT int64, offersNumberLimit int) (map[string]*[]cidoffer.SubCIDOffer, error) {
func (c *FilecoinRetrievalClient) FindOffersDHTDiscoveryV2(clientApiEndpoint string, contentID *cid.ContentID, gatewayID *nodeid.NodeID, numDHT int64, offersNumberLimit int) (map[string]*[]cidoffer.SubCIDOffer, error) {
offersMap := make(map[string]*[]cidoffer.SubCIDOffer)

c.ActiveGatewaysLock.RLock()
Expand Down Expand Up @@ -456,7 +456,7 @@ func (c *FilecoinRetrievalClient) FindOffersDHTDiscoveryV2(contentID *cid.Conten
// TODO need to do nonce management
nonce := rand.Int63()
ttl := time.Now().Unix() + c.Settings.EstablishmentTTL()
contactedGateways, contactedResp, uncontactable, paymentRequired, paymentChannel, discoverErr := c.clientApi.RequestDHTDiscoverV2(entryGateway, contentID, nonce, ttl, numDHT, false, paymentChannel, voucher)
contactedGateways, contactedResp, uncontactable, paymentRequired, paymentChannel, discoverErr := c.clientApi.RequestDHTDiscoverV2(clientApiEndpoint, entryGateway, contentID, nonce, ttl, numDHT, false, paymentChannel, voucher)
if discoverErr != nil {
logging.Warn("GatewayDHTDiscovery error. Gateway: %s, Error: %s", entryGateway.GetNodeID(), discoverErr)
return nil, fmt.Errorf("error in requesting dht discovery: %s", discoverErr.Error())
Expand All @@ -467,7 +467,7 @@ func (c *FilecoinRetrievalClient) FindOffersDHTDiscoveryV2(contentID *cid.Conten
return nil, fmt.Errorf("topup error while requesting DHT discovery: %s", err.Error())
}
// retry
contactedGateways, contactedResp, uncontactable, paymentRequired, paymentChannel, discoverErr = c.clientApi.RequestDHTDiscoverV2(entryGateway, contentID, nonce, ttl, numDHT, false, paymentChannel, voucher)
contactedGateways, contactedResp, uncontactable, paymentRequired, paymentChannel, discoverErr = c.clientApi.RequestDHTDiscoverV2(clientApiEndpoint, entryGateway, contentID, nonce, ttl, numDHT, false, paymentChannel, voucher)
if discoverErr != nil {
logging.Warn("gateway DHT discovery problem; gateway: %s, error: %s", entryGateway.GetNodeID(), discoverErr)
return nil, fmt.Errorf("error in requesting dht discovery: %s", discoverErr.Error())
Expand Down Expand Up @@ -551,7 +551,7 @@ func (c *FilecoinRetrievalClient) FindOffersDHTDiscoveryV2(contentID *cid.Conten
}
logging.Info("Successful initial payment for DHT offers discovery, payment channel: %s, voucher: %s", paymentChannel, voucher)

allGatewaysOffers, discoverError := c.clientApi.RequestDHTOfferDiscover(entryGateway, contactedGateways, contentID, nonce, offersDigestsFromAllGateways, paymentChannel, voucher)
allGatewaysOffers, discoverError := c.clientApi.RequestDHTOfferDiscover(clientApiEndpoint, entryGateway, contactedGateways, contentID, nonce, offersDigestsFromAllGateways, paymentChannel, voucher)
if discoverError != nil {
return nil, fmt.Errorf("error getting sub-offers from their digests: %s", discoverError)
}
Expand All @@ -563,7 +563,7 @@ func (c *FilecoinRetrievalClient) FindOffersDHTDiscoveryV2(contentID *cid.Conten
}

// FindDHTOfferAck finds offer ack for a cid, gateway pair
func (c *FilecoinRetrievalClient) FindDHTOfferAck(contentID *cid.ContentID, gatewayID *nodeid.NodeID, providerID *nodeid.NodeID) (bool, error) {
func (c *FilecoinRetrievalClient) FindDHTOfferAck(clientApiEndpoint string, contentID *cid.ContentID, gatewayID *nodeid.NodeID, providerID *nodeid.NodeID) (bool, error) {
provider := c.registerMgr.GetProvider(providerID)
if provider == nil {
logging.Error("Error getting registered provider %v", providerID)
Expand All @@ -574,7 +574,7 @@ func (c *FilecoinRetrievalClient) FindDHTOfferAck(contentID *cid.ContentID, gate
return false, errors.New("invalid register info")
}

found, request, ack, err := c.clientApi.RequestDHTOfferAck(provider, contentID, gatewayID)
found, request, ack, err := c.clientApi.RequestDHTOfferAck(clientApiEndpoint, provider, contentID, gatewayID)
if err != nil {
return false, err
}
Expand Down Expand Up @@ -644,7 +644,7 @@ func (c *FilecoinRetrievalClient) FindDHTOfferAck(contentID *cid.ContentID, gate
}

// FindOffersStandardDiscoveryV2 finds offer using standard discovery from given gateways
func (c *FilecoinRetrievalClient) FindOffersStandardDiscoveryV2(contentID *cid.ContentID, gatewayID *nodeid.NodeID, maxOffers int) ([]cidoffer.SubCIDOffer, error) {
func (c *FilecoinRetrievalClient) FindOffersStandardDiscoveryV2(clientApiEndpoint string, contentID *cid.ContentID, gatewayID *nodeid.NodeID, maxOffers int) ([]cidoffer.SubCIDOffer, error) {
c.ActiveGatewaysLock.RLock()
defer c.ActiveGatewaysLock.RUnlock()

Expand Down Expand Up @@ -673,7 +673,7 @@ func (c *FilecoinRetrievalClient) FindOffersStandardDiscoveryV2(contentID *cid.C

// It pays for the first request to get a list of offer digests.
// TODO need to do nonce management
offerDigests, paymentRequired, _, discoverErr := c.clientApi.RequestStandardDiscoverV2(gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), paychAddr, voucher)
offerDigests, paymentRequired, _, discoverErr := c.clientApi.RequestStandardDiscoverV2(clientApiEndpoint, gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), paychAddr, voucher)
if discoverErr != nil {
return make([]cidoffer.SubCIDOffer, 0), fmt.Errorf("error getting offer from gateway: %s; error: %s", gw.GetNodeID(), discoverErr.Error())
}
Expand All @@ -683,7 +683,7 @@ func (c *FilecoinRetrievalClient) FindOffersStandardDiscoveryV2(contentID *cid.C
return nil, fmt.Errorf("topup error while requesting standard discovery: %s", err.Error())
}
// retry
offerDigests, paymentRequired, _, err = c.clientApi.RequestStandardDiscoverV2(gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), paychAddr, voucher)
offerDigests, paymentRequired, _, err = c.clientApi.RequestStandardDiscoverV2(clientApiEndpoint, gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), paychAddr, voucher)
if err != nil {
return make([]cidoffer.SubCIDOffer, 0), fmt.Errorf("error getting offer from gateway: %s; error: %s", gw.GetNodeID(), err.Error())
}
Expand Down Expand Up @@ -718,7 +718,7 @@ func (c *FilecoinRetrievalClient) FindOffersStandardDiscoveryV2(contentID *cid.C
}
}

offers, err := c.clientApi.RequestStandardDiscoverOffer(gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), offerDigests, paychAddr, voucher)
offers, err := c.clientApi.RequestStandardDiscoverOffer(clientApiEndpoint, gw, contentID, rand.Int63(), time.Now().Unix()+c.Settings.EstablishmentTTL(), offerDigests, paychAddr, voucher)

var validOffers []cidoffer.SubCIDOffer
// Verify the offer one by one
Expand Down
Loading