diff --git a/.golangci.yml b/.golangci.yml index b3289f16..00fc7b27 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -17,7 +17,6 @@ run: - autopilotrpc - chainrpc - invoicesrpc - - routerrpc - signrpc - walletrpc - watchtowerrpc diff --git a/Dockerfile b/Dockerfile index fc61fd83..12c6ece6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apk add --no-cache --update alpine-sdk \ && cd /go/src/github.com/lightningnetwork/lnd \ && git checkout $checkout \ && make \ -&& make install tags="signrpc walletrpc chainrpc invoicesrpc routerrpc" +&& make install tags="signrpc walletrpc chainrpc invoicesrpc" # Start a new, final image. FROM alpine as final diff --git a/build/release/release.sh b/build/release/release.sh index 28236f55..46ce14a8 100755 --- a/build/release/release.sh +++ b/build/release/release.sh @@ -130,8 +130,8 @@ for i in $SYS; do cd $PACKAGE-$i-$TAG echo "Building:" $OS $ARCH $ARM - env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags="-s -w -buildid= $COMMITFLAGS" -tags="autopilotrpc signrpc walletrpc chainrpc invoicesrpc routerrpc watchtowerrpc" github.com/lightningnetwork/lnd/cmd/lnd - env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags="-s -w -buildid= $COMMITFLAGS" -tags="autopilotrpc invoicesrpc walletrpc routerrpc watchtowerrpc" github.com/lightningnetwork/lnd/cmd/lncli + env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags="-s -w -buildid= $COMMITFLAGS" -tags="autopilotrpc signrpc walletrpc chainrpc invoicesrpc watchtowerrpc" github.com/lightningnetwork/lnd/cmd/lnd + env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags="-s -w -buildid= $COMMITFLAGS" -tags="autopilotrpc invoicesrpc walletrpc watchtowerrpc" github.com/lightningnetwork/lnd/cmd/lncli cd .. if [[ $OS = "windows" ]]; then diff --git a/cmd/lncli/cmd_build_route.go b/cmd/lncli/cmd_build_route.go index 685989d4..81c5bfb0 100644 --- a/cmd/lncli/cmd_build_route.go +++ b/cmd/lncli/cmd_build_route.go @@ -1,5 +1,3 @@ -// +build routerrpc - package main import ( diff --git a/cmd/lncli/cmd_query_mission_control.go b/cmd/lncli/cmd_query_mission_control.go index 6071d0a4..93cf71c9 100644 --- a/cmd/lncli/cmd_query_mission_control.go +++ b/cmd/lncli/cmd_query_mission_control.go @@ -1,5 +1,3 @@ -// +build routerrpc - package main import ( diff --git a/cmd/lncli/cmd_query_probability.go b/cmd/lncli/cmd_query_probability.go index 58c8ba1b..4eaa075c 100644 --- a/cmd/lncli/cmd_query_probability.go +++ b/cmd/lncli/cmd_query_probability.go @@ -1,5 +1,3 @@ -// +build routerrpc - package main import ( diff --git a/cmd/lncli/cmd_reset_mission_control.go b/cmd/lncli/cmd_reset_mission_control.go index db37fd4b..b571a9e9 100644 --- a/cmd/lncli/cmd_reset_mission_control.go +++ b/cmd/lncli/cmd_reset_mission_control.go @@ -1,5 +1,3 @@ -// +build routerrpc - package main import ( diff --git a/cmd/lncli/routerrpc_active.go b/cmd/lncli/routerrpc.go similarity index 72% rename from cmd/lncli/routerrpc_active.go rename to cmd/lncli/routerrpc.go index f8903d80..819f66d2 100644 --- a/cmd/lncli/routerrpc_active.go +++ b/cmd/lncli/routerrpc.go @@ -1,10 +1,8 @@ -// +build routerrpc - package main import "github.com/urfave/cli" -// routerCommands will return nil for non-routerrpc builds. +// routerCommands returns a list of routerrpc commands. func routerCommands() []cli.Command { return []cli.Command{ queryMissionControlCommand, diff --git a/cmd/lncli/routerrpc_default.go b/cmd/lncli/routerrpc_default.go deleted file mode 100644 index c2a5fe7b..00000000 --- a/cmd/lncli/routerrpc_default.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build !routerrpc - -package main - -import "github.com/urfave/cli" - -// routerCommands will return nil for non-routerrpc builds. -func routerCommands() []cli.Command { - return nil -} diff --git a/docker/lnd/Dockerfile b/docker/lnd/Dockerfile index 424e2c74..db55ce12 100644 --- a/docker/lnd/Dockerfile +++ b/docker/lnd/Dockerfile @@ -16,7 +16,7 @@ COPY . /go/src/github.com/lightningnetwork/lnd RUN cd /go/src/github.com/lightningnetwork/lnd \ && make \ -&& make install tags="signrpc walletrpc chainrpc invoicesrpc routerrpc" +&& make install tags="signrpc walletrpc chainrpc invoicesrpc" # Start a new, final image to reduce size. FROM alpine as final diff --git a/lnrpc/routerrpc/config_active.go b/lnrpc/routerrpc/config.go similarity index 99% rename from lnrpc/routerrpc/config_active.go rename to lnrpc/routerrpc/config.go index a8393fc6..045561db 100644 --- a/lnrpc/routerrpc/config_active.go +++ b/lnrpc/routerrpc/config.go @@ -1,5 +1,3 @@ -// +build routerrpc - package routerrpc import ( diff --git a/lnrpc/routerrpc/config_default.go b/lnrpc/routerrpc/config_default.go deleted file mode 100644 index 6fcc74a7..00000000 --- a/lnrpc/routerrpc/config_default.go +++ /dev/null @@ -1,28 +0,0 @@ -// +build !routerrpc - -package routerrpc - -import "github.com/lightningnetwork/lnd/routing" - -// Config is the default config struct for the package. When the build tag isn't -// specified, then we output a blank config. -type Config struct{} - -// DefaultConfig defines the config defaults. Without the sub server enabled, -// there are no defaults to set. -func DefaultConfig() *Config { - return &Config{} -} - -// GetRoutingConfig returns the routing config based on this sub server config. -func GetRoutingConfig(cfg *Config) *RoutingConfig { - return &RoutingConfig{ - AprioriHopProbability: routing.DefaultAprioriHopProbability, - AprioriWeight: routing.DefaultAprioriWeight, - MinRouteProbability: routing.DefaultMinRouteProbability, - AttemptCost: routing.DefaultPaymentAttemptPenalty. - ToSatoshis(), - PenaltyHalfLife: routing.DefaultPenaltyHalfLife, - MaxMcHistory: routing.DefaultMaxMcHistory, - } -} diff --git a/lnrpc/routerrpc/driver.go b/lnrpc/routerrpc/driver.go index 05cc0c4b..e174e222 100644 --- a/lnrpc/routerrpc/driver.go +++ b/lnrpc/routerrpc/driver.go @@ -1,5 +1,3 @@ -// +build routerrpc - package routerrpc import ( diff --git a/lnrpc/routerrpc/router_server.go b/lnrpc/routerrpc/router_server.go index 17434699..acdc8da3 100644 --- a/lnrpc/routerrpc/router_server.go +++ b/lnrpc/routerrpc/router_server.go @@ -1,5 +1,3 @@ -// +build routerrpc - package routerrpc import ( diff --git a/lnrpc/routerrpc/subscribe_events.go b/lnrpc/routerrpc/subscribe_events.go index ce65a6c8..4454dbda 100644 --- a/lnrpc/routerrpc/subscribe_events.go +++ b/lnrpc/routerrpc/subscribe_events.go @@ -1,5 +1,3 @@ -// +build routerrpc - package routerrpc import ( diff --git a/make/testing_flags.mk b/make/testing_flags.mk index e4f5661c..aab09bb5 100644 --- a/make/testing_flags.mk +++ b/make/testing_flags.mk @@ -61,6 +61,6 @@ backend = btcd endif # Construct the integration test command with the added build flags. -ITEST_TAGS := $(DEV_TAGS) rpctest chainrpc walletrpc signrpc invoicesrpc autopilotrpc routerrpc watchtowerrpc $(backend) +ITEST_TAGS := $(DEV_TAGS) rpctest chainrpc walletrpc signrpc invoicesrpc autopilotrpc watchtowerrpc $(backend) ITEST := rm lntest/itest/*.log; date; $(GOTEST) -v ./lntest/itest -tags="$(ITEST_TAGS)" $(TEST_FLAGS) -logoutput -goroutinedump diff --git a/mobile/README.md b/mobile/README.md index 077e9498..3a266232 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -53,14 +53,14 @@ Similar to lnd, subservers can be conditionally compiled with the build by setting the tags argument: ``` -make ios tags="routerrpc" +make ios ``` To support subservers that have APIs with name conflicts, pass the "prefix" flag. This will add the subserver name as a prefix to each method name: ``` -make ios tags="routerrpc" prefix=1 +make ios prefix=1 ``` ### API docs