Merge pull request #6464 from kaloudis/mobile-build-subservers
Mobile builds: expose main sub-servers by default
This commit is contained in:
4 files changed
+17
-20
No files matched your search
@@ -29,7 +29,7 @@ COMMIT_HASH := $(shell git rev-parse HEAD)
|
|||||||
|
|
||||||
GOBUILD := go build -v
|
GOBUILD := go build -v
|
||||||
GOINSTALL := go install -v
|
GOINSTALL := go install -v
|
||||||
GOTEST := go test
|
GOTEST := go test
|
||||||
|
|
||||||
GOVERSION := $(shell go version | awk '{print $$3}')
|
GOVERSION := $(shell go version | awk '{print $$3}')
|
||||||
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -name "*pb.go" -not -name "*pb.gw.go" -not -name "*.pb.json.go")
|
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -name "*pb.go" -not -name "*pb.gw.go" -not -name "*.pb.json.go")
|
||||||
@@ -291,8 +291,8 @@ sample-conf-check:
|
|||||||
for flag in $$(GO_FLAGS_COMPLETION=1 go run -tags="$(RELEASE_TAGS)" $(PKG)/cmd/lnd -- | grep -v help | cut -c3-); do if ! grep -q $$flag sample-lnd.conf; then echo "Command line flag --$$flag not added to sample-lnd.conf"; exit 1; fi; done
|
for flag in $$(GO_FLAGS_COMPLETION=1 go run -tags="$(RELEASE_TAGS)" $(PKG)/cmd/lnd -- | grep -v help | cut -c3-); do if ! grep -q $$flag sample-lnd.conf; then echo "Command line flag --$$flag not added to sample-lnd.conf"; exit 1; fi; done
|
||||||
|
|
||||||
mobile-rpc:
|
mobile-rpc:
|
||||||
@$(call print, "Creating mobile RPC from protos (prefix=$(prefix)).")
|
@$(call print, "Creating mobile RPC from protos.")
|
||||||
cd ./lnrpc; COMPILE_MOBILE=1 SUBSERVER_PREFIX=$(prefix) ./gen_protos_docker.sh
|
cd ./lnrpc; COMPILE_MOBILE=1 SUBSERVER_PREFIX=1 ./gen_protos_docker.sh
|
||||||
|
|
||||||
vendor:
|
vendor:
|
||||||
@$(call print, "Re-creating vendor directory.")
|
@$(call print, "Re-creating vendor directory.")
|
||||||
@@ -301,22 +301,22 @@ vendor:
|
|||||||
apple: vendor mobile-rpc
|
apple: vendor mobile-rpc
|
||||||
@$(call print, "Building iOS and macOS cxframework ($(IOS_BUILD)).")
|
@$(call print, "Building iOS and macOS cxframework ($(IOS_BUILD)).")
|
||||||
mkdir -p $(IOS_BUILD_DIR)
|
mkdir -p $(IOS_BUILD_DIR)
|
||||||
$(GOMOBILE_BIN) bind -target=ios,iossimulator,macos -tags="mobile $(DEV_TAGS) autopilotrpc" $(LDFLAGS) -v -o $(IOS_BUILD) $(MOBILE_PKG)
|
$(GOMOBILE_BIN) bind -target=ios,iossimulator,macos -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" $(LDFLAGS) -v -o $(IOS_BUILD) $(MOBILE_PKG)
|
||||||
|
|
||||||
ios: vendor mobile-rpc
|
ios: vendor mobile-rpc
|
||||||
@$(call print, "Building iOS cxframework ($(IOS_BUILD)).")
|
@$(call print, "Building iOS cxframework ($(IOS_BUILD)).")
|
||||||
mkdir -p $(IOS_BUILD_DIR)
|
mkdir -p $(IOS_BUILD_DIR)
|
||||||
$(GOMOBILE_BIN) bind -target=ios,iossimulator -tags="mobile $(DEV_TAGS) autopilotrpc neutrinorpc" $(LDFLAGS) -v -o $(IOS_BUILD) $(MOBILE_PKG)
|
$(GOMOBILE_BIN) bind -target=ios,iossimulator -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" $(LDFLAGS) -v -o $(IOS_BUILD) $(MOBILE_PKG)
|
||||||
|
|
||||||
macos: vendor mobile-rpc
|
macos: vendor mobile-rpc
|
||||||
@$(call print, "Building macOS cxframework ($(IOS_BUILD)).")
|
@$(call print, "Building macOS cxframework ($(IOS_BUILD)).")
|
||||||
mkdir -p $(IOS_BUILD_DIR)
|
mkdir -p $(IOS_BUILD_DIR)
|
||||||
$(GOMOBILE_BIN) bind -target=macos -tags="mobile $(DEV_TAGS) autopilotrpc" $(LDFLAGS) -v -o $(IOS_BUILD) $(MOBILE_PKG)
|
$(GOMOBILE_BIN) bind -target=macos -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" $(LDFLAGS) -v -o $(IOS_BUILD) $(MOBILE_PKG)
|
||||||
|
|
||||||
android: vendor mobile-rpc
|
android: vendor mobile-rpc
|
||||||
@$(call print, "Building Android library ($(ANDROID_BUILD)).")
|
@$(call print, "Building Android library ($(ANDROID_BUILD)).")
|
||||||
mkdir -p $(ANDROID_BUILD_DIR)
|
mkdir -p $(ANDROID_BUILD_DIR)
|
||||||
$(GOMOBILE_BIN) bind -target=android -tags="mobile $(DEV_TAGS) autopilotrpc neutrinorpc" $(LDFLAGS) -v -o $(ANDROID_BUILD) $(MOBILE_PKG)
|
$(GOMOBILE_BIN) bind -target=android -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" $(LDFLAGS) -v -o $(ANDROID_BUILD) $(MOBILE_PKG)
|
||||||
|
|
||||||
mobile: ios android
|
mobile: ios android
|
||||||
|
|
||||||
|
|||||||
@@ -305,6 +305,10 @@ to the htlc interceptor API.
|
|||||||
grow very large on disk given a busy operating channel, [which is now changed
|
grow very large on disk given a busy operating channel, [which is now changed
|
||||||
with a space deduction over (at least) 96 percents.](https://github.com/lightningnetwork/lnd/pull/6347)
|
with a space deduction over (at least) 96 percents.](https://github.com/lightningnetwork/lnd/pull/6347)
|
||||||
|
|
||||||
|
* [Mobile builds now expose main sub-servers by default](https://github.com/lightningnetwork/lnd/pull/6464).
|
||||||
|
All API methods have prefixed the generated methods with the subserver name.
|
||||||
|
This is required to support subservers with name conflicts.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
* Improved instructions on [how to build lnd for mobile](https://github.com/lightningnetwork/lnd/pull/6085).
|
* Improved instructions on [how to build lnd for mobile](https://github.com/lightningnetwork/lnd/pull/6085).
|
||||||
@@ -372,6 +376,7 @@ gRPC performance metrics (latency to process `GetInfo`, etc)](https://github.com
|
|||||||
* Elle Mouton
|
* Elle Mouton
|
||||||
* ErikEk
|
* ErikEk
|
||||||
* Eugene Siegel
|
* Eugene Siegel
|
||||||
|
* Evan Kaloudis
|
||||||
* Hampus Sjöberg
|
* Hampus Sjöberg
|
||||||
* henta
|
* henta
|
||||||
* hieblmi
|
* hieblmi
|
||||||
|
|||||||
+3
-11
@@ -227,19 +227,11 @@ implementation project(":lndmobile", { "default" })
|
|||||||
```
|
```
|
||||||
---
|
---
|
||||||
|
|
||||||
## Options
|
## Calling the API
|
||||||
|
|
||||||
Similar to lnd, subservers can be conditionally compiled with the build by setting the tags argument:
|
In LND v0.15+ all API methods have prefixed the generated methods with the subserver name. This is required to support subservers with name conflicts.
|
||||||
|
|
||||||
```shell
|
eg. `QueryScores` is now `AutopilotQueryScores`. `GetBlockHeader` is now `NeutrinoKitGetBlockHeader`.
|
||||||
⛰ 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:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
⛰ make ios prefix=1
|
|
||||||
```
|
|
||||||
|
|
||||||
## API docs
|
## API docs
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,13 @@ target_pkg="github.com/lightningnetwork/lnd/lnrpc"
|
|||||||
|
|
||||||
# A mapping from grpc service to name of the custom listeners. The grpc server
|
# A mapping from grpc service to name of the custom listeners. The grpc server
|
||||||
# must be configured to listen on these.
|
# must be configured to listen on these.
|
||||||
listeners="lightning=lightningLis walletunlocker=lightningLis state=lightningLis"
|
listeners="lightning=lightningLis walletunlocker=lightningLis state=lightningLis autopilot=lightningLis chainnotifier=lightningLis invoices=lightningLis neutrinokit=lightningLis peers=lightningLis router=lightningLis signer=lightningLis versioner=lightningLis walletkit=lightningLis watchtower=lightningLis watchtowerclient=lightningLis"
|
||||||
|
|
||||||
# Set to 1 to create boiler plate grpc client code and listeners. If more than
|
# Set to 1 to create boiler plate grpc client code and listeners. If more than
|
||||||
# one proto file is being parsed, it should only be done once.
|
# one proto file is being parsed, it should only be done once.
|
||||||
mem_rpc=1
|
mem_rpc=1
|
||||||
|
|
||||||
PROTOS="lightning.proto walletunlocker.proto stateservice.proto"
|
PROTOS="lightning.proto walletunlocker.proto stateservice.proto autopilotrpc/autopilot.proto chainrpc/chainnotifier.proto invoicesrpc/invoices.proto neutrinorpc/neutrino.proto peersrpc/peers.proto routerrpc/router.proto signrpc/signer.proto verrpc/verrpc.proto walletrpc/walletkit.proto watchtowerrpc/watchtower.proto wtclientrpc/wtclient.proto"
|
||||||
|
|
||||||
opts="package_name=$pkg,target_package=$target_pkg,listeners=$listeners,mem_rpc=$mem_rpc"
|
opts="package_name=$pkg,target_package=$target_pkg,listeners=$listeners,mem_rpc=$mem_rpc"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user