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(rpc): support set http proxy from env #9587

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Halimao
Copy link

@Halimao Halimao commented Jun 26, 2024

Description

This PR supports setting HTTP proxy through environment variables like GLOBAL_AGENT_HTTP_PROXY.

Motivation

When I ran the following commands,

alias inter="yarn run --silent agops inter"
export AGORIC_NET=main
inter --help

Always give me errors:

(Error#1)
Error#1: cannot get network config (main): request to https://main.agoric.net/network-config failed, reason: read ECONNRESET

  at file:///home/xxx/Agoric/agoric-sdk/packages/agoric-cli/src/lib/rpc.js:43:11
  at async file:///xxx/Agoric/agoric-sdk/packages/agoric-cli/src/lib/rpc.js:52:23

I know this is due to a network problem, my network has a lot of limits, but we can use an HTTP proxy to fix the issue.

Documentation Considerations

If this PR is ok with you, we can add a doc to tell users how to set the HTTP proxy if they are facing a network issue like me

Testing Considerations

There are test cases that ensure old functions work well.

This PR only affects when an env var like GLOBAL_AGENT_HTTP_PROXY is set. After I set the GLOBAL_AGENT_HTTP_PROXY value, now it works for me:

Usage: bin-agops.js inter [options] [command]

Inter Protocol commands for liquidation bidding etc.

Options:
  --home <dir>                      agd CosmosSDK application home directory
  --fees <amount>                   set fees for transaction broadcast (e.g. 5000ubld)
  --keyring-backend <os|file|test>  keyring's backend (os|file|test) (default "os")
  -h, --help                        display help for command

Commands:
  auction                           auction commands
  bid                               auction bidding commands
  vbank                             vbank asset commands
  help [command]                    display help for command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant