@@ -18,8 +18,10 @@ import (
18
18
// NewCommonRPCV0 creates a new http jsonrpc client.
19
19
func NewCommonRPCV0 (ctx context.Context , addr string , requestHeader http.Header ) (api.CommonNet , jsonrpc.ClientCloser , error ) {
20
20
var res v0api.CommonNetStruct
21
- closer , err := jsonrpc .NewMergeClient (ctx , addr , "Filecoin" ,
22
- api .GetInternalStructs (& res ), requestHeader , jsonrpc .WithErrors (api .RPCErrors ))
21
+ // todo: add api.RPCErrors
22
+ // closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
23
+ // api.GetInternalStructs(&res), requestHeader, jsonrpc.WithErrors(api.RPCErrors))
24
+ closer , err := jsonrpc .NewMergeClient (ctx , addr , "Filecoin" , api .GetInternalStructs (& res ), requestHeader )
23
25
24
26
return & res , closer , err
25
27
}
@@ -28,17 +30,23 @@ func NewCommonRPCV0(ctx context.Context, addr string, requestHeader http.Header)
28
30
func NewFullNodeRPCV0 (ctx context.Context , addr string , requestHeader http.Header ) (v0api.FullNode , jsonrpc.ClientCloser , error ) {
29
31
var res v0api.FullNodeStruct
30
32
33
+ // todo: add api.RPCErrors
34
+ // closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
35
+ // api.GetInternalStructs(&res), requestHeader, jsonrpc.WithErrors(api.RPCErrors))
31
36
closer , err := jsonrpc .NewMergeClient (ctx , addr , "Filecoin" ,
32
- api .GetInternalStructs (& res ), requestHeader , jsonrpc . WithErrors ( api . RPCErrors ) )
37
+ api .GetInternalStructs (& res ), requestHeader )
33
38
34
39
return & res , closer , err
35
40
}
36
41
37
42
// NewFullNodeRPCV1 creates a new http jsonrpc client.
38
43
func NewFullNodeRPCV1 (ctx context.Context , addr string , requestHeader http.Header , opts ... jsonrpc.Option ) (api.FullNode , jsonrpc.ClientCloser , error ) {
39
44
var res v1api.FullNodeStruct
45
+ // todo: add api.RPCErrors
46
+ // closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
47
+ // api.GetInternalStructs(&res), requestHeader, append([]jsonrpc.Option{jsonrpc.WithErrors(api.RPCErrors)}, opts...)...)
40
48
closer , err := jsonrpc .NewMergeClient (ctx , addr , "Filecoin" ,
41
- api .GetInternalStructs (& res ), requestHeader , append ([]jsonrpc. Option { jsonrpc . WithErrors ( api . RPCErrors )}, opts ... ) ... )
49
+ api .GetInternalStructs (& res ), requestHeader )
42
50
43
51
return & res , closer , err
44
52
}
@@ -68,11 +76,17 @@ func NewStorageMinerRPCV0(ctx context.Context, addr string, requestHeader http.H
68
76
}
69
77
70
78
var res v0api.StorageMinerStruct
79
+ // todo: add api.RPCErrors
80
+ // closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
81
+ // api.GetInternalStructs(&res), requestHeader,
82
+ // append([]jsonrpc.Option{
83
+ // rpcenc.ReaderParamEncoder(pushUrl),
84
+ // jsonrpc.WithErrors(api.RPCErrors),
85
+ // }, opts...)...)
71
86
closer , err := jsonrpc .NewMergeClient (ctx , addr , "Filecoin" ,
72
87
api .GetInternalStructs (& res ), requestHeader ,
73
88
append ([]jsonrpc.Option {
74
89
rpcenc .ReaderParamEncoder (pushUrl ),
75
- jsonrpc .WithErrors (api .RPCErrors ),
76
90
}, opts ... )... )
77
91
78
92
return & res , closer , err
@@ -85,13 +99,22 @@ func NewWorkerRPCV0(ctx context.Context, addr string, requestHeader http.Header)
85
99
}
86
100
87
101
var res api.WorkerStruct
102
+ // todo: add api.RPCErrors
103
+ // closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
104
+ // api.GetInternalStructs(&res),
105
+ // requestHeader,
106
+ // rpcenc.ReaderParamEncoder(pushUrl),
107
+ // jsonrpc.WithNoReconnect(),
108
+ // jsonrpc.WithTimeout(30*time.Second),
109
+ // jsonrpc.WithErrors(api.RPCErrors),
110
+ // )
88
111
closer , err := jsonrpc .NewMergeClient (ctx , addr , "Filecoin" ,
89
112
api .GetInternalStructs (& res ),
90
113
requestHeader ,
91
114
rpcenc .ReaderParamEncoder (pushUrl ),
92
115
jsonrpc .WithNoReconnect (),
93
116
jsonrpc .WithTimeout (30 * time .Second ),
94
- jsonrpc .WithErrors (api .RPCErrors ),
117
+ // jsonrpc.WithErrors(api.RPCErrors),
95
118
)
96
119
97
120
return & res , closer , err
@@ -100,10 +123,16 @@ func NewWorkerRPCV0(ctx context.Context, addr string, requestHeader http.Header)
100
123
// NewGatewayRPCV1 creates a new http jsonrpc client for a gateway node.
101
124
func NewGatewayRPCV1 (ctx context.Context , addr string , requestHeader http.Header , opts ... jsonrpc.Option ) (api.Gateway , jsonrpc.ClientCloser , error ) {
102
125
var res api.GatewayStruct
126
+ // todo: add api.RPCErrors
127
+ // closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
128
+ // api.GetInternalStructs(&res),
129
+ // requestHeader,
130
+ // append(opts, jsonrpc.WithErrors(api.RPCErrors))...,
131
+ // )
103
132
closer , err := jsonrpc .NewMergeClient (ctx , addr , "Filecoin" ,
104
133
api .GetInternalStructs (& res ),
105
134
requestHeader ,
106
- append ( opts , jsonrpc . WithErrors ( api . RPCErrors )) ... ,
135
+ opts ... ,
107
136
)
108
137
109
138
return & res , closer , err
@@ -112,21 +141,32 @@ func NewGatewayRPCV1(ctx context.Context, addr string, requestHeader http.Header
112
141
// NewGatewayRPCV0 creates a new http jsonrpc client for a gateway node.
113
142
func NewGatewayRPCV0 (ctx context.Context , addr string , requestHeader http.Header , opts ... jsonrpc.Option ) (v0api.Gateway , jsonrpc.ClientCloser , error ) {
114
143
var res v0api.GatewayStruct
144
+ // todo: add api.RPCErrors
145
+ // closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
146
+ // api.GetInternalStructs(&res),
147
+ // requestHeader,
148
+ // append(opts, jsonrpc.WithErrors(api.RPCErrors))...,
149
+ // )
115
150
closer , err := jsonrpc .NewMergeClient (ctx , addr , "Filecoin" ,
116
151
api .GetInternalStructs (& res ),
117
152
requestHeader ,
118
- append ( opts , jsonrpc . WithErrors ( api . RPCErrors )) ... ,
153
+ opts ... ,
119
154
)
120
155
121
156
return & res , closer , err
122
157
}
123
158
124
159
func NewWalletRPCV0 (ctx context.Context , addr string , requestHeader http.Header ) (api.Wallet , jsonrpc.ClientCloser , error ) {
125
160
var res api.WalletStruct
161
+ // todo: add api.RPCErrors
162
+ // closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
163
+ // api.GetInternalStructs(&res),
164
+ // requestHeader,
165
+ // jsonrpc.WithErrors(api.RPCErrors),
166
+ // )
126
167
closer , err := jsonrpc .NewMergeClient (ctx , addr , "Filecoin" ,
127
168
api .GetInternalStructs (& res ),
128
169
requestHeader ,
129
- jsonrpc .WithErrors (api .RPCErrors ),
130
170
)
131
171
132
172
return & res , closer , err
0 commit comments