Skip to content

Commit

Permalink
Merge pull request #60 from ipfs-force-community/chore/merge-release-…
Browse files Browse the repository at this point in the history
…v0.6

Chore/merge release v0.6
  • Loading branch information
LinZexiao authored Jul 10, 2023
2 parents 992628a + f5a0193 commit 53c3eb8
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 78 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

# v0.6.1

* fix: support MpoolGetConfig https://github.com/ipfs-force-community/sophon-co/pull/57

## v0.6.0

* bump uo version to v0.6.0

## v0.6.0-rc1

* fix: support MpoolGetConfig by @simlecode in https://github.com/ipfs-force-community/sophon-co/pull/51
* feat: rename the chain-co to sophon-co by @LinZexiao in https://github.com/ipfs-force-community/sophon-co/pull/54

## v0.5.1

* update ffi
Expand Down
8 changes: 5 additions & 3 deletions cmd/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ import (
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/v0api"
vapi "github.com/filecoin-project/venus/venus-shared/api"
"github.com/filecoin-project/venus/venus-shared/api/permission"
"github.com/ipfs-force-community/metrics"
"github.com/ipfs-force-community/metrics/ratelimit"
"github.com/ipfs-force-community/sophon-auth/core"
"github.com/ipfs-force-community/sophon-auth/jwtclient"
local_api "github.com/ipfs-force-community/sophon-co/cli/api"
apiInfo "github.com/ipfs-force-community/venus-common-utils/apiinfo"
logging "github.com/ipfs/go-log/v2"
"go.opencensus.io/plugin/ochttp"
)

func serveRPC(ctx context.Context, authApi apiInfo.APIInfo, rateLimitRedis, listen string, mCnf *metrics.TraceConfig, jwt jwtclient.IJwtAuthClient, full api.FullNode, localApi local_api.LocalAPI, stop dix.StopFunc, maxRequestSize int64) error {
func serveRPC(ctx context.Context, authApi vapi.APIInfo, rateLimitRedis, listen string, mCnf *metrics.TraceConfig, jwt jwtclient.IJwtAuthClient, full api.FullNode, localApi local_api.LocalAPI, stop dix.StopFunc, maxRequestSize int64) error {
serverOptions := []jsonrpc.ServerOption{}
if maxRequestSize > 0 {
serverOptions = append(serverOptions, jsonrpc.WithMaxRequestSize(maxRequestSize))
Expand All @@ -39,7 +40,8 @@ func serveRPC(ctx context.Context, authApi apiInfo.APIInfo, rateLimitRedis, list
remoteJwtCli, _ = jwtclient.NewAuthClient(authApi.Addr, string(authApi.Token))
}

pma := api.PermissionedFullAPI(full)
pma := new(api.FullNodeStruct)
permission.PermissionProxy(full, pma)
if len(rateLimitRedis) > 0 && remoteJwtCli != nil {
log.Infof("use rate limit %s", rateLimitRedis)
limiter, err := ratelimit.NewRateLimitHandler(
Expand Down
4 changes: 2 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"strings"

"github.com/ipfs-force-community/metrics"
apiInfo "github.com/ipfs-force-community/venus-common-utils/apiinfo"

"github.com/urfave/cli/v2"

"github.com/filecoin-project/lotus/api/v1api"
vapi "github.com/filecoin-project/venus/venus-shared/api"
local_api "github.com/ipfs-force-community/sophon-co/cli/api"

"github.com/ipfs-force-community/sophon-auth/jwtclient"
Expand Down Expand Up @@ -98,7 +98,7 @@ var runCmd = &cli.Command{
mCnf.ProbabilitySampler, mCnf.JaegerEndpoint, mCnf.ServerName = sampler, proxy, serverName
}

authApi := apiInfo.ParseApiInfo(cctx.String("auth"))
authApi := vapi.ParseApiInfo(cctx.String("auth"))

return serveRPC(
appCtx,
Expand Down
6 changes: 3 additions & 3 deletions co/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/filecoin-project/lotus/api/v1api"
"github.com/ipfs-force-community/venus-common-utils/apiinfo"
vapi "github.com/filecoin-project/venus/venus-shared/api"

"github.com/filecoin-project/go-jsonrpc"
"github.com/hashicorp/go-multierror"
Expand Down Expand Up @@ -42,13 +42,13 @@ type NodeOption struct {

// NodeInfo is a type combine cliutil.APIInfo and protocol version
type NodeInfo struct {
apiinfo.APIInfo
vapi.APIInfo
Version string
}

func NewNodeInfo(addr string, version string) NodeInfo {
return NodeInfo{
APIInfo: apiinfo.ParseApiInfo(addr),
APIInfo: vapi.ParseApiInfo(addr),
Version: version,
}
}
Expand Down
51 changes: 27 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ require (
github.com/filecoin-project/go-jsonrpc v0.2.1
github.com/filecoin-project/go-state-types v0.11.1
github.com/filecoin-project/lotus v1.22.0
github.com/filecoin-project/venus v1.12.0
github.com/golang/mock v1.6.0
github.com/google/uuid v1.3.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru v0.5.4
github.com/ipfs-force-community/metrics v1.0.1-0.20211022060227-11142a08b729
github.com/ipfs-force-community/sophon-auth v1.11.1-0.20230607031351-bc57c2b78f44
github.com/ipfs-force-community/venus-common-utils v0.0.0-20210714031758-ea0e25ff0ec4
github.com/ipfs-force-community/sophon-auth v1.12.0
github.com/ipfs/go-cid v0.3.2
github.com/ipfs/go-libipfs v0.4.1
github.com/ipfs/go-log/v2 v2.5.1
github.com/ipfs/go-metrics-interface v0.0.1
github.com/libp2p/go-libp2p v0.23.4
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.3
github.com/urfave/cli/v2 v2.16.3
github.com/whyrusleeping/pubsub v0.0.0-20190708150250-92bcb0691325
go.opencensus.io v0.23.0
go.uber.org/fx v1.17.1
go.uber.org/zap v1.23.0
golang.org/x/tools v0.1.12
golang.org/x/tools v0.6.0
)

require (
Expand All @@ -44,7 +44,8 @@ require (
github.com/akavel/rsrc v0.8.0 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/sonic v1.8.0 // indirect
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
Expand All @@ -54,8 +55,10 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/deepmap/oapi-codegen v1.3.13 // indirect
github.com/dgraph-io/badger/v2 v2.2007.3 // indirect
github.com/dgraph-io/badger/v3 v3.2011.1 // indirect
github.com/dgraph-io/ristretto v0.0.4-0.20210122082011-bb5d392ed82d // indirect
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349 // indirect
github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 // indirect
Expand All @@ -76,22 +79,23 @@ require (
github.com/filecoin-project/specs-actors/v6 v6.0.2 // indirect
github.com/filecoin-project/specs-actors/v7 v7.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gbrlsnchs/jwt/v3 v3.0.1 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.9.0 // indirect
github.com/gin-gonic/gin v1.9.1 // indirect
github.com/go-kit/log v0.2.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.11.2 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/go-redis/redis/v7 v7.0.0-beta // indirect
github.com/go-redis/redis_rate/v7 v7.0.1 // indirect
github.com/go-resty/resty/v2 v2.4.0 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
Expand Down Expand Up @@ -123,7 +127,7 @@ require (
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-merkledag v0.8.1 // indirect
github.com/ipfs/go-path v0.3.0 // indirect
github.com/ipfs/go-unixfs v0.4.0 // indirect
github.com/ipfs/go-unixfs v0.4.3 // indirect
github.com/ipfs/go-verifcid v0.0.2 // indirect
github.com/ipfs/interface-go-ipfs-core v0.7.0 // indirect
github.com/ipld/go-car v0.4.0 // indirect
Expand All @@ -138,8 +142,8 @@ require (
github.com/jinzhu/now v1.1.2 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.1.1 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-core v0.20.1 // indirect
Expand All @@ -148,7 +152,7 @@ require (
github.com/libp2p/go-openssl v0.1.0 // indirect
github.com/magefile/mage v1.11.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/miekg/dns v1.1.50 // indirect
Expand All @@ -168,11 +172,10 @@ require (
github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/nkovacs/streamquote v1.0.0 // indirect
github.com/onsi/gomega v1.17.0 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect
Expand All @@ -196,7 +199,7 @@ require (
github.com/subosito/gotenv v1.4.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/uber/jaeger-client-go v2.25.0+incompatible // indirect
github.com/ugorji/go/codec v1.2.9 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.1.0 // indirect
github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba // indirect
Expand All @@ -214,18 +217,18 @@ require (
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/dig v1.14.1 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.0.0-20220907140024-f12130a52804 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.81.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 53c3eb8

Please sign in to comment.