File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
packages/cli/src/command-helpers Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @graphprotocol/graph-cli ' : patch
3+ ---
4+
5+ Fix ` matic ` RPC endpoint and improve error message
Original file line number Diff line number Diff line change @@ -100,8 +100,8 @@ export const fetchTransactionByHashFromRPC = async (
100100 transactionHash : string ,
101101) : Promise < any > => {
102102 let json : any ;
103+ const RPCURL = getPublicRPCEndpoint ( network ) ;
103104 try {
104- const RPCURL = getPublicRPCEndpoint ( network ) ;
105105 if ( ! RPCURL ) throw new Error ( `Unable to fetch RPC URL for ${ network } ` ) ;
106106 const result = await fetch ( String ( RPCURL ) , {
107107 method : 'POST' ,
@@ -120,7 +120,7 @@ export const fetchTransactionByHashFromRPC = async (
120120 return json ;
121121 } catch ( error ) {
122122 logger ( 'Failed to fetchTransactionByHashFromRPC: %O' , error ) ;
123- throw new Error ( ' Failed to fetch contract creation transaction' ) ;
123+ throw new Error ( ` Failed to run \`eth_getTransactionByHash\` on RPC ( ${ RPCURL } ) (run with env \`DEBUG=*\` for full error).` ) ;
124124 }
125125} ;
126126
@@ -387,7 +387,7 @@ const getPublicRPCEndpoint = (network: string) => {
387387 case 'mainnet' :
388388 return 'https://rpc.ankr.com/eth' ;
389389 case 'matic' :
390- return 'https://rpc-mainnet.maticvigil. com' ;
390+ return 'https://polygon-rpc. com/ ' ;
391391 case 'mbase' :
392392 return 'https://rpc.moonbase.moonbeam.network' ;
393393 case 'mumbai' :
You can’t perform that action at this time.
0 commit comments