Skip to content

Commit

Permalink
Merge tag 'v0.10.0-beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
yura-pakhuchiy committed Jun 21, 2020
2 parents 648223b + 1a3194d commit 9838500
Show file tree
Hide file tree
Showing 567 changed files with 75,835 additions and 22,871 deletions.
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- [ ] Any new logging statements use an appropriate subsystem and
logging level
- [ ] Code has been formatted with `go fmt`
- [ ] Protobuf files (`lnrpc/**/*.proto`) have been formatted with
`make rpc-format` and compiled with `make rpc`
- [ ] For code and documentation: lines are wrapped at 80 characters
(the tab character should be counted as 8 characters, not 4, as some IDEs do
per default)
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ profile.tmp
.DS_Store

.vscode

# Coverage test
coverage.txt
19 changes: 13 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@ run:
# timeout for analysis
deadline: 4m

# Linting uses a lot of memory. Keep it under control by only running a single
# worker.
concurrency: 1

# Skip autogenerated files for mobile.
skip-files:
- "mobile\\/.*generated\\.go"

skip-dirs:
- channeldb/migration_01_to_11

build-tags:
- autopilotrpc
- chainrpc
- invoicesrpc
- routerrpc
- signrpc
- walletrpc
- watchtowerrpc
- wtclientrpc

linters-settings:
govet:
Expand Down Expand Up @@ -55,6 +52,16 @@ linters:
# the linter.
- prealloc

# Init functions are used by loggers throughout the codebase.
- gochecknoinits

issues:
# Only show newly introduced problems.
new-from-rev: 01f696afce2f9c0d4ed854edefa3846891d01d8a

exclude-rules:
# Exclude gosec from running for tests so that tests with weak randomness
# (math/rand) will pass the linter.
- path: _test\.go
linters:
- gosec
60 changes: 37 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,60 @@
language: go
cache:
directories:
- ~/bitcoin/bitcoin-0.18.1/bin
- ~/bitcoin/bitcoin-0.19.1/bin
- $DOWNLOAD_CACHE
- $GOCACHE
- $GOPATH/pkg/mod
- $GOPATH/src/github.com/btcsuite
- $GOPATH/src/github.com/golang
- $GOPATH/src/github.com/grpc-ecosystem
- $GOPATH/src/gopkg.in/alecthomas
- $GOPATH/src/google.golang.org

# Remove Travis' default flag --depth=50 from the git clone command to make sure
# we have the whole git history, including the commit we lint against.
git:
depth: false

go:
- "1.13.x"

env:
global:
- GOCACHE=$HOME/.go-build
matrix:
- RACE=true
- ITEST=true
- NEUTRINO_ITEST=true
- BITCOIND_ITEST=true
- COVER=true
- DOWNLOAD_CACHE=$HOME/download_cache

sudo: required

script:
- export GO111MODULE=on
- bash ./scripts/install_bitcoind.sh

# Run unit tests with race condition detector.
- 'if [ "$RACE" = true ]; then make travis-race ; fi'
addons:
apt:
packages:
- clang-format

# Run btcd integration tests.
- 'if [ "$ITEST" = true ]; then make travis-itest; fi'

# Run neutrino integration tests.
- 'if [ "$NEUTRINO_ITEST" = true ]; then make travis-itest backend=neutrino; fi'

# Run bitcoind integration tests.
- 'if [ "$BITCOIND_ITEST" = true ]; then make travis-itest backend=bitcoind; fi'
before_script:
- bash ./scripts/install_travis_proto.sh
- bash ./scripts/install_bitcoind.sh

# Run unit tests and generate coverage report.
- 'if [ "$COVER" = true ]; then make travis-cover; fi'
jobs:
include:
- stage: Build
script:
- make rpc-check
- make unit pkg=... case=_NONE_
- make lint workers=1
- make btcd
- make release sys=windows-amd64
- stage: Test
script: make travis-cover
name: Unit Cover
- script: make travis-race
name: Unit Race
- script: make itest
name: Btcd Integration
- script: make itest backend=bitcoind
name: Bitcoind Integration
- script: make itest backend=neutrino
name: Neutrino Integration

after_script:
- LOG_FILES=./lntest/itest/*.log
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ FROM golang:1.13-alpine as builder
# queries required to connect to linked containers succeed.
ENV GODEBUG netdns=cgo

# Pass a tag, branch or a commit using build-arg. This allows a docker
# image to be built from a specified Git state. The default image
# will use the Git tip of master by default.
ARG checkout="master"

# Install dependencies and build the binaries.
RUN apk add --no-cache --update alpine-sdk \
git \
make \
gcc \
&& git clone https://github.com/groestlcoin/lnd /go/src/github.com/groestlcoin/lnd \
&& cd /go/src/github.com/groestlcoin/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
Expand Down
59 changes: 48 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ANDROID_BUILD_DIR := $(MOBILE_BUILD_DIR)/android
ANDROID_BUILD := $(ANDROID_BUILD_DIR)/Lndmobile.aar

COMMIT := $(shell git describe --abbrev=40 --dirty)
LDFLAGS := -ldflags "-X $(PKG)/build.Commit=$(COMMIT)"
COMMIT_HASH := $(shell git rev-parse HEAD)

BTCD_COMMIT := $(shell cat go.mod | \
grep $(BTCD_PKG) | \
Expand All @@ -36,8 +36,9 @@ GOACC_COMMIT := ddc355013f90fea78d83d3a6c71f1d37ac07ecd5
DEPGET := cd /tmp && GO111MODULE=on go get -v
GOBUILD := GO111MODULE=on go build -v
GOINSTALL := GO111MODULE=on go install -v
GOTEST := GO111MODULE=on go test -v
GOTEST := GO111MODULE=on go test

GOVERSION := $(shell go version | awk '{print $$3}')
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
GOLIST := go list -deps $(PKG)/... | grep '$(PKG)'| grep -v '/vendor/'
GOLISTCOVER := $(shell go list -deps -f '{{.ImportPath}}' ./... | grep '$(PKG)' | sed -e 's/^$(ESCPKG)/./')
Expand All @@ -48,10 +49,33 @@ MAKE := make
XARGS := xargs -L 1

include make/testing_flags.mk
include make/release_flags.mk

DEV_TAGS := $(if ${tags},$(DEV_TAGS) ${tags},$(DEV_TAGS))

LINT = $(LINT_BIN) run -v
# 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 $(PKG)/build.Commit=$(COMMIT) \
-X $(PKG)/build.CommitHash=$(COMMIT_HASH) \
-X $(PKG)/build.GoVersion=$(GOVERSION) \
-X $(PKG)/build.RawTags=$(shell echo $(1) | sed -e 's/ /,/g')

LDFLAGS := -ldflags "$(call make_ldflags, ${tags})"
DEV_LDFLAGS := -ldflags "$(call make_ldflags, $(DEV_TAGS))"
ITEST_LDFLAGS := -ldflags "$(call make_ldflags, $(ITEST_TAGS))"

# For the release, we want to remove the symbol table and debug information (-s)
# and omit the DWARF symbol table (-w). Also we clear the build ID.
RELEASE_LDFLAGS := $(call make_ldflags, $(RELEASE_TAGS), -s -w -buildid=)

# Linting uses a lot of memory, so keep it under control by limiting the number
# of workers if requested.
ifneq ($(workers),)
LINT_WORKERS = --concurrency=$(workers)
endif

LINT = $(LINT_BIN) run -v $(LINT_WORKERS)

GREEN := "\\033[0;32m"
NC := "\\033[0m"
Expand Down Expand Up @@ -89,19 +113,24 @@ btcd:

build:
@$(call print, "Building debug lnd and lncli.")
$(GOBUILD) -tags="$(DEV_TAGS)" -o lnd-debug $(LDFLAGS) $(PKG)/cmd/lnd
$(GOBUILD) -tags="$(DEV_TAGS)" -o lncli-debug $(LDFLAGS) $(PKG)/cmd/lncli
$(GOBUILD) -tags="$(DEV_TAGS)" -o lnd-debug $(DEV_LDFLAGS) $(PKG)/cmd/lnd
$(GOBUILD) -tags="$(DEV_TAGS)" -o lncli-debug $(DEV_LDFLAGS) $(PKG)/cmd/lncli

build-itest:
@$(call print, "Building itest lnd and lncli.")
$(GOBUILD) -tags="$(ITEST_TAGS)" -o lnd-itest $(LDFLAGS) $(PKG)/cmd/lnd
$(GOBUILD) -tags="$(ITEST_TAGS)" -o lncli-itest $(LDFLAGS) $(PKG)/cmd/lncli
$(GOBUILD) -tags="$(ITEST_TAGS)" -o lnd-itest $(ITEST_LDFLAGS) $(PKG)/cmd/lnd
$(GOBUILD) -tags="$(ITEST_TAGS)" -o lncli-itest $(ITEST_LDFLAGS) $(PKG)/cmd/lncli

install:
@$(call print, "Installing lnd and lncli.")
$(GOINSTALL) -tags="${tags}" $(LDFLAGS) $(PKG)/cmd/lnd
$(GOINSTALL) -tags="${tags}" $(LDFLAGS) $(PKG)/cmd/lncli

release:
@$(call print, "Releasing lnd and lncli binaries.")
$(VERSION_CHECK)
./build/release/release.sh build-release "$(VERSION_TAG)" "$(BUILD_SYSTEM)" "$(RELEASE_TAGS)" "$(RELEASE_LDFLAGS)"

scratch: build


Expand Down Expand Up @@ -135,11 +164,9 @@ goveralls: $(GOVERALLS_BIN)
$(GOVERALLS_BIN) -coverprofile=coverage.txt -service=travis-ci


travis-race: lint btcd unit-race

travis-cover: lint btcd unit-cover goveralls
travis-race: btcd unit-race

travis-itest: lint itest
travis-cover: btcd unit-cover goveralls

# =============
# FLAKE HUNTING
Expand Down Expand Up @@ -176,6 +203,14 @@ rpc:
@$(call print, "Compiling protos.")
cd ./lnrpc; ./gen_protos.sh

rpc-format:
@$(call print, "Formatting protos.")
cd ./lnrpc; find . -name "*.proto" | xargs clang-format --style=file -i

rpc-check: rpc
@$(call print, "Verifying protos.")
if test -n "$$(git describe --dirty | grep dirty)"; then echo "Protos not properly formatted or not compiled with v3.4.0"; git status; git diff; exit 1; fi

mobile-rpc:
@$(call print, "Creating mobile RPC from protos.")
cd ./mobile; ./gen_bindings.sh
Expand Down Expand Up @@ -225,6 +260,8 @@ clean:
lint \
list \
rpc \
rpc-format \
rpc-check \
mobile-rpc \
vendor \
ios \
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ resources including talks, articles, and example applications can be found at:
[dev.lightning.community](https://dev.lightning.community).

Finally, we also have an active
[Slack](https://join.slack.com/t/lightningcommunity/shared_invite/enQtMzQ0OTQyNjE5NjU1LThmOGJkZDIzY2U2ODI5ODhmOWMzM2FkOTY5ZTdkYTc5NDYyN2U1YTJkZTE1MWU2OTZlZTAyOWY4NGY2M2M1NTM) where protocol developers, application developers, testers and users gather to
[Slack](https://lightning.engineering/slack.html) where protocol developers, application developers, testers and users gather to
discuss various aspects of `lnd` and also Lightning in general.

## Installation
Expand All @@ -67,12 +67,19 @@ discuss various aspects of `lnd` and also Lightning in general.

## Docker
To run lnd from Docker, please see the main [Docker instructions](docs/DOCKER.md)

## IRC
* irc.freenode.net
* channel #lnd
* [webchat](https://webchat.freenode.net/?channels=lnd)

## Safety

When operating a mainnet `lnd` node, please refer to our [operational safety
guildelines](docs/safety.md). It is important to note that `lnd` is still
**beta** software and that ignoring these operational guidelines can lead to
loss of funds.

## Security

The developers of `lnd` take security _very_ seriously. The disclosure of
Expand Down
13 changes: 13 additions & 0 deletions aezeed/cipherseed_rpctest.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// +build rpctest

package aezeed

import "github.com/btcsuite/btcwallet/waddrmgr"

func init() {
// For the purposes of our itest, we'll crank down the scrypt params a
// bit.
scryptN = waddrmgr.FastScryptOptions.N
scryptR = waddrmgr.FastScryptOptions.R
scryptP = waddrmgr.FastScryptOptions.P
}
Loading

0 comments on commit 9838500

Please sign in to comment.