Skip to content

Commit

Permalink
Merge pull request #4 from ltcsuite/losh11/0.10.1
Browse files Browse the repository at this point in the history
Losh11/0.10.1
  • Loading branch information
losh11 authored Jun 18, 2020
2 parents e96257a + f517f4a commit 1563164
Show file tree
Hide file tree
Showing 438 changed files with 43,695 additions and 15,102 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
6 changes: 0 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ 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"
Expand All @@ -17,11 +13,9 @@ run:
- autopilotrpc
- chainrpc
- invoicesrpc
- routerrpc
- signrpc
- walletrpc
- watchtowerrpc
- wtclientrpc

linters-settings:
govet:
Expand Down
30 changes: 24 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,49 @@
language: go
cache:
directories:
- ~/bitcoin/bitcoin-0.19.0.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
- DOWNLOAD_CACHE=$HOME/download_cache

sudo: required

before_script: bash ./scripts/install_bitcoind.sh
addons:
apt:
packages:
- clang-format

before_script:
- bash ./scripts/install_travis_proto.sh
- bash ./scripts/install_bitcoind.sh

jobs:
include:
- stage: Build
script:
- make unit pkg=... case=_NONE_
- make lint
- make btcd
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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apk add --no-cache --update alpine-sdk \
&& cd /go/src/github.com/ltcsuite/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
55 changes: 47 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PKG := github.com/ltcsuite/lnd
ESCPKG := github.com\/lightningnetwork\/lnd
ESCPKG := github.com\/ltcsuite\/lnd
MOBILE_PKG := $(PKG)/mobile

BTCD_PKG := github.com/btcsuite/btcd
BTCD_PKG := github.com/ltcsuite/ltcd
GOVERALLS_PKG := github.com/mattn/goveralls
LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
GOACC_PKG := github.com/ory/go-acc
Expand All @@ -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 @@ -38,6 +38,7 @@ GOBUILD := GO111MODULE=on go build -v
GOINSTALL := GO111MODULE=on go install -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 @@ -174,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 @@ -223,6 +260,8 @@ clean:
lint \
list \
rpc \
rpc-format \
rpc-check \
mobile-rpc \
vendor \
ios \
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Lightning Network Daemon

[![Build Status](https://img.shields.io/travis/lightningnetwork/lnd.svg)](https://travis-ci.org/lightningnetwork/lnd)
[![Build Status](https://img.shields.io/travis/lightningnetwork/lnd.svg)](https://travis-ci.org/ltcsuite/lnd)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ltcsuite/lnd/blob/master/LICENSE)
[![Irc](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](https://webchat.freenode.net/?channels=lnd)
[![Godoc](https://godoc.org/github.com/ltcsuite/lnd?status.svg)](https://godoc.org/github.com/ltcsuite/lnd)
Expand Down Expand Up @@ -61,7 +61,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/enQtODY1NTI2MjY5MjAzLTQxYjBmNTcxNTA1YzZkZDQ1ZDNlYzJmZWMwYjg4MTI3OTkyZTU4ZDYzNTFjYzgyMWM0ZmZlYzVlZWI1YzhkNDI) 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 @@ -70,15 +70,21 @@ In order to build from source, please see [the installation
instructions](docs/INSTALL.md).

## Docker

To run lnd from Docker, please see the main [Docker instructions](docs/DOCKER.md)
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 1563164

Please sign in to comment.