Skip to content

booster-http #574

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

Merged
merged 7 commits into from
Jun 17, 2022
Merged
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
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ boost: $(BUILD_DEPS)
.PHONY: boost
BINS+=boost boostx boostd

booster-http: $(BUILD_DEPS)
rm -f booster-http
$(GOCC) build $(GOFLAGS) -o booster-http ./cmd/booster-http
.PHONY: booster-http
BINS+=booster-http

devnet: $(BUILD_DEPS)
rm -f devnet
$(GOCC) build $(GOFLAGS) -o devnet ./cmd/devnet
Expand Down
6 changes: 4 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/multiformats/go-multihash"
)

// MODIFYING THE API INTERFACE
Expand Down Expand Up @@ -43,8 +44,8 @@ type Boost interface {
BoostDagstoreInitializeAll(ctx context.Context, params DagstoreInitializeAllParams) (<-chan DagstoreInitializeAllEvent, error) //perm:admin
BoostDagstoreRecoverShard(ctx context.Context, key string) error //perm:admin
BoostDagstoreGC(ctx context.Context) ([]DagstoreShardResult, error) //perm:admin

BoostDagstoreListShards(ctx context.Context) ([]DagstoreShardInfo, error) //perm:read
BoostDagstorePiecesContainingMultihash(ctx context.Context, mh multihash.Multihash) ([]cid.Cid, error) //perm:read
BoostDagstoreListShards(ctx context.Context) ([]DagstoreShardInfo, error) //perm:read

// RuntimeSubsystems returns the subsystems that are enabled
// in this instance.
Expand All @@ -67,6 +68,7 @@ type Boost interface {
PiecesListCidInfos(ctx context.Context) ([]cid.Cid, error) //perm:read
PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) //perm:read
PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) //perm:read
PiecesGetMaxOffset(ctx context.Context, pieceCid cid.Cid) (uint64, error) //perm:read

// MethodGroup: Actor
ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error) //perm:read
Expand Down
27 changes: 27 additions & 0 deletions api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/openrpc/boost.json.gz
Binary file not shown.
4 changes: 4 additions & 0 deletions cmd/boostd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ var runCmd = &cli.Command{
Name: "pprof",
Usage: "run pprof web server on localhost:6060",
},
&cli.BoolFlag{
Name: "nosync",
Usage: "dont wait for the full node to sync with the chain",
},
},
Action: func(cctx *cli.Context) error {
if cctx.Bool("pprof") {
Expand Down
42 changes: 42 additions & 0 deletions cmd/booster-http/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package main

import (
"os"

"github.com/filecoin-project/boost/build"
cliutil "github.com/filecoin-project/boost/cli/util"
logging "github.com/ipfs/go-log/v2"
"github.com/urfave/cli/v2"
)

var log = logging.Logger("booster")

func main() {
app := &cli.App{
Name: "booster-http",
Usage: "HTTP endpoint for retrieval from Filecoin",
EnableBashCompletion: true,
Version: build.UserVersion(),
Flags: []cli.Flag{
cliutil.FlagVeryVerbose,
},
Commands: []*cli.Command{
runCmd,
},
}
app.Setup()

if err := app.Run(os.Args); err != nil {
os.Stderr.WriteString("Error: " + err.Error() + "\n")
}
}

func before(cctx *cli.Context) error {
_ = logging.SetLogLevel("booster", "INFO")

if cliutil.IsVeryVerbose {
_ = logging.SetLogLevel("booster", "DEBUG")
}

return nil
}
Loading