Skip to content

Commit

Permalink
Merge pull request #1 from filecoin-project/master
Browse files Browse the repository at this point in the history
Merge official code.
  • Loading branch information
coder-lb committed Jun 4, 2020
2 parents 1120298 + 3574089 commit 93288fa
Show file tree
Hide file tree
Showing 392 changed files with 23,446 additions and 27,947 deletions.
42 changes: 32 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ orbs:
executors:
golang:
docker:
- image: circleci/golang:1.13
- image: circleci/golang:1.14.2
resource_class: 2xlarge
ubuntu:
docker:
Expand Down Expand Up @@ -42,13 +42,13 @@ commands:
- restore_cache:
name: Restore parameters cache
keys:
- 'v20-1k-lotus-params'
- 'v25-2k-lotus-params'
paths:
- /var/tmp/filecoin-proof-parameters/
- run: ./lotus fetch-params --proving-params 1024
- run: ./lotus fetch-params --proving-params 2048
- save_cache:
name: Save parameters cache
key: 'v20-1k-lotus-params'
key: 'v25-2k-lotus-params'
paths:
- /var/tmp/filecoin-proof-parameters/
install_ipfs:
Expand Down Expand Up @@ -107,6 +107,18 @@ jobs:
paths:
- linux

build-debug:
executor: golang
steps:
- install-deps
- prepare
- go/mod-download
- restore_cache:
name: restore go mod cache
key: v1-go-deps-{{ arch }}-{{ checksum "/home/circleci/project/go.mod" }}
- run:
command: make debug

test: &test
description: |
Run tests with gotestsum.
Expand Down Expand Up @@ -200,8 +212,8 @@ jobs:
- run:
name: Install go
command: |
curl -O https://dl.google.com/go/go1.13.4.darwin-amd64.pkg && \
sudo installer -pkg go1.13.4.darwin-amd64.pkg -target /
curl -O https://dl.google.com/go/go1.14.2.darwin-amd64.pkg && \
sudo installer -pkg go1.14.2.darwin-amd64.pkg -target /
- run:
name: Install pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
Expand All @@ -213,9 +225,8 @@ jobs:
- run:
name: Install jq
command: |
mkdir $HOME/.bin
curl --location https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64 --output $HOME/.bin/jq
chmod +x $HOME/.bin/jq
curl --location https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64 --output /usr/local/bin/jq
chmod +x /usr/local/bin/jq
- restore_cache:
name: restore go mod and cargo cache
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
Expand All @@ -242,6 +253,15 @@ jobs:
- "~/.rustup"
- "~/.cargo"

gofmt:
executor: golang
steps:
- install-deps
- prepare
- go/mod-download
- run:
command: "! go fmt ./... 2>&1 | read"

lint: &lint
description: |
Run golangci-lint.
Expand All @@ -251,7 +271,7 @@ jobs:
default: golang
golangci-lint-version:
type: string
default: 1.17.1
default: 1.23.8
concurrency:
type: string
default: '2'
Expand Down Expand Up @@ -315,12 +335,14 @@ workflows:
- test:
codecov-upload: true
- mod-tidy-check
- gofmt
- test-short:
go-test-flags: "--timeout 10m --short"
filters:
tags:
only:
- /^v\d+\.\d+\.\d+$/
- build-debug
- build-all:
requires:
- test-short
Expand Down
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/sealingfailed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Sealing Issues
about: Create a report for help with sealing (commit) failures.
title: ''
labels: 'sealing'
assignees: ''

---

Please provide all the information requested here to help us troubleshoot "commit failed" issues.
If the information requested is missing, we will probably have to just ask you to provide it anyway,
before we can help debug.

**Describe the problem**

A brief description of the problem you encountered while proving (sealing) a sector.

Including what commands you ran, and a description of your setup, is very helpful.

**Sectors list**

The output of `./lotus-storage-miner sectors list`.

**Sectors status**

The output of `./lotus-storage-miner sectors status --log <sectorId>` for the failed sector(s).

**Lotus storage miner logs**

Please go through the logs of your storage miner, and include screenshots of any error-like messages you find.

**Version**

The output of `./lotus --version`.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
/cmd/lotus-townhall/townhall/node_modules
/cmd/lotus-townhall/townhall/build
extern/filecoin-ffi/rust/target
**/*.h
**/*.a
**/*.pc
/**/*/.DS_STORE
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = extern/filecoin-ffi
url = https://github.com/filecoin-project/filecoin-ffi.git
branch = master
[submodule "extern/serialization-vectors"]
path = extern/serialization-vectors
url = https://github.com/filecoin-project/serialization-vectors
46 changes: 44 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ SHELL=/usr/bin/env bash
all: build
.PHONY: all

unexport GOFLAGS

GOVERSION:=$(shell go version | cut -d' ' -f 3 | cut -d. -f 2)
ifeq ($(shell expr $(GOVERSION) \< 13), 1)
$(warning Your Golang version is go 1.$(GOVERSION))
Expand All @@ -14,12 +16,19 @@ MODULES:=

CLEAN:=
BINS:=
GOFLAGS+=-ldflags=-X="github.com/filecoin-project/lotus/build".CurrentCommit="+git$(subst -,.,$(shell git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || git rev-parse --short HEAD 2>/dev/null))"

ldflags=-X=github.com/filecoin-project/lotus/build.CurrentCommit='+git$(subst -,.,$(shell git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || git rev-parse --short HEAD 2>/dev/null))'
ifneq ($(strip $(LDFLAGS)),)
ldflags+=-extldflags=$(LDFLAGS)
endif

GOFLAGS+=-ldflags="$(ldflags)"


## FFI

FFI_PATH:=extern/filecoin-ffi/
FFI_DEPS:=libfilecoin.a filecoin.pc filecoin.h
FFI_DEPS:=.install-filcrypto
FFI_DEPS:=$(addprefix $(FFI_PATH),$(FFI_DEPS))

$(FFI_DEPS): build/.filecoin-install ;
Expand Down Expand Up @@ -51,6 +60,9 @@ deps: $(BUILD_DEPS)
debug: GOFLAGS+=-tags=debug
debug: lotus lotus-storage-miner lotus-seal-worker lotus-seed

2k: GOFLAGS+=-tags=2k
2k: lotus lotus-storage-miner lotus-seal-worker lotus-seed

lotus: $(BUILD_DEPS)
rm -f lotus
go build $(GOFLAGS) -o lotus ./cmd/lotus
Expand Down Expand Up @@ -91,6 +103,19 @@ install:
install -C ./lotus-storage-miner /usr/local/bin/lotus-storage-miner
install -C ./lotus-seal-worker /usr/local/bin/lotus-seal-worker

install-services: install
mkdir -p /usr/local/lib/systemd/system
install -C -m 0644 ./scripts/lotus-daemon.service /usr/local/lib/systemd/system/lotus-daemon.service
install -C -m 0644 ./scripts/lotus-miner.service /usr/local/lib/systemd/system/lotus-miner.service
systemctl daemon-reload
@echo
@echo "lotus and lotus-miner services installed. Don't forget to 'systemctl enable lotus|lotus-miner' for it to be enabled on startup."

clean-services:
rm -f /usr/local/lib/systemd/system/lotus-daemon.service
rm -f /usr/local/lib/systemd/system/lotus-miner.service
systemctl daemon-reload

# TOOLS

lotus-seed: $(BUILD_DEPS)
Expand Down Expand Up @@ -161,6 +186,18 @@ BINS+=health

buildall: $(BINS)

completions:
./scripts/make-completions.sh lotus
./scripts/make-completions.sh lotus-storage-miner
.PHONY: completions

install-completions:
mkdir -p /usr/share/bash-completion/completions /usr/local/share/zsh/site-functions/
install -C ./scripts/bash-completion/lotus /usr/share/bash-completion/completions/lotus
install -C ./scripts/bash-completion/lotus-storage-miner /usr/share/bash-completion/completions/lotus-storage-miner
install -C ./scripts/zsh-completion/lotus /usr/local/share/zsh/site-functions/_lotus
install -C ./scripts/zsh-completion/lotus-storage-miner /usr/local/share/zsh/site-functions/_lotus-storage-miner

clean:
rm -rf $(CLEAN) $(BINS)
-$(MAKE) -C $(FFI_PATH) clean
Expand All @@ -174,5 +211,10 @@ dist-clean:
type-gen:
go run ./gen/main.go

method-gen:
(cd ./lotuspond/front/src/chain && go run ./methodgen.go)

gen: type-gen method-gen

print-%:
@echo $*=$($*)
14 changes: 9 additions & 5 deletions api/api_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ import (
"context"
"fmt"

"github.com/filecoin-project/lotus/build"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
)

type Permission = string
"github.com/filecoin-project/go-jsonrpc/auth"

"github.com/filecoin-project/lotus/build"
)

type Common interface {
// Auth
AuthVerify(ctx context.Context, token string) ([]Permission, error)
AuthNew(ctx context.Context, perms []Permission) ([]byte, error)
AuthVerify(ctx context.Context, token string) ([]auth.Permission, error)
AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)

// network

Expand All @@ -33,6 +34,9 @@ type Common interface {

LogList(context.Context) ([]string, error)
LogSetLevel(context.Context, string, string) error

// trigger graceful shutdown
Shutdown(context.Context) error
}

// Version provides various build-time information
Expand Down
Loading

0 comments on commit 93288fa

Please sign in to comment.