Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi: add migrate-db command #21

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ XARGS := xargs -L 1

VERSION_TAG = $(shell git describe --tags)

DEV_TAGS = kvdb_etcd kvdb_postgres kvdb_sqlite
RELEASE_TAGS = $(DEV_TAGS)

BUILD_SYSTEM = darwin-amd64 \
darwin-arm64 \
linux-386 \
linux-amd64 \
linux-armv6 \
Expand All @@ -49,7 +53,7 @@ endif
make_ldflags = $(2) -X $(PKG).Commit=$(COMMIT)

DEV_GCFLAGS := -gcflags "all=-N -l"
LDFLAGS := -ldflags "$(call make_ldflags, ${tags}, -s -w)"
LDFLAGS := -ldflags "$(call make_ldflags, $(DEV_TAGS), -s -w)"
DEV_LDFLAGS := -ldflags "$(call make_ldflags, $(DEV_TAGS))"

# For the release, we want to remove the symbol table and debug information (-s)
Expand Down Expand Up @@ -83,7 +87,7 @@ build:

install:
@$(call print, "Installing lndinit.")
$(GOINSTALL) -tags="${tags}" $(LDFLAGS) $(PKG)
$(GOINSTALL) -tags="$(DEV_TAGS)" $(LDFLAGS) $(PKG)

release-install:
@$(call print, "Installing release lndinit.")
Expand All @@ -105,7 +109,7 @@ scratch: build

unit:
@$(call print, "Running unit tests.")
$(GOTEST) ./...
$(GOTEST) -tags="$(DEV_TAGS)" ./...

fmt: $(GOIMPORTS_BIN)
@$(call print, "Fixing imports.")
Expand All @@ -115,7 +119,7 @@ fmt: $(GOIMPORTS_BIN)

lint: docker-tools
@$(call print, "Linting source.")
$(DOCKER_TOOLS) golangci-lint run -v $(LINT_WORKERS)
$(DOCKER_TOOLS) golangci-lint run -v --build-tags="$(DEV_TAGS)"$(LINT_WORKERS)

vendor:
@$(call print, "Re-creating vendor directory.")
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ initialization, including seed and password generation.
- [`store-configmap`](#store-configmap)
- [`init-wallet`](#init-wallet)
- [`wait-ready`](#wait-ready)
- [`migrate-db`](#migrate-db)
- [Example usage](#example-usage)
- [Basic setup](#example-use-case-1-basic-setup)
- [Kubernetes](#example-use-case-2-kubernetes)
Expand Down Expand Up @@ -64,6 +65,11 @@ No `lnd` needed, but seed will be in `lnd`-specific [`aezeed` format](https://gi
`wait-ready` waits for `lnd` to be ready by connecting to `lnd`'s status RPC
- Needs `lnd` to run, eventually

### migrate-db
`migrate-db` migrates the content of one `lnd` database to another, for example
from `bbolt` to Postgres. See [data migration guide](docs/data-migration.md) for
more information.

---

## Example Usage
Expand Down
Loading
Loading