mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 08:28:02 -05:00
Co-authored-by: colinlyguo <102356659+colinlyguo@users.noreply.github.com> Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
50 lines
1.0 KiB
Go
50 lines
1.0 KiB
Go
package app
|
|
|
|
import "github.com/urfave/cli/v2"
|
|
|
|
var (
|
|
apiFlags = []cli.Flag{
|
|
// http flags
|
|
&httpEnabledFlag,
|
|
&httpListenAddrFlag,
|
|
&httpPortFlag,
|
|
// ws flags
|
|
&wsEnabledFlag,
|
|
&wsListenAddrFlag,
|
|
&wsPortFlag,
|
|
}
|
|
// httpEnabledFlag enable rpc server.
|
|
httpEnabledFlag = cli.BoolFlag{
|
|
Name: "http",
|
|
Usage: "Enable the HTTP-RPC server",
|
|
Value: false,
|
|
}
|
|
// httpListenAddrFlag set the http address.
|
|
httpListenAddrFlag = cli.StringFlag{
|
|
Name: "http.addr",
|
|
Usage: "HTTP-RPC server listening interface",
|
|
Value: "localhost",
|
|
}
|
|
// httpPortFlag set http.port.
|
|
httpPortFlag = cli.IntFlag{
|
|
Name: "http.port",
|
|
Usage: "HTTP-RPC server listening port",
|
|
Value: 8390,
|
|
}
|
|
wsEnabledFlag = cli.BoolFlag{
|
|
Name: "ws",
|
|
Usage: "Enable the WS-RPC server",
|
|
}
|
|
wsListenAddrFlag = cli.StringFlag{
|
|
Name: "ws.addr",
|
|
Usage: "WS-RPC server listening interface",
|
|
Value: "localhost",
|
|
}
|
|
// websocket port
|
|
wsPortFlag = cli.IntFlag{
|
|
Name: "ws.port",
|
|
Usage: "WS-RPC server listening port",
|
|
Value: 8391,
|
|
}
|
|
)
|