-
Notifications
You must be signed in to change notification settings - Fork 18
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: add Polygon, Base mainnet and test in the network list #55
Conversation
WalkthroughThis update enhances the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- data/networks.json (1 hunks)
Additional comments not posted (19)
data/networks.json (19)
3-3
: Verify thechain_id
forbase_mainnet
.Ensure that the
chain_id
of 8453 is correct and consistent with the official Base Mainnet documentation.
4-10
: Ensure consistency inchain_aliases
.The aliases should be consistent with naming conventions and documentation. Verify that all aliases are accurate and relevant.
12-12
: Confirm thechain_name
forbase_mainnet
.Ensure that "Base Mainnet" is the correct and official name for this network.
13-21
: Review the fee structure forbase_mainnet
.Ensure that the gas and gas price values are accurate and reflect the current network conditions.
22-37
: Verify the asset definitions forbase_mainnet
.Ensure that the denominations and their exponents are correct. Confirm that "ETH" is the appropriate symbol for the base asset.
38-46
: Validate the API endpoints forbase_mainnet
.Ensure that the provided URLs are correct and functional. Verify that they point to the appropriate EVM-compatible endpoints.
50-50
: Verify thechain_id
forbase_testnet
.Ensure that the
chain_id
of 84532 is correct and consistent with the official Base Testnet documentation.
51-61
: Ensure consistency inchain_aliases
.The aliases should be consistent with naming conventions and documentation. Verify that all aliases are accurate and relevant.
63-63
: Confirm thechain_name
forbase_testnet
.Ensure that "Base Sepolia Testnet" is the correct and official name for this network.
64-71
: Review the fee structure forbase_testnet
.Ensure that the gas and gas price values are accurate and reflect the current network conditions.
73-87
: Verify the asset definitions forbase_testnet
.Ensure that the denominations and their exponents are correct. Confirm that "ETH" is the appropriate symbol for the base asset.
89-97
: Validate the API endpoints forbase_testnet
.Ensure that the provided URLs are correct and functional. Verify that they point to the appropriate EVM-compatible endpoints.
101-101
: Verify thechain_id
forpolygon_mainnet
.Ensure that the
chain_id
of 137 is correct and consistent with the official Polygon Mainnet documentation.
102-108
: Ensure consistency inchain_aliases
.The aliases should be consistent with naming conventions and documentation. Verify that all aliases are accurate and relevant.
111-111
: Confirm thechain_name
forpolygon_mainnet
.Ensure that "Polygon PoS Mainnet" is the correct and official name for this network.
112-119
: Review the fee structure forpolygon_mainnet
.Ensure that the gas and gas price values are accurate and reflect the current network conditions.
121-135
: Verify the asset definitions forpolygon_mainnet
.Ensure that the denominations and their exponents are correct. Confirm that "POL" is the appropriate symbol for the base asset.
137-143
: Validate the explorer configuration forpolygon_mainnet
.Ensure that the explorer URLs and placeholders for transactions and addresses are correct.
145-153
: Validate the API endpoints forpolygon_mainnet
.Ensure that the provided URLs are correct and functional. Verify that they point to the appropriate EVM-compatible endpoints.
I would add explorers, but other than that, looks good. |
CI error looks unrelated to the change |
Co-authored-by: Denis Fadeev <denis@fadeev.org>
Co-authored-by: Denis Fadeev <denis@fadeev.org>
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
data/networks.json (1)
162-168
: Update the Ankr URL and note the correct usage for BlockPI endpoint
- The Ankr URL should be updated to
https://www.ankr.com/rpc/polygon/
in thenetworks.json
file.- The BlockPI endpoint
https://polygon.blockpi.network/v1/rpc/public
should be used with POST requests, not GET requests.Code Changes Needed:
- Update the Ankr URL in
networks.json
:{ "url": "https://www.ankr.com/rpc/polygon/", "type": "evm" }Category:
Analysis chain
Verify the API endpoints.
Ensure that the API endpoints for
polygon_mainnet
are correct and functional.
To verify the API endpoints more thoroughly, we need to follow the redirect for the 301 status code and identify the allowed methods for the endpoint returning a 405 status code.
To complete the verification, we need to test the functionality of the new Ankr URL and the
GET
andPOST
methods for the BlockPI endpoint.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the API endpoints for `polygon_mainnet`. # Test: Check if the URLs are reachable. Expect: HTTP status 200. curl -o /dev/null -s -w "%{http_code}\n" https://polygon.blockpi.network/v1/rpc/public curl -o /dev/null -s -w "%{http_code}\n" https://rpc.ankr.com/polygonLength of output: 168
Script:
#!/bin/bash # Description: Follow the redirect for the 301 status code and identify allowed methods for the 405 status code. # Follow the redirect for the 301 status code. new_url=$(curl -s -o /dev/null -w "%{redirect_url}" https://rpc.ankr.com/polygon) echo "Redirected URL for https://rpc.ankr.com/polygon: $new_url" # Identify allowed methods for the 405 status code. allowed_methods=$(curl -s -I -X OPTIONS https://polygon.blockpi.network/v1/rpc/public | grep 'allow' | awk '{print $2}') echo "Allowed methods for https://polygon.blockpi.network/v1/rpc/public: $allowed_methods"Length of output: 685
Script:
#!/bin/bash # Description: Verify the functionality of the new Ankr URL and test the GET and POST methods for the BlockPI endpoint. # Test the new Ankr URL. curl -o /dev/null -s -w "%{http_code}\n" https://www.ankr.com/rpc/polygon/ # Test the GET method for the BlockPI endpoint. curl -o /dev/null -s -w "%{http_code}\n" -X GET https://polygon.blockpi.network/v1/rpc/public # Test the POST method for the BlockPI endpoint with a sample payload. curl -o /dev/null -s -w "%{http_code}\n" -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' https://polygon.blockpi.network/v1/rpc/publicLength of output: 386
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- data/networks.json (1 hunks)
Additional comments not posted (5)
data/networks.json (5)
155-158
: Verify the explorer URL.Ensure that the explorer URL
https://polygonscan.com
is correct and functional.Verification successful
Verify the API endpoints for transactions and addresses.
Ensure that the API endpoints
/tx/${tx}
and/address/${address}
are correctly formed and functional.
Verification successful.
The explorer URL
https://polygonscan.com
and the API endpoints/tx/${tx}
and/address/${address}
are correctly formed and functional, as confirmed by HTTP status 200 responses.
https://polygonscan.com
/tx/${tx}
/address/${address}
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the explorer URL for `polygon_mainnet`. # Test: Check if the URL is reachable. Expect: HTTP status 200. curl -o /dev/null -s -w "%{http_code}\n" https://polygonscan.comLength of output: 70
Script:
#!/bin/bash # Description: Verify the API endpoints for `polygon_mainnet`. # Test: Check if the transaction endpoint is reachable. Expect: HTTP status 200. tx_endpoint="https://polygonscan.com/tx/0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" curl -o /dev/null -s -w "%{http_code}\n" "$tx_endpoint" # Test: Check if the address endpoint is reachable. Expect: HTTP status 200. address_endpoint="https://polygonscan.com/address/0x1234567890abcdef1234567890abcdef12345678" curl -o /dev/null -s -w "%{http_code}\n" "$address_endpoint"Length of output: 464
48-54
: Verify the API endpoints.Ensure that the API endpoints for
base_mainnet
are correct and functional.Verification successful
Both API endpoints are functional.
- The endpoint
https://base.blockpi.network/v1/rpc/public
returned a status code of 200 when checked for allowed methods.- The endpoint
https://rpc.ankr.com/base
returned a status code of 200 after following redirects.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the API endpoints for `base_mainnet`. # Test: Check if the URLs are reachable. Expect: HTTP status 200. curl -o /dev/null -s -w "%{http_code}\n" https://base.blockpi.network/v1/rpc/public curl -o /dev/null -s -w "%{http_code}\n" https://rpc.ankr.com/baseLength of output: 162
Script:
#!/bin/bash # Description: Verify the API endpoints for `base_mainnet`. # Test: Check if the URLs are reachable. Expect: HTTP status 200. # Follow redirects and check final status code for the second URL curl -o /dev/null -s -w "%{http_code}\n" -L https://rpc.ankr.com/base # Check allowed methods for the first URL curl -o /dev/null -s -w "%{http_code}\n" -X OPTIONS https://base.blockpi.network/v1/rpc/publicLength of output: 176
100-103
: Verify the explorer URL.Ensure that the explorer URL
https://sepolia.basescan.org/
is correct and functional.Verification successful
Verify the API endpoints.
Ensure that the API endpoints
/tx/${tx}
and/address/${address}
are correctly formatted and functional.
Verification Summary:
The explorer URL
https://sepolia.basescan.org/
is reachable and returns HTTP status 200, indicating it is functional.The address endpoint
/address/${address}
is correctly formatted and functional, returning HTTP status 200.The transaction endpoint
/tx/${tx}
returns HTTP status 302, indicating a redirection. This suggests the endpoint exists but may require further verification to ensure it redirects correctly to the intended resource.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the explorer URL for `base_testnet`. # Test: Check if the URL is reachable. Expect: HTTP status 200. curl -o /dev/null -s -w "%{http_code}\n" https://sepolia.basescan.org/Length of output: 76
Script:
#!/bin/bash # Description: Verify the API endpoints for `base_testnet`. # Test: Check if the transaction endpoint is reachable. Expect: HTTP status 200. tx_url="https://sepolia.basescan.org/tx/sample_tx_id" curl -o /dev/null -s -w "%{http_code}\n" $tx_url # Test: Check if the address endpoint is reachable. Expect: HTTP status 200. address_url="https://sepolia.basescan.org/address/sample_address_id" curl -o /dev/null -s -w "%{http_code}\n" $address_urlLength of output: 316
107-113
: Verify the API endpoints.Ensure that the API endpoints for
base_testnet
are correct and functional.Verification successful
API endpoints verified and functional.
- The URL
https://rpc.ankr.com/base_sepolia
redirects tohttps://www.ankr.com/rpc/base/base_sepolia/
, which is accessible and returns a 200 status code.- The URL
https://base-sepolia.blockpi.network/v1/rpc/public
requires a POST request to return a 200 status code.Ensure to use the correct HTTP methods for accessing these endpoints.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the API endpoints for `base_testnet`. # Test: Check if the URLs are reachable. Expect: HTTP status 200. curl -o /dev/null -s -w "%{http_code}\n" https://base-sepolia.blockpi.network/v1/rpc/public curl -o /dev/null -s -w "%{http_code}\n" https://rpc.ankr.com/base_sepoliaLength of output: 178
Script:
#!/bin/bash # Description: Follow the redirect for the 301 status code and determine the final URL. # Check if the final URL is reachable with HTTP status 200. # Follow the redirect and get the final URL. final_url=$(curl -s -o /dev/null -w "%{redirect_url}" https://rpc.ankr.com/base_sepolia) # Check if the final URL is reachable. curl -o /dev/null -s -w "%{http_code}\n" "$final_url" # Check if the 405 status code endpoint requires a different HTTP method or additional headers. # Trying a POST request. curl -X POST -o /dev/null -s -w "%{http_code}\n" https://base-sepolia.blockpi.network/v1/rpc/publicLength of output: 331
40-44
: Verify the explorer URL.Ensure that the explorer URL
https://basescan.org/
is correct and functional.Verification successful
Verification successful. The explorer URLs and placeholders for
base_mainnet
,base_testnet
, andpolygon_mainnet
are correct and functional.
base_mainnet
: URLhttps://basescan.org/
is reachable, and placeholders${tx}
and${address}
are correctly used.base_testnet
: URLhttps://basescan.org/
is reachable, and placeholders${tx}
and${address}
are correctly used.polygon_mainnet
: URLhttps://polygonscan.com/
is reachable, and placeholders${tx}
and${address}
are correctly used.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the explorer URL for `base_mainnet`. # Test: Check if the URL is reachable. Expect: HTTP status 200. curl -o /dev/null -s -w "%{http_code}\n" https://basescan.org/Length of output: 68
Script:
#!/bin/bash # Description: Verify the correct usage of placeholders within the URL paths for transactions and addresses. # Test: Check if the URL paths contain the correct placeholders. echo "Checking transaction URL path..." tx_url_path="/tx/\${tx}" if [[ "$tx_url_path" == *"\${tx}"* ]]; then echo "Transaction URL path contains the placeholder \${tx}." else echo "Transaction URL path does not contain the placeholder \${tx}." fi echo "Checking address URL path..." address_url_path="/address/\${address}" if [[ "$address_url_path" == *"\${address}"* ]]; then echo "Address URL path contains the placeholder \${address}." else echo "Address URL path does not contain the placeholder \${address}." fiLength of output: 528
Script:
#!/bin/bash # Description: Verify the explorer URLs and placeholders for `base_testnet` and `polygon_mainnet`. # Function to check URL reachability check_url() { local url=$1 local name=$2 echo "Checking URL reachability for $name..." status_code=$(curl -o /dev/null -s -w "%{http_code}\n" "$url") if [ "$status_code" -eq 200 ]; then echo "$name URL is reachable." else echo "$name URL is not reachable. Status code: $status_code" fi } # Function to check placeholders in URL paths check_placeholders() { local tx_path=$1 local address_path=$2 echo "Checking transaction URL path..." if [[ "$tx_path" == *"\${tx}"* ]]; then echo "Transaction URL path contains the placeholder \${tx}." else echo "Transaction URL path does not contain the placeholder \${tx}." fi echo "Checking address URL path..." if [[ "$address_path" == *"\${address}"* ]]; then echo "Address URL path contains the placeholder \${address}." else echo "Address URL path does not contain the placeholder \${address}." fi } # Verify base_testnet check_url "https://basescan.org/" "base_testnet" check_placeholders "/tx/\${tx}" "/address/\${address}" # Verify polygon_mainnet check_url "https://polygonscan.com/" "polygon_mainnet" check_placeholders "/tx/\${tx}" "/address/\${address}"Length of output: 1972
Closes: #53
Summary by CodeRabbit