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

Feat/make chain head local #6

Open
wants to merge 121 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
160b348
add blk number
hunjixin Jul 15, 2021
88a018d
add auth and local jwt auth
hunjixin Jul 16, 2021
dd37323
update API & version
ta0li Jul 16, 2021
886fece
Merge pull request #1 from ipfs-force-community/feat/upgrade_api
diwufeiwen Jul 20, 2021
f5c8bed
fix deadlock and add venus api
hunjixin Jul 31, 2021
66fdf7b
fix deadlock and add venus api
hunjixin Aug 2, 2021
83fc4e8
add support api
hunjixin Aug 2, 2021
df73440
add support api
hunjixin Aug 2, 2021
bcce067
add support api
hunjixin Aug 3, 2021
d1c9e99
add support api
hunjixin Aug 3, 2021
57ff897
add support api
hunjixin Aug 3, 2021
e452f09
add support api
hunjixin Aug 3, 2021
35b8736
update version
hunjixin Aug 3, 2021
2730d03
update version
hunjixin Aug 3, 2021
0648bd7
add trace
hunjixin Aug 3, 2021
96c318b
add trace
hunjixin Aug 3, 2021
8746645
log for rate limit
hunjixin Aug 3, 2021
90bb760
fix trace and limit wrapper
hunjixin Aug 3, 2021
99a33f8
change log
hunjixin Aug 3, 2021
b0d6ed7
fix wrap v0 api
hunjixin Aug 4, 2021
2db673f
support mpoolpush
hunjixin Aug 5, 2021
db8ff5c
support mpoolpush
hunjixin Aug 5, 2021
f0c7a28
each version of the API uses a different rpcserver
simlecode Oct 9, 2021
7e8c41d
Merge pull request #2 from ipfs-force-community/fix/rpc_server
hunjixin Oct 9, 2021
edbfc98
update chain-co
hunjixin Oct 11, 2021
824d0f4
remove addr immediatly while error
hunjixin Oct 11, 2021
f255c76
fix error format
hunjixin Nov 10, 2021
ffac58e
expose jaeger related flags
simlecode Nov 17, 2021
6877980
Merge pull request #4 from ipfs-force-community/fix/expose_jaeger_flags
hunjixin Nov 17, 2021
617cbd1
update go jsonrpc
hunjixin Nov 30, 2021
00d4430
Merge branch 'master' of github.com:ipfs-force-community/chain-co
hunjixin Nov 30, 2021
0011cb4
fix backoff overflow
hunjixin Dec 1, 2021
d39eca6
print version
simlecode Dec 13, 2021
a30101d
Merge pull request #5 from ipfs-force-community/feat/print_version
simlecode Dec 29, 2021
85e51b9
add workflows
simlecode Dec 28, 2021
69785cb
Merge pull request #6 from simlecode/feat/add_workflows
simlecode Jan 6, 2022
6c0e3c5
export MpoolPending/MpoolGetNonce api
hunjixin Jan 7, 2022
8254ad0
fix action
simlecode Jan 13, 2022
74f16c5
Merge pull request #7 from ipfs-force-community/fix/action
simlecode Jan 13, 2022
daa5649
update lotus version
hunjixin Jan 13, 2022
6add050
update readme for move issue
hunjixin Jan 20, 2022
c3cfbab
update
hunjixin Feb 10, 2022
65a28f4
update lotus to v1.14.0
hunjixin Feb 18, 2022
5ce8439
improve build behavior
hunjixin Feb 21, 2022
8f56472
improve build behavior
hunjixin Feb 21, 2022
279c5e8
change position to avoid conflict with exec name
hunjixin Feb 21, 2022
8ad9c76
update version
simlecode Feb 21, 2022
63e3153
Merge pull request #9 from ipfs-force-community/prep/v0.1.0
simlecode Feb 21, 2022
76d561a
ignore chain-ro
simlecode Feb 23, 2022
6bca10a
update git workflow
simlecode Feb 23, 2022
455a465
Merge pull request #10 from ipfs-force-community/fix/update_git_workflow
hunjixin Feb 23, 2022
fc29ad7
resolve conflict
hunjixin Feb 25, 2022
45551d7
update filecoin-ffi
hunjixin Feb 25, 2022
fa36f6e
Merge pull request #8 from ipfs-force-community/upgrade/nv15
hunjixin Feb 25, 2022
f2aff5e
fix makefile commit
hunjixin Mar 11, 2022
561b1e7
Merge pull request #11 from ipfs-force-community/feat/fix_makefile_ve…
hunjixin Mar 11, 2022
c45edf4
chore: upgrade lotus
simlecode Jun 2, 2022
180cc41
chore: upgrade venus-auth
simlecode Jun 7, 2022
fdb31c1
fix: support MpoolBatchPush
simlecode Jun 8, 2022
3590423
chore: remove .vscode
simlecode Jun 8, 2022
4020971
ci: upgrade golangci-lint version to v1.44.2
simlecode Jun 8, 2022
f43ef1a
fix: use fmt.Errorf instead of xerrors.Errorf
simlecode Jun 8, 2022
baf1fba
ci: set go version to v1.17
simlecode Jun 8, 2022
75d7591
ci: remove gcc
simlecode Jun 8, 2022
69b16bc
ci: update golangci-lint.yml
simlecode Jun 8, 2022
0e1f0a3
chore: upgrade lotus
simlecode Jun 15, 2022
d000a5f
build: bump version to v0.1.1-rc1
simlecode Jun 15, 2022
9340a27
chore: Removing local dependencies
simlecode Jun 15, 2022
0f07816
chore: upgrade lotus
simlecode Jun 27, 2022
5581020
chore: bump version to v0.1.1
simlecode Jun 28, 2022
1030eb1
chore: fix error msg
simlecode Jun 28, 2022
14123d4
fix: add ctx to loadTipSet
simlecode Jun 28, 2022
4f71aba
Merge pull request #13 from ipfs-force-community/prep/v0.1.1
hunjixin Jun 28, 2022
d9f34dc
chore: add GasOverPremium for MessageSendSpec
simlecode Jul 13, 2022
bae42cd
Merge pull request #14 from ipfs-force-community/chore/upgrade_lotus
hunjixin Jul 13, 2022
b780f91
ci: split git workflow
simlecode Aug 8, 2022
2b1deb6
Merge pull request #15 from ipfs-force-community/ci/split_workflow
zl03jsj Aug 9, 2022
fbcba42
feat: use auth client from auth
LinZexiao Aug 25, 2022
b2990fa
feat: change binary name
LinZexiao Aug 25, 2022
0ddb8d2
Merge pull request #16 from ipfs-force-community/feat/tanlang/unify-a…
simlecode Aug 25, 2022
db59b56
fix: return the err of app fail
LinZexiao Sep 28, 2022
5dbb093
feat: make all node info to be recorded as a node
LinZexiao Sep 28, 2022
8875869
style: better comment and impl which replace goto
LinZexiao Oct 8, 2022
39a7d98
Merge pull request #17 from ipfs-force-community/feat/tanlang/add-abi…
hunjixin Oct 9, 2022
9e28a07
feat: add weight of node for select
LinZexiao Nov 1, 2022
018013a
feat: add node provider and uni test
LinZexiao Nov 1, 2022
d07c009
feat: add priority que
LinZexiao Nov 2, 2022
f213f9b
feat: add client and local rpc server
LinZexiao Nov 2, 2022
f0a24fd
feat: add log of select
LinZexiao Nov 2, 2022
4f9972b
fix: fix lint error
LinZexiao Nov 2, 2022
b13b198
feat: set level of log for priority as debug
LinZexiao Nov 3, 2022
a84de65
feat: change nodeProvider as node store
LinZexiao Nov 3, 2022
f58fd47
fix: change local api service route
LinZexiao Nov 3, 2022
187e5f8
feat: delete key of state when reach balance
LinZexiao Nov 3, 2022
2394301
fix: fix log level of select node
LinZexiao Nov 3, 2022
751b1c2
Merge pull request #20 from ipfs-force-community/feat/tanlang/add-fea…
simlecode Nov 11, 2022
4c53330
chore: update ffi
simlecode Oct 19, 2022
76844e8
chore: add proxy-gen to Makefile
simlecode Oct 19, 2022
dfb6ceb
chore: update lotus to v1.18.0-rc3
simlecode Oct 19, 2022
a34aeba
chore: ignore chain-ro
simlecode Oct 27, 2022
4795d76
chore: format code
simlecode Oct 27, 2022
f426dd2
chore: update to lotus v1.18.0-rc5
simlecode Nov 3, 2022
4193114
chore: update to version v0.2.0
simlecode Nov 4, 2022
127e288
chore: remove deprecated api
simlecode Nov 4, 2022
f9d6cfc
refactor: refactor gen package
simlecode Nov 15, 2022
a841aa5
chore: remove mock package
simlecode Nov 15, 2022
34eda17
chore: use go 1.18
simlecode Nov 15, 2022
5e958de
chore: upgrade lotus & venus-auth
simlecode Nov 16, 2022
1c0b9a3
Merge pull request #22 from ipfs-force-community/release/v0.2.0
diwufeiwen Nov 16, 2022
be22ce1
feat: eusure tipset exit
hunjixin Nov 11, 2022
482099e
feat: make lint happy
hunjixin Nov 11, 2022
ba848eb
fix: generate local proxy
simlecode Dec 8, 2022
cc8c8d7
chore: upgrade go-jsonrpc
simlecode Dec 8, 2022
b6907e9
chore: bump version to v0.3.0-rc1
simlecode Dec 19, 2022
df76fab
docs: add CHANGELOG.md
simlecode Dec 19, 2022
12cfe7e
Merge pull request #25 from ipfs-force-community/v0.3.0-pre-rc
hunjixin Dec 19, 2022
4d653e0
chore: bump version to v0.3.0
simlecode Jan 4, 2023
d95a39c
Merge pull request #26 from ipfs-force-community/chore/bump-version
hunjixin Jan 4, 2023
b48da15
feat: rm docker ci
LinZexiao Jan 4, 2023
5cd13d3
Merge pull request #27 from ipfs-force-community/feat/tanlang/rm-dock…
simlecode Jan 4, 2023
4ef5149
feat: make ChainHead api local
hunjixin Jan 17, 2023
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
23 changes: 23 additions & 0 deletions .github/workflows/build_upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build and upload

on:
push:
branches: ['prep/**', 'release/**', 'test/**', master]
tags: ['**']

jobs:
build_upload:
uses: filecoin-project/venus/.github/workflows/common_build_upload.yml@master
with:
bin_name: 'chain-co'
has_ffi: true
secrets:
OSS_KEY_ID: ${{secrets.OSS_KEY_ID}}
OSS_KEY_SECRET: ${{secrets.OSS_KEY_SECRET}}
OSS_ENDPOINT: ${{secrets.OSS_ENDPOINT}}
OSS_BUCKET: ${{secrets.OSS_BUCKET}}
FTP_HOST: ${{secrets.FTP_HOST}}
FTP_USER: ${{secrets.FTP_USER}}
FTP_PWD: ${{secrets.FTP_PWD}}
GODEYE_URL: ${{secrets.GODEYE_URL}}
token: ${{github.token}}
15 changes: 15 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Go

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
check:
uses: filecoin-project/venus/.github/workflows/common_go.yml@master
with:
has_ffi: true
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
/build
/tmp-clone
/bin
.idea
token
chain-co
chain-ro
.vscode
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## v0.3.0

- 修复节点状态不一致导致区块找不到 [[#24](https://github.com/ipfs-force-community/chain-co/pull/24)]
71 changes: 37 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,65 +1,68 @@
FFI_PATH:=extern/filecoin-ffi/
FFI_DEPS:=.install-filcrypto
FFI_DEPS:=$(addprefix $(FFI_PATH),$(FFI_DEPS))
all: build
.PHONY: all

$(FFI_DEPS): build-dep/.filecoin-install ;
## variables

# git modules that need to be loaded
MODULES:=

CLEAN:=
BINS:=

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/ipfs-force-community/chain-co/version.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:=.install-filcrypto
FFI_DEPS:=$(addprefix $(FFI_PATH),$(FFI_DEPS))

$(FFI_DEPS): build-dep/.filecoin-install ;

build-dep/.filecoin-install: $(FFI_PATH)
$(MAKE) -C $(FFI_PATH) $(FFI_DEPS:$(FFI_PATH)%=%)
@touch $@
$(MAKE) -C $(FFI_PATH) $(FFI_DEPS:$(FFI_PATH)%=%)
@touch $@

MODULES+=$(FFI_PATH)
BUILD_DEPS+=build-dep/.filecoin-install
CLEAN+=build-dep/.filecoin-install

link-build-dir:
./scripts/link-build.sh
BUILD_DEPS+=link-build-dir

$(MODULES): build-dep/.update-modules ;
## modules
build-dep:
mkdir $@

$(MODULES): build-dep/.update-modules;
# dummy file that marks the last time modules were updated
build-dep/.update-modules:
build-dep/.update-modules: build-dep;
git submodule update --init --recursive
touch $@

CLEAN+=build-dep/.update-modules
## build

test: $(BUILD_DEPS)
go test -v -failfast ./...
test:
go test -race ./...

lint: $(BUILD_DEPS)
golint --set_exit_status `go list ./... | grep -v /extern/ | grep -v /proxy$$`

deps: $(BUILD_DEPS)

dep-check: build-dep/.update-modules
./tool/scripts/submodule-check.sh
golangci-lint run

dist-clean:
git clean -xdff
git submodule deinit --all -f

gen-proxy:
go run scripts/proxy-gen.go
build: $(BUILD_DEPS)
rm -f chain-co
go build -o ./chain-co $(GOFLAGS) ./cmd

proxy-gen:
go run ./gen/proxy
.PHONY: proxy-gen

build-ro: $(BUILD_DEPS)
mkdir -p ./bin
rm -f ./bin/chain-ro
go build $(GOFLAGS) -o ./bin/chain-ro ./chain-ro/cmd
go run github.com/GeertJohan/go.rice/rice append --exec ./bin/chain-ro -i ./build
perm-gen:
go run ./gen/perm
.PHONY: perm-gen

.PHONY: lotus
BINS+=lotus
gen-all: proxy-gen perm-gen
go generate ./...
.PHONY: gen-all
17 changes: 17 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Chain-co

This project is used to proxy multiple daemon(venus/lotus) programs. The difference from other proxy(nginx) is that chain-co can automatically select the best daemon to access.

Use [Venus Issues](https://github.com/filecoin-project/venus/issues) for reporting issues about this repository.

## Quick Start

build
```shell
make
```

start
```shell
./chain-co --auth-url <venus-auth url> --node <token>:<url> --node <token>:<url>
```
Loading