build+routerrpc+lncli: remove routerrpc conditional compilation

This commit is contained in:
Joost Jager 2020-03-30 10:53:49 +02:00
parent e11a3b24d8
commit ffa7bed7f0
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
17 changed files with 8 additions and 65 deletions

@ -17,7 +17,6 @@ run:
- autopilotrpc
- chainrpc
- invoicesrpc
- routerrpc
- signrpc
- walletrpc
- watchtowerrpc

@ -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

@ -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

@ -1,5 +1,3 @@
// +build routerrpc
package main
import (

@ -1,5 +1,3 @@
// +build routerrpc
package main
import (

@ -1,5 +1,3 @@
// +build routerrpc
package main
import (

@ -1,5 +1,3 @@
// +build routerrpc
package main
import (

@ -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,

@ -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
}

@ -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

@ -1,5 +1,3 @@
// +build routerrpc
package routerrpc
import (

@ -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,
}
}

@ -1,5 +1,3 @@
// +build routerrpc
package routerrpc
import (

@ -1,5 +1,3 @@
// +build routerrpc
package routerrpc
import (

@ -1,5 +1,3 @@
// +build routerrpc
package routerrpc
import (

@ -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

@ -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