File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed 
packages/cli/src/command-helpers Expand file tree Collapse file tree 2 files changed +10
-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,9 @@ 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 ( 
124+       `Failed to run \`eth_getTransactionByHash\` on RPC (${ RPCURL }  ) (run with env \`DEBUG=*\` for full error).` , 
125+     ) ; 
124126  } 
125127} ; 
126128
@@ -387,7 +389,7 @@ const getPublicRPCEndpoint = (network: string) => {
387389    case  'mainnet' :
388390      return  'https://rpc.ankr.com/eth' ; 
389391    case  'matic' :
390-       return  'https://rpc-mainnet.maticvigil. com' ; 
392+       return  'https://polygon-rpc. com/ ' ; 
391393    case  'mbase' :
392394      return  'https://rpc.moonbase.moonbeam.network' ; 
393395    case  'mumbai' :
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments