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

Release/v1.6.0 #89

Closed
wants to merge 4 commits into from
Closed
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
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
description: gotestsum format. https://github.com/gotestyourself/gotestsum#format
coverage:
type: string
default: -coverprofile=coverage.txt -coverpkg=github.com/filecoin-project/venus-miner/...
default: -coverprofile=coverage.txt -coverpkg=./...
description: Coverage flag. Set to the empty string to disable.
codecov-upload:
type: boolean
Expand All @@ -131,7 +131,7 @@ jobs:
- install-deps
- prepare
- run:
command: make deps miner
command: make deps
no_output_timeout: 30m
- run:
name: go test
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
name: Install go
command: |
curl -O https://dl.google.com/go/go1.17.9.darwin-amd64.pkg && \
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
sudo installer -pkg go1.17.9.darwin-amd64.pkg -target /
- run:
name: Install pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
Expand All @@ -196,7 +196,6 @@ jobs:
- restore_cache:
name: restore cargo cache
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/venus-miner/go.sum" }}
- install-deps
- run:
command: make miner
no_output_timeout: 30m
Expand Down Expand Up @@ -228,8 +227,9 @@ jobs:
- install-deps
- prepare
- run: make deps
- run: go install golang.org/x/tools/cmd/goimports
- run: go generate -x ./...
- run: go install golang.org/x/tools/cmd/goimports
- run: make gen
- run: git --no-pager diff
- run: git --no-pager diff --quiet

Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ all: build
.PHONY: all docker

GOVERSION:=$(shell go version | cut -d' ' -f 3 | cut -d. -f 2)
ifeq ($(shell expr $(GOVERSION) \< 15), 1)
ifeq ($(shell expr $(GOVERSION) \< 17), 1)
$(warning Your Golang version is go 1.$(GOVERSION))
$(error Update Golang to version to at least 1.15.5)
$(error Update Golang to version to at least 1.17.9)
endif

# git modules that need to be loaded
Expand Down Expand Up @@ -63,7 +63,6 @@ deps: $(BUILD_DEPS)
miner: $(BUILD_DEPS)
rm -f venus-miner
go build $(GOFLAGS) -o venus-miner ./cmd/
go run github.com/GeertJohan/go.rice/rice append --exec venus-miner -i ./build

.PHONY: miner
BINS+=venus-miner
Expand All @@ -82,6 +81,11 @@ dist-clean:
git submodule deinit --all -f
.PHONY: dist-clean

gen:
go run ./gen/api
goimports -w api
.PHONY: gen

print-%:
@echo $*=$($*)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p align="center">
<a href="https://circleci.com/gh/filecoin-project/venus-miner"><img src="https://circleci.com/gh/filecoin-project/venus.svg?style=svg"></a>
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.16-blue.svg" /></a>
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.17-blue.svg" /></a>
<br>
</p>

Expand Down
5 changes: 0 additions & 5 deletions api/api_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ type APIVersion struct {
//
// See APIVersion in build/version.go
APIVersion api.Version

// TODO: git commit / os / genesis cid?

// Seconds
BlockDelay uint64
}

func (v APIVersion) String() string {
Expand Down
20 changes: 20 additions & 0 deletions api/api_miner.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package api

import (
"context"
"github.com/filecoin-project/venus-miner/types"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
)

type MinerAPI interface {
Common

UpdateAddress(context.Context, int64, int64) ([]types.MinerInfo, error) //perm:write
ListAddress(context.Context) ([]types.MinerInfo, error) //perm:read
StatesForMining(context.Context, []address.Address) ([]types.MinerState, error) //perm:read
CountWinners(context.Context, []address.Address, abi.ChainEpoch, abi.ChainEpoch) ([]types.CountWinners, error) //perm:read
Start(context.Context, []address.Address) error //perm:admin
Stop(context.Context, []address.Address) error //perm:admin
}
22 changes: 0 additions & 22 deletions api/api_poster.go

This file was deleted.

2 changes: 1 addition & 1 deletion api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewCommonRPC(ctx context.Context, addr string, requestHeader http.Header) (

// NewMinerRPC creates a new http jsonrpc client for miner
func NewMinerRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.MinerAPI, jsonrpc.ClientCloser, error) {
var res api.MinerStruct
var res api.MinerAPIStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.CommonStruct.Internal,
Expand Down
4 changes: 2 additions & 2 deletions api/client/gateway_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
gateway "github.com/filecoin-project/venus/venus-shared/api/gateway/v1"
)

func NewGatewayRPC(cfg *config.GatewayNode) (gateway.IGateway, jsonrpc.ClientCloser, error) {
func NewGatewayRPC(ctx context.Context, cfg *config.GatewayNode) (gateway.IGateway, jsonrpc.ClientCloser, error) {
var err error
addrs, err := cfg.DialArgs()
if err != nil {
Expand All @@ -21,7 +21,7 @@ func NewGatewayRPC(cfg *config.GatewayNode) (gateway.IGateway, jsonrpc.ClientClo
var gatewayAPI gateway.IGateway = nil
var closer jsonrpc.ClientCloser
for _, addr := range addrs {
gatewayAPI, closer, err = gateway.NewIGatewayRPC(context.Background(), addr, cfg.AuthHeader())
gatewayAPI, closer, err = gateway.NewIGatewayRPC(ctx, addr, cfg.AuthHeader())
if err == nil {
return gatewayAPI, closer, err
}
Expand Down
2 changes: 1 addition & 1 deletion api/permissioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var AllPermissions = []auth.Permission{PermRead, PermWrite, PermSign, PermAdmin}
var DefaultPerms = []auth.Permission{PermRead}

func PermissionedMinerAPI(a MinerAPI) MinerAPI {
var out MinerStruct
var out MinerAPIStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.CommonStruct.Internal)
return &out
Expand Down
Loading