77 "github.com/filecoin-project/lassie/pkg/aggregateeventrecorder"
88 "github.com/filecoin-project/lassie/pkg/lassie"
99 httpserver "github.com/filecoin-project/lassie/pkg/server/http"
10- "github.com/libp2p/go-libp2p"
11- "github.com/libp2p/go-libp2p/config"
12- "github.com/libp2p/go-libp2p/p2p/net/connmgr"
1310 "github.com/urfave/cli/v2"
1411)
1512
@@ -38,44 +35,16 @@ var daemonFlags = []cli.Flag{
3835 DefaultText : "no limit" ,
3936 EnvVars : []string {"LASSIE_MAX_BLOCKS_PER_REQUEST" },
4037 },
41- & cli.IntFlag {
42- Name : "libp2p-conns-lowwater" ,
43- Aliases : []string {"lw" },
44- Usage : "lower limit of libp2p connections" ,
45- Value : 0 ,
46- DefaultText : "libp2p default" ,
47- EnvVars : []string {"LASSIE_LIBP2P_CONNECTIONS_LOWWATER" },
48- },
49- & cli.IntFlag {
50- Name : "libp2p-conns-highwater" ,
51- Aliases : []string {"hw" },
52- Usage : "upper limit of libp2p connections" ,
53- Value : 0 ,
54- DefaultText : "libp2p default" ,
55- EnvVars : []string {"LASSIE_LIBP2P_CONNECTIONS_HIGHWATER" },
56- },
57- & cli.UintFlag {
58- Name : "concurrent-sp-retrievals" ,
59- Aliases : []string {"cr" },
60- Usage : "max number of simultaneous SP retrievals" ,
61- Value : 0 ,
62- DefaultText : "no limit" ,
63- EnvVars : []string {"LASSIE_CONCURRENT_SP_RETRIEVALS" },
64- },
65- FlagIPNIEndpoint ,
38+ FlagDelegatedRoutingEndpoint ,
6639 FlagEventRecorderAuth ,
6740 FlagEventRecorderInstanceId ,
6841 FlagEventRecorderUrl ,
6942 FlagVerbose ,
7043 FlagVeryVerbose ,
71- FlagProtocols ,
7244 FlagAllowProviders ,
7345 FlagExcludeProviders ,
7446 FlagTempDir ,
75- FlagBitswapConcurrency ,
76- FlagBitswapConcurrencyPerRetrieval ,
7747 FlagGlobalTimeout ,
78- FlagProviderTimeout ,
7948 & cli.StringFlag {
8049 Name : "access-token" ,
8150 Usage : "require HTTP clients to authorize using Bearer scheme and given access token" ,
@@ -96,26 +65,9 @@ var daemonCmd = &cli.Command{
9665// the cli context into the appropriate config objects and then calls the
9766// daemonRun function.
9867func daemonAction (cctx * cli.Context ) error {
99- // lassie config
100- libp2pLowWater := cctx .Int ("libp2p-conns-lowwater" )
101- libp2pHighWater := cctx .Int ("libp2p-conns-highwater" )
102- concurrentSPRetrievals := cctx .Uint ("concurrent-sp-retrievals" )
10368 lassieOpts := []lassie.LassieOption {}
10469
105- if concurrentSPRetrievals > 0 {
106- lassieOpts = append (lassieOpts , lassie .WithConcurrentSPRetrievals (concurrentSPRetrievals ))
107- }
108-
109- libp2pOpts := []config.Option {}
110- if libp2pHighWater != 0 || libp2pLowWater != 0 {
111- connManager , err := connmgr .NewConnManager (libp2pLowWater , libp2pHighWater )
112- if err != nil {
113- return cli .Exit (err , 1 )
114- }
115- libp2pOpts = append (libp2pOpts , libp2p .ConnectionManager (connManager ))
116- }
117-
118- lassieCfg , err := buildLassieConfigFromCLIContext (cctx , lassieOpts , libp2pOpts )
70+ lassieCfg , err := buildLassieConfigFromCLIContext (cctx , lassieOpts )
11971 if err != nil {
12072 return err
12173 }
@@ -167,17 +119,17 @@ func defaultDaemonRun(
167119 httpServerCfg httpserver.HttpServerConfig ,
168120 eventRecorderCfg * aggregateeventrecorder.EventRecorderConfig ,
169121) error {
170- lassie , err := lassie .NewLassieWithConfig (ctx , lassieCfg )
122+ s , err := lassie .NewLassieWithConfig (ctx , lassieCfg )
171123 if err != nil {
172- return nil
124+ return err
173125 }
174126
175127 // create and subscribe an event recorder API if an endpoint URL is set
176128 if eventRecorderCfg .EndpointURL != "" {
177- setupLassieEventRecorder (ctx , eventRecorderCfg , lassie )
129+ setupLassieEventRecorder (ctx , eventRecorderCfg , s )
178130 }
179131
180- httpServer , err := httpserver .NewHttpServer (ctx , lassie , httpServerCfg )
132+ httpServer , err := httpserver .NewHttpServer (ctx , s , httpServerCfg )
181133 if err != nil {
182134 logger .Errorw ("failed to create http server" , "err" , err )
183135 return err
0 commit comments