Skip to content

Commit

Permalink
Merge pull request #197 from ipfs-force-community/feat/migrate_proc
Browse files Browse the repository at this point in the history
feat: proc repo migration
  • Loading branch information
simlecode authored Jun 7, 2023
2 parents da63086 + 0bdad0b commit 015ac66
Show file tree
Hide file tree
Showing 62 changed files with 351 additions and 363 deletions.
36 changes: 13 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ orbs:
executors:
golang:
docker:
# Must match GO_VERSION_MIN in project root
- image: cimg/go:1.18.1
resource_class: 2xlarge
ubuntu:
docker:
- image: ubuntu:20.04
Expand All @@ -30,7 +30,6 @@ commands:
steps:
- checkout
- git_fetch_all_tags
- checkout
- when:
condition: << parameters.linux >>
steps:
Expand Down Expand Up @@ -93,8 +92,8 @@ jobs:
- run:
command: make miner
- store_artifacts:
path: venus-miner
- run: mkdir linux && mv venus-miner linux/
path: sophon-miner
- run: mkdir linux && mv sophon-miner linux/
- persist_to_workspace:
root: "."
paths:
Expand Down Expand Up @@ -170,15 +169,15 @@ jobs:
build-macos:
description: build darwin venus-miner binary
description: build darwin sophon-miner binary
parameters:
publish:
default: false
description: publish github release and homebrew?
type: boolean
macos:
xcode: "13.4.1"
working_directory: ~/go/src/github.com/filecoin-project/venus-miner
working_directory: ~/go/src/github.com/ipfs-force-community/sophon-miner
steps:
- prepare:
linux: false
Expand Down Expand Up @@ -206,8 +205,8 @@ jobs:
command: make miner
no_output_timeout: 30m
- store_artifacts:
path: venus-miner
- run: mkdir darwin && mv venus-miner darwin/
path: sophon-miner
- run: mkdir darwin && mv sophon-miner darwin/
- persist_to_workspace:
root: "."
paths:
Expand All @@ -226,11 +225,9 @@ jobs:
steps:
- install-deps
- prepare
- 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
- run: git --no-pager diff && git --no-pager diff --quiet

lint: &lint
description: |
Expand All @@ -239,12 +236,6 @@ jobs:
executor:
type: executor
default: golang
concurrency:
type: string
default: '2'
description: |
Concurrency used to run linters. Defaults to 2 because NumCPU is not
aware of container CPU limits.
args:
type: string
default: ''
Expand All @@ -257,8 +248,8 @@ jobs:
- run:
name: Lint
command: |
golangci-lint run -v --timeout 2m \
--concurrency << parameters.concurrency >> << parameters.args >>
golangci-lint run -v --timeout 10m \
--concurrency 4 << parameters.args >>
lint-all:
<<: *lint

Expand Down Expand Up @@ -403,8 +394,7 @@ workflows:
version: 2.1
ci:
jobs:
- lint-all:
concurrency: "16" # expend all docker 2xlarge CPUs.
- lint-all
- mod-tidy-check
- gofmt
- gen-check
Expand Down Expand Up @@ -445,7 +435,7 @@ workflows:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-and-push-image:
dockerfile: Dockerfile.venusminer
dockerfile: Dockerfile.sophon-miner
path: .
repo: venusminer-dev
repo: sophon-miner-dev
tag: '${CIRCLE_SHA1:0:8}'
2 changes: 1 addition & 1 deletion .github/workflows/build_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build_upload:
uses: filecoin-project/venus/.github/workflows/common_build_upload.yml@master
with:
bin_name: 'venus-miner'
bin_name: 'sophon-miner'
has_ffi: false
secrets:
OSS_KEY_ID: ${{secrets.OSS_KEY_ID}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:

check:
uses: filecoin-project/venus/.github/workflows/common_go.yml@v1.8.0-rc1
uses: filecoin-project/venus/.github/workflows/common_go.yml@master
with:
has_ffi: false
test_timeout: 20
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/venus-miner
/sophon-miner
/bench.json
/lotuspond/front/node_modules
/lotuspond/front/build
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ endif
CLEAN:=
BINS:=

BUILD_TARGET=venus-miner
BUILD_TARGET=sophon-miner

ldflags=-X=github.com/filecoin-project/venus-miner/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/ipfs-force-community/sophon-miner/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
Expand All @@ -25,11 +25,11 @@ build: miner
.PHONY: build

miner:
rm -f venus-miner
rm -f $(BUILD_TARGET)
go build $(GOFLAGS) -o $(BUILD_TARGET) ./cmd/

.PHONY: miner
BINS+=venus-miner
BINS+=sophon-miner

docsgen:
go build $(GOFLAGS) -o docgen-md ./api/docgen
Expand Down Expand Up @@ -71,11 +71,11 @@ ifdef DOCKERFILE
else
curl -o dockerfile https://raw.githubusercontent.com/filecoin-project/venus-docs/master/script/docker/dockerfile
endif
docker build --build-arg https_proxy=$(BUILD_DOCKER_PROXY) --build-arg BUILD_TARGET=$(BUILD_TARGET) -t venus-miner .
docker tag venus-miner filvenus/venus-miner:$(TAG)
docker build --build-arg https_proxy=$(BUILD_DOCKER_PROXY) --build-arg BUILD_TARGET=$(BUILD_TARGET) -t sophon-miner .
docker tag sophon-miner filvenus/sophon-miner:$(TAG)
ifdef PRIVATE_REGISTRY
docker tag venus-miner $(PRIVATE_REGISTRY)/filvenus/venus-miner:$(TAG)
docker tag sophon-miner $(PRIVATE_REGISTRY)/filvenus/sophon-miner:$(TAG)
endif

docker-push: docker
docker push $(PRIVATE_REGISTRY)/filvenus/venus-miner:$(TAG)
docker push $(PRIVATE_REGISTRY)/filvenus/sophon-miner:$(TAG)
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<h1 align="center">Project venus-miner</h1>
<h1 align="center">Project sophon-miner</h1>

<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="https://circleci.com/gh/ipfs-force-community/sophon-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.18-blue.svg" /></a>
<br>
</p>

The venus-miner is used to mine for multiple miners, the advantage is that:
The sophon-miner is used to mine for multiple miners, the advantage is that:
1. The miners in the mining pool do not need to deploy their own mining programs.
2. It is possible to increase the tps and miner fees for packaging messages.
3. Miners can package messages for each other to avoid the problem of selfish mining.
Expand All @@ -31,7 +31,7 @@ These repos are independent and reusable modules, but are tightly integrated int
Venus is a universally open project and welcomes contributions of all kinds: code, docs, and more. However, before making a contribution, we ask you to heed these recommendations:

1. If the proposal entails a protocol change, please first submit a [Filecoin Improvement Proposal](https://github.com/filecoin-project/FIPs).
2. If the change is complex and requires prior discussion, [open an issue](https://github.com/filecoin-project/venus-miner/issues) to request feedback before you start working on a pull request. This is to avoid disappointment and sunk costs, in case the change is not actually needed or accepted.
2. If the change is complex and requires prior discussion, [open an issue](https://github.com/ipfs-force-community/sophon-miner/issues) to request feedback before you start working on a pull request. This is to avoid disappointment and sunk costs, in case the change is not actually needed or accepted.
3. Please refrain from submitting PRs to adapt existing code to subjective preferences. The changeset should contain functional or technical improvements/enhancements, bug fixes, new features, or some other clear material contribution. Simple stylistic changes are likely to be rejected in order to reduce code churn.

When implementing a change:
Expand All @@ -47,4 +47,4 @@ When implementing a change:

## License

Dual-licensed under [MIT](https://github.com/filecoin-project/venus-miner/blob/master/LICENSE-MIT) + [Apache 2.0](https://github.com/filecoin-project/venus-miner/blob/master/LICENSE-APACHE)
Dual-licensed under [MIT](https://github.com/ipfs-force-community/sophon-miner/blob/master/LICENSE-MIT) + [Apache 2.0](https://github.com/ipfs-force-community/sophon-miner/blob/master/LICENSE-APACHE)
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ This is not an exhaustive list, but should provide some idea of what we consider

## Reporting a non security bug

For non-security bugs, please simply file a GitHub [issue](https://github.com/filecoin-project/venus-miner/issues/new?template=bug_report.md).
For non-security bugs, please simply file a GitHub [issue](https://github.com/filecoin-project/venus/issues/new/choose).
2 changes: 1 addition & 1 deletion api/api_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api
import (
"context"

"github.com/filecoin-project/venus-miner/types"
"github.com/ipfs-force-community/sophon-miner/types"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
Expand Down
2 changes: 1 addition & 1 deletion api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/filecoin-project/go-jsonrpc"

"github.com/filecoin-project/venus-miner/api"
"github.com/ipfs-force-community/sophon-miner/api"
)

// NewCommonRPC creates a new http jsonrpc client.
Expand Down
2 changes: 1 addition & 1 deletion api/client/gateway_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/filecoin-project/go-jsonrpc"

"github.com/filecoin-project/venus-miner/node/config"
"github.com/ipfs-force-community/sophon-miner/node/config"

gatewayAPIV2 "github.com/filecoin-project/venus/venus-shared/api/gateway/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion api/client/submitblock_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/filecoin-project/go-jsonrpc"

"github.com/filecoin-project/venus-miner/node/config"
"github.com/ipfs-force-community/sophon-miner/node/config"

v1 "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
)
Expand Down
2 changes: 1 addition & 1 deletion api/docgen/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"

"github.com/filecoin-project/venus-miner/api"
"github.com/ipfs-force-community/sophon-miner/api"

sharedTypes "github.com/filecoin-project/venus/venus-shared/types"
)
Expand Down
40 changes: 22 additions & 18 deletions api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions cli/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (

"github.com/filecoin-project/go-jsonrpc"

"github.com/filecoin-project/venus-miner/api"
"github.com/filecoin-project/venus-miner/api/client"
"github.com/filecoin-project/venus-miner/node/config"
"github.com/filecoin-project/venus-miner/node/repo"
"github.com/ipfs-force-community/sophon-miner/api"
"github.com/ipfs-force-community/sophon-miner/api/client"
"github.com/ipfs-force-community/sophon-miner/node/config"
"github.com/ipfs-force-community/sophon-miner/node/repo"

v1 "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/urfave/cli/v2"

"github.com/filecoin-project/go-address"
lcli "github.com/filecoin-project/venus-miner/cli"
lcli "github.com/ipfs-force-community/sophon-miner/cli"
)

var addressCmd = &cli.Command{
Expand All @@ -25,7 +25,7 @@ var addressCmd = &cli.Command{

var updateCmd = &cli.Command{
Name: "update",
Usage: "reacquire address from venus-auth",
Usage: "reacquire address from sophon-auth",
Flags: []cli.Flag{
&cli.Int64Flag{
Name: "skip",
Expand Down
Loading

0 comments on commit 015ac66

Please sign in to comment.