-
Notifications
You must be signed in to change notification settings - Fork 154
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
rpc: use SOCKS5 proxy if configured #1294
Conversation
chain/chain.go
Outdated
// operate on the same decred network as described by the passed chain | ||
// parameters, the connection will be disconnected. If proxypath is not empty, | ||
// it will be used to connect. | ||
func NewClient(chainParams *chaincfg.Params, connect, user, pass string, certs []byte, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If NewClientConfig is exported, I don't see any reason to also include this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One reason is that any caller of NewRPCClientConfig will need to import dcrrpcclient package, and any user of NewRPCClient can simply update to using NewClient (with SOCKS support) without changing too much code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a transient dependency anyways, making it an explicit import doesn't change anything and adds less cruft to the public API.
chain/chain.go
Outdated
|
||
// NewClientConfig creates a client connection to the server described by the | ||
// passed chainParams and connConfig | ||
func NewClientConfig(chainParams *chaincfg.Params, connConfig *dcrrpcclient.ConnConfig) (*RPCClient, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: can you rename this to NewRPCClientConfig for more similarity with the existing NewRPCClient?
There are config options and flags that currently exist for using SOCKS proxy, but don't do anything.
This exports
NewRPCClientConfig
, which creates an RPC Client to thechain
package and uses it in dcrwallet command.NewRPCClientConfig
accepts adcrrpcclient.ConnConfig
for even more precise configurationResolves #1287