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 (
100
100
transactionHash : string ,
101
101
) : Promise < any > => {
102
102
let json : any ;
103
+ const RPCURL = getPublicRPCEndpoint ( network ) ;
103
104
try {
104
- const RPCURL = getPublicRPCEndpoint ( network ) ;
105
105
if ( ! RPCURL ) throw new Error ( `Unable to fetch RPC URL for ${ network } ` ) ;
106
106
const result = await fetch ( String ( RPCURL ) , {
107
107
method : 'POST' ,
@@ -120,7 +120,9 @@ export const fetchTransactionByHashFromRPC = async (
120
120
return json ;
121
121
} catch ( error ) {
122
122
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
+ ) ;
124
126
}
125
127
} ;
126
128
@@ -387,7 +389,7 @@ const getPublicRPCEndpoint = (network: string) => {
387
389
case 'mainnet' :
388
390
return 'https://rpc.ankr.com/eth' ;
389
391
case 'matic' :
390
- return 'https://rpc-mainnet.maticvigil. com' ;
392
+ return 'https://polygon-rpc. com/ ' ;
391
393
case 'mbase' :
392
394
return 'https://rpc.moonbase.moonbeam.network' ;
393
395
case 'mumbai' :
You can’t perform that action at this time.
0 commit comments