From 33df4a1698c8c5d45e9ecdba794ae54c5f20029a Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 21 Jul 2020 22:06:15 +0200 Subject: [PATCH 1/2] multi: rename golang and make files to lightning-terminal --- .dockerignore | 2 +- .gitignore | 4 +-- Dockerfile | 14 ++++----- Makefile | 18 ++++++------ cmd/{shushtar => lightning-terminal}/main.go | 6 ++-- config.go | 8 +++--- go.mod | 2 +- go.sum | 9 ++++++ gzip.go | 2 +- log.go | 4 +-- release.sh | 6 ++-- subserver_permissions.go | 2 +- shushtar.go => terminal.go | 30 ++++++++++---------- 13 files changed, 58 insertions(+), 49 deletions(-) rename cmd/{shushtar => lightning-terminal}/main.go (64%) rename shushtar.go => terminal.go (95%) diff --git a/.dockerignore b/.dockerignore index 2fa5179bf..93b6e28c9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ app/build app/coverage app/node_modules -shushtar-debug +lightning-terminal-debug diff --git a/.gitignore b/.gitignore index 8b80c5657..046c85cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ https.key # local environment vars to ignore .env*.local -shushtar-debug -/shushtar-* +lightning-terminal-debug +/lightning-terminal-* # go code generated by statik /statik/statik.go diff --git a/Dockerfile b/Dockerfile index d6350709a..f634566bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM golang:1.13-alpine as builder # Copy in the local repository to build from. -COPY . /go/src/github.com/lightninglabs/shushtar +COPY . /go/src/github.com/lightninglabs/lightning-terminal # Force Go to use the cgo based DNS resolver. This is required to ensure DNS # queries required to connect to linked containers succeed. @@ -12,7 +12,7 @@ ENV GO111MODULE on ENV NODE_VERSION=v12.17.0 -# Install dependencies and install/build shushtar. +# Install dependencies and install/build lightning-terminal. RUN apk add --no-cache --update alpine-sdk \ git \ make \ @@ -27,7 +27,7 @@ RUN apk add --no-cache --update alpine-sdk \ && curl -o- -L https://yarnpkg.com/install.sh | bash \ && /bin/bash \ && . ~/.bashrc \ -&& cd /go/src/github.com/lightninglabs/shushtar \ +&& cd /go/src/github.com/lightninglabs/lightning-terminal \ && make install \ && go install -v -trimpath github.com/lightningnetwork/lnd/cmd/lncli \ && go install -v -trimpath github.com/lightninglabs/faraday/cmd/frcli \ @@ -39,11 +39,11 @@ FROM alpine as final # Define a root volume for data persistence. VOLUME /root/.lnd -# Expose shushtar and lnd ports (server, rpc). +# Expose lightning-terminal and lnd ports (server, rpc). EXPOSE 8443 10009 9735 # Copy the binaries and entrypoint from the builder image. -COPY --from=builder /go/bin/shushtar /bin/ +COPY --from=builder /go/bin/lightning-terminal /bin/ COPY --from=builder /go/bin/lncli /bin/ COPY --from=builder /go/bin/frcli /bin/ COPY --from=builder /go/bin/loop /bin/ @@ -54,5 +54,5 @@ RUN apk add --no-cache \ jq \ ca-certificates -# Specify the start command and entrypoint as the shushtar daemon. -ENTRYPOINT ["shushtar"] +# Specify the start command and entrypoint as the lightning-terminal daemon. +ENTRYPOINT ["lightning-terminal"] diff --git a/Makefile b/Makefile index f8f132c99..abbda0618 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -PKG := github.com/lightninglabs/shushtar -ESCPKG := github.com\/lightninglabs\/shushtar +PKG := github.com/lightninglabs/lightning-terminal +ESCPKG := github.com\/lightninglabs\/lightning-terminal LND_PKG := github.com/lightningnetwork/lnd LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint @@ -41,7 +41,7 @@ include make/release_flags.mk # We only return the part inside the double quote here to avoid escape issues # when calling the external release script. The second parameter can be used to # add additional ldflags if needed (currently only used for the release). -make_ldflags = $(2) -X $(LND_PKG)/build.Commit=shushtar-$(COMMIT) \ +make_ldflags = $(2) -X $(LND_PKG)/build.Commit=lightning-terminal-$(COMMIT) \ -X $(LND_PKG)/build.CommitHash=$(COMMIT_HASH) \ -X $(LND_PKG)/build.GoVersion=$(GOVERSION) \ -X $(LND_PKG)/build.RawTags=$(shell echo $(1) | sed -e 's/ /,/g') @@ -97,19 +97,19 @@ build: statik-build go-build install: statik-build go-install go-build: - @$(call print, "Building shushtar.") - $(GOBUILD) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" -o shushtar-debug $(PKG)/cmd/shushtar + @$(call print, "Building lightning-terminal.") + $(GOBUILD) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" -o lightning-terminal-debug $(PKG)/cmd/lightning-terminal go-install: - @$(call print, "Installing shushtar.") - $(GOINSTALL) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/shushtar + @$(call print, "Installing lightning-terminal.") + $(GOINSTALL) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/lightning-terminal app-build: yarn-install @$(call print, "Building production app.") cd app; yarn build release: statik-build - @$(call print, "Creating release of shushtar.") + @$(call print, "Creating release of lightning-terminal.") ./release.sh build-release "$(VERSION_TAG)" "$(BUILD_SYSTEM)" "$(LND_RELEASE_TAGS)" "$(RELEASE_LDFLAGS)" scratch: build @@ -179,6 +179,6 @@ list: clean: @$(call print, "Cleaning source.$(NC)") - $(RM) ./shushtar-debug + $(RM) ./lightning-terminal-debug $(RM) coverage.txt $(RM) -r statik diff --git a/cmd/shushtar/main.go b/cmd/lightning-terminal/main.go similarity index 64% rename from cmd/shushtar/main.go rename to cmd/lightning-terminal/main.go index f01f1539f..665a96f62 100644 --- a/cmd/shushtar/main.go +++ b/cmd/lightning-terminal/main.go @@ -5,12 +5,12 @@ import ( "os" "github.com/jessevdk/go-flags" - "github.com/lightninglabs/shushtar" + "github.com/lightninglabs/lightning-terminal" ) -// main starts the shushtar application. +// main starts the lightning-terminal application. func main() { - err := shushtar.New().Run() + err := terminal.New().Run() if e, ok := err.(*flags.Error); err != nil && (!ok || e.Type != flags.ErrHelp) { diff --git a/config.go b/config.go index e3fc162e1..add47bc7c 100644 --- a/config.go +++ b/config.go @@ -1,4 +1,4 @@ -package shushtar +package terminal import ( "crypto/tls" @@ -36,9 +36,9 @@ var ( defaultLetsEncryptDir = "letsencrypt" ) -// Config is the main configuration struct of shushtar. It contains all config -// items of its enveloping subservers, each prefixed with their daemon's short -// name. +// Config is the main configuration struct of lightning-terminal. It contains +// all config items of its enveloping subservers, each prefixed with their +// daemon's short name. type Config struct { HTTPSListen string `long:"httpslisten" description:"host:port to listen for incoming HTTP/2 connections on"` UIPassword string `long:"uipassword" description:"the password that must be entered when using the loop UI. use a strong password to protect your node from unauthorized access through the web UI"` diff --git a/go.mod b/go.mod index fb641678c..eb3f39c27 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/lightninglabs/shushtar +module github.com/lightninglabs/lightning-terminal require ( github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f diff --git a/go.sum b/go.sum index d197d91ee..003c593eb 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= git.schwanenlied.me/yawning/bsaes.git v0.0.0-20180720073208-c0276d75487e h1:F2x1bq7RaNCIuqYpswggh1+c1JmwdnkHNC9wy1KDip0= git.schwanenlied.me/yawning/bsaes.git v0.0.0-20180720073208-c0276d75487e/go.mod h1:BWqTsj8PgcPriQJGl7el20J/7TuT1d/hSyFDXMEpoEo= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= @@ -19,6 +20,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -86,6 +88,7 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= @@ -136,6 +139,7 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.8.6/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.14.3 h1:OCJlWkOUoTnl0neNGlf4fUm3TmbEtguw7vR+nGtnDjY= github.com/grpc-ecosystem/grpc-gateway v1.14.3/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0= +github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/improbable-eng/grpc-web v0.12.0 h1:GlCS+lMZzIkfouf7CNqY+qqpowdKuJLSLLcKVfM1oLc= @@ -320,6 +324,7 @@ golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -329,6 +334,7 @@ golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -371,14 +377,17 @@ google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922/go.mod h1:L3J43x8/ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c h1:hrpEMCZ2O7DR5gC1n2AJGVhrwiEjOi35+jxtIuZpTMo= google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/gzip.go b/gzip.go index 09e537f89..7bd1a6a38 100644 --- a/gzip.go +++ b/gzip.go @@ -1,4 +1,4 @@ -package shushtar +package terminal import ( "compress/gzip" diff --git a/log.go b/log.go index 14576ed4b..4b182f6df 100644 --- a/log.go +++ b/log.go @@ -1,4 +1,4 @@ -package shushtar +package terminal import ( "github.com/btcsuite/btclog" @@ -26,7 +26,7 @@ var ( const ( // Subsystem defines the logging code for this subsystem. - Subsystem = "GRUB" + Subsystem = "LITD" // GrpcLogSubsystem defines the logging code for the gRPC subsystem. GrpcLogSubsystem = "GRPC" diff --git a/release.sh b/release.sh index 9f5e5fce6..f969efd03 100755 --- a/release.sh +++ b/release.sh @@ -9,11 +9,11 @@ set -e -PKG="github.com/lightninglabs/shushtar" +PKG="github.com/lightninglabs/lightning-terminal" LND_PKG="github.com/lightningnetwork/lnd" FARADAY_PKG="github.com/lightninglabs/faraday" LOOP_PKG="github.com/lightninglabs/loop" -PACKAGE=shushtar +PACKAGE=lightning-terminal # green prints one line of green text (if the terminal supports it). function green() { @@ -68,7 +68,7 @@ function build_release() { pushd "${dir}" green " - Building: ${os} ${arch} ${arm} with build tags '${buildtags}'" - env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/shushtar + env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lightning-terminal env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${LND_PKG}/cmd/lncli env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${FARADAY_PKG}/cmd/frcli env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${LOOP_PKG}/cmd/loop diff --git a/subserver_permissions.go b/subserver_permissions.go index 1b839b998..c2f9dba50 100644 --- a/subserver_permissions.go +++ b/subserver_permissions.go @@ -1,4 +1,4 @@ -package shushtar +package terminal import "gopkg.in/macaroon-bakery.v2/bakery" diff --git a/shushtar.go b/terminal.go similarity index 95% rename from shushtar.go rename to terminal.go index 140172d8e..7574906ac 100644 --- a/shushtar.go +++ b/terminal.go @@ -1,4 +1,4 @@ -package shushtar +package terminal import ( "context" @@ -42,7 +42,7 @@ import ( // Import generated go package that contains all static files for the // UI in a compressed format. - _ "github.com/lightninglabs/shushtar/statik" + _ "github.com/lightninglabs/lightning-terminal/statik" ) const ( @@ -61,9 +61,9 @@ var ( ) ) -// Shushtar is the main grand unified binary instance. Its task is to start an -// lnd node then start and register external subservers to it. -type Shushtar struct { +// LightningTerminal is the main grand unified binary instance. Its task is to +// start an lnd node then start and register external subservers to it. +type LightningTerminal struct { cfg *Config lndAddr string listenerCfg lnd.ListenerCfg @@ -84,9 +84,9 @@ type Shushtar struct { httpServer *http.Server } -// New creates a new instance of the shushtar daemon. -func New() *Shushtar { - return &Shushtar{ +// New creates a new instance of the lightning-terminal daemon. +func New() *LightningTerminal { + return &LightningTerminal{ cfg: defaultConfig(), lndErrChan: make(chan error, 1), } @@ -94,7 +94,7 @@ func New() *Shushtar { // Run starts everything and then blocks until either the application is shut // down or a critical error happens. -func (g *Shushtar) Run() error { +func (g *LightningTerminal) Run() error { // Pre-parse the command line options to pick up an alternative config // file. _, err := flags.Parse(g.cfg) @@ -109,7 +109,7 @@ func (g *Shushtar) Run() error { return err } - // Validate the shushtar config options. + // Validate the lightning-terminal config options. if g.cfg.LetsEncryptDir == "" { g.cfg.LetsEncryptDir = filepath.Join( g.cfg.Lnd.LndDir, defaultLetsEncryptDir, @@ -253,7 +253,7 @@ func (g *Shushtar) Run() error { // startSubservers creates an internal connection to lnd and then starts all // embedded daemons as external subservers that hook into the same gRPC and REST // servers that lnd started. -func (g *Shushtar) startSubservers(network string) error { +func (g *LightningTerminal) startSubservers(network string) error { var basicClient lnrpc.LightningClient // The main RPC listener of lnd might need some time to start, it could @@ -344,7 +344,7 @@ func (g *Shushtar) startSubservers(network string) error { // called once lnd has initialized its main gRPC server instance. It gives the // daemons (or external subservers) the possibility to register themselves to // the same server instance. -func (g *Shushtar) RegisterGrpcSubserver(grpcServer *grpc.Server) error { +func (g *LightningTerminal) RegisterGrpcSubserver(grpcServer *grpc.Server) error { g.lndGrpcServer = grpcServer frdrpc.RegisterFaradayServerServer(grpcServer, g.faradayServer) looprpc.RegisterSwapClientServer(grpcServer, g.loopServer) @@ -355,7 +355,7 @@ func (g *Shushtar) RegisterGrpcSubserver(grpcServer *grpc.Server) error { // called once lnd has initialized its main REST server instance. It gives the // daemons (or external subservers) the possibility to register themselves to // the same server instance. -func (g *Shushtar) RegisterRestSubserver(ctx context.Context, +func (g *LightningTerminal) RegisterRestSubserver(ctx context.Context, mux *restProxy.ServeMux, endpoint string, dialOpts []grpc.DialOption) error { @@ -372,7 +372,7 @@ func (g *Shushtar) RegisterRestSubserver(ctx context.Context, } // shutdown stops all subservers that were started and attached to lnd. -func (g *Shushtar) shutdown() error { +func (g *LightningTerminal) shutdown() error { var returnErr error if g.faradayStarted { @@ -422,7 +422,7 @@ func (g *Shushtar) shutdown() error { // startGrpcWebProxy creates a proxy that speaks gRPC web on one side and native // gRPC on the other side. This allows gRPC web requests from the browser to be // forwarded to lnd's native gRPC interface. -func (g *Shushtar) startGrpcWebProxy() error { +func (g *LightningTerminal) startGrpcWebProxy() error { // Initialize the in-memory file server from the content compiled by // the statik library. statikFS, err := fs.New() From 881ab4093a7afe7c0e803673aad0652c48de035e Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 21 Jul 2020 22:10:33 +0200 Subject: [PATCH 2/2] cmd: rename binary to litd --- .dockerignore | 2 +- .gitignore | 2 +- Makefile | 4 ++-- cmd/{lightning-terminal => litd}/main.go | 0 release.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename cmd/{lightning-terminal => litd}/main.go (100%) diff --git a/.dockerignore b/.dockerignore index 93b6e28c9..135738aa9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ app/build app/coverage app/node_modules -lightning-terminal-debug +litd-debug diff --git a/.gitignore b/.gitignore index 046c85cf9..1dc796559 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ https.key # local environment vars to ignore .env*.local -lightning-terminal-debug +litd-debug /lightning-terminal-* # go code generated by statik diff --git a/Makefile b/Makefile index abbda0618..17a9b6073 100644 --- a/Makefile +++ b/Makefile @@ -98,11 +98,11 @@ install: statik-build go-install go-build: @$(call print, "Building lightning-terminal.") - $(GOBUILD) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" -o lightning-terminal-debug $(PKG)/cmd/lightning-terminal + $(GOBUILD) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" -o litd-debug $(PKG)/cmd/litd go-install: @$(call print, "Installing lightning-terminal.") - $(GOINSTALL) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/lightning-terminal + $(GOINSTALL) -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litd app-build: yarn-install @$(call print, "Building production app.") diff --git a/cmd/lightning-terminal/main.go b/cmd/litd/main.go similarity index 100% rename from cmd/lightning-terminal/main.go rename to cmd/litd/main.go diff --git a/release.sh b/release.sh index f969efd03..004f8f96a 100755 --- a/release.sh +++ b/release.sh @@ -68,7 +68,7 @@ function build_release() { pushd "${dir}" green " - Building: ${os} ${arch} ${arm} with build tags '${buildtags}'" - env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lightning-terminal + env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/litd env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${LND_PKG}/cmd/lncli env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${FARADAY_PKG}/cmd/frcli env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${LOOP_PKG}/cmd/loop