Skip to content

Commit

Permalink
proxy example usedirect graph gateway backend
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Mar 7, 2024
1 parent 2aeb7b7 commit c47b8ba
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions examples/gateway/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import (
"net/http"
"strconv"

"github.com/ipfs/boxo/blockservice"
"github.com/ipfs/boxo/examples/gateway/common"
"github.com/ipfs/boxo/exchange/offline"
"github.com/ipfs/boxo/gateway"
)

Expand Down Expand Up @@ -37,14 +35,11 @@ func main() {
log.Fatal(err)
}

// Sets up the exchange, which will proxy the block requests to the given gateway.
blockService := blockservice.New(blockStore, offline.Exchange(blockStore))

// Sets up the routing system, which will proxy the IPNS routing requests to the given gateway.
routing := newProxyRouting(*gatewayUrlPtr, nil)

// Creates the gateway with the block service and the routing.
backend, err := gateway.NewBlocksBackend(blockService, gateway.WithValueStore(routing))
backend, err := gateway.NewGraphGatewayBackend(blockStore, gateway.WithValueStore(routing))
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit c47b8ba

Please sign in to comment.