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

fix: test #59

Merged
merged 1 commit into from
Jul 5, 2023
Merged
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
4 changes: 2 additions & 2 deletions cmd/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +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 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
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ require (
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.12.0
github.com/ipfs-force-community/venus-common-utils v0.0.0-20210714031758-ea0e25ff0ec4
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
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,6 @@ github.com/ipfs-force-community/sophon-auth v1.12.0 h1:nqjsA6bIv9Rd9+7lHxGDvNJ7g
github.com/ipfs-force-community/sophon-auth v1.12.0/go.mod h1:cGYCfjA/BDB/Km9P7Za6t1hmwpFlPKf8ho/CHmLG81Y=
github.com/ipfs-force-community/venus-auth v0.0.0-20210409095239-6767c8e7ac9f/go.mod h1:1jzX/6nT1UiBC0p2BuA1ujKFnZwPndZhmOB89Nemd+w=
github.com/ipfs-force-community/venus-auth v0.0.0-20210409103353-0d08847b2a79/go.mod h1:1jzX/6nT1UiBC0p2BuA1ujKFnZwPndZhmOB89Nemd+w=
github.com/ipfs-force-community/venus-common-utils v0.0.0-20210714031758-ea0e25ff0ec4 h1:WinGXFDwEGr9GJJSWwC4XXCruQ4EHV9QpnlRPDtjOkk=
github.com/ipfs-force-community/venus-common-utils v0.0.0-20210714031758-ea0e25ff0ec4/go.mod h1:AWIt7L1UiUeIzqQdjQ/quZcVcCdnr6GXabGLBgEIMzU=
github.com/ipfs-force-community/venus-messager v0.0.0-20210413021844-e36c2596dbc1/go.mod h1:f5YGVE13fjEiR073vISxmyEdMXUyrdQqyaE+m6yKlZ4=
github.com/ipfs-force-community/venus-wallet v0.0.0-20210222095647-d0fab90dc77f/go.mod h1:7pzkUzgqrHOQQSewIwvCuDzahMFJgaqx3pkLt/5yyI8=
github.com/ipfs-force-community/venus-wallet v0.0.0-20210310055425-c7247d399ba3/go.mod h1:o6dAgS1F3+TvAKAQyQf3fgdzQonFr9BVUMrcPubgPJE=
Expand Down