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

Missing package in orbit setup script #69

Open
Johnaverse opened this issue Mar 19, 2024 · 2 comments
Open

Missing package in orbit setup script #69

Johnaverse opened this issue Mar 19, 2024 · 2 comments

Comments

@Johnaverse
Copy link

Fail to run PRIVATE_KEY="0xYourPrivateKey" L2_RPC_URL="https://sepolia-rollup.arbitrum.io/rpc" L3_RPC_URL="http://localhost:8449" yarn run setup.

yarn install has been applied before running the command.

Error logs:

resumeState file found, will restart from where it failed last time.
Running tokenBridgeDeployment or erc20TokenBridge script to deploy token bridge contracts on parent chain and your Orbit chain 🌉🌉🌉🌉🌉
Creating token bridge for rollup 0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e
Error occurred: ContractFunctionExecutionError: HTTP request failed.

URL: https://sepolia-rollup.arbitrum.io/rpc
Request body: {"method":"eth_call","params":[{"data":"0xe78cea92","to":"0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e"},"latest"]}
 
Raw Call Arguments:
  to:    0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e
  data:  0xe78cea92
 
Contract Call:
  address:   0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e
  function:  bridge()

Docs: https://viem.sh/docs/contract/readContract.html
Details: fetch is not defined
Version: [email protected]
    at getContractError (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/utils/errors/getContractError.ts:72:10)
    at readContract (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/actions/public/readContract.ts:114:27)
    at async isCustomFeeTokenChain (/home/johnathan/Desktop/orbit-setup-script/node_modules/@arbitrum/orbit-sdk/dist/utils/isCustomFeeTokenChain.js:6:20)
    ... 3 lines matching cause stack trace ...
    at async main (/home/johnathan/Desktop/orbit-setup-script/scripts/setup.ts:160:7) {
  details: 'fetch is not defined',
  docsPath: '/docs/contract/readContract',
  metaMessages: [
    'URL: https://sepolia-rollup.arbitrum.io/rpc',
    'Request body: {"method":"eth_call","params":[{"data":"0xe78cea92","to":"0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e"},"latest"]}',
    ' ',
    'Raw Call Arguments:',
    '  to:    0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e\n  data:  0xe78cea92',
    ' ',
    'Contract Call:',
    '  address:   0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e\n' +
      '  function:  bridge()'
  ],
  shortMessage: 'HTTP request failed.',
  version: '[email protected]',
  cause: CallExecutionError: HTTP request failed.
  
  URL: https://sepolia-rollup.arbitrum.io/rpc
  Request body: {"method":"eth_call","params":[{"data":"0xe78cea92","to":"0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e"},"latest"]}
   
  Raw Call Arguments:
    to:    0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e
    data:  0xe78cea92
  
  Details: fetch is not defined
  Version: [email protected]
      at getCallError (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/utils/errors/getCallError.ts:42:10)
      at call (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/actions/public/call.ts:204:23)
      at async readContract (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/actions/public/readContract.ts:95:22)
      at async isCustomFeeTokenChain (/home/johnathan/Desktop/orbit-setup-script/node_modules/@arbitrum/orbit-sdk/dist/utils/isCustomFeeTokenChain.js:6:20)
      at async createTokenBridgePrepareTransactionRequest (/home/johnathan/Desktop/orbit-setup-script/node_modules/@arbitrum/orbit-sdk/dist/createTokenBridgePrepareTransactionRequest.js:18:32)
      at async createNewTokenBridge (/home/johnathan/Desktop/orbit-setup-script/scripts/createTokenBridge.ts:167:21)
      at async createERC20Bridge (/home/johnathan/Desktop/orbit-setup-script/scripts/createTokenBridge.ts:333:36)
      at async main (/home/johnathan/Desktop/orbit-setup-script/scripts/setup.ts:160:7) {
    details: 'fetch is not defined',
    docsPath: undefined,
    metaMessages: [
      'URL: https://sepolia-rollup.arbitrum.io/rpc',
      'Request body: {"method":"eth_call","params":[{"data":"0xe78cea92","to":"0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e"},"latest"]}',
      ' ',
      'Raw Call Arguments:',
      '  to:    0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e\n' +
        '  data:  0xe78cea92'
    ],
    shortMessage: 'HTTP request failed.',
    version: '[email protected]',
    cause: HttpRequestError: HTTP request failed.
    
    URL: https://sepolia-rollup.arbitrum.io/rpc
    Request body: {"method":"eth_call","params":[{"data":"0xe78cea92","to":"0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e"},"latest"]}
    
    Details: fetch is not defined
    Version: [email protected]
        at Object.http (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/utils/rpc.ts:142:11)
        at async fn (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/clients/transports/http.ts:107:18)
        at async request (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/clients/transports/http.ts:109:39)
        at async delay.count.count (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/utils/buildRequest.ts:129:18)
        at async attemptRetry (/home/johnathan/Desktop/orbit-setup-script/node_modules/viem/utils/promise/withRetry.ts:37:22) {
      details: 'fetch is not defined',
      docsPath: undefined,
      metaMessages: [Array],
      shortMessage: 'HTTP request failed.',
      version: '[email protected]',
      body: [Object],
      headers: undefined,
      status: undefined,
      url: 'https://sepolia-rollup.arbitrum.io/rpc'
    }
  },
  abi: [
    {
      name: 'bridge',
      type: 'function',
      stateMutability: 'view',
      inputs: [],
      outputs: [Array]
    }
  ],
  args: undefined,
  contractAddress: '0x6460Ce41bF21aB9EBA3F1a484d99aa59FE987E9e',
  formattedArgs: undefined,
  functionName: 'bridge',
  sender: undefined
}
Seems something went wrong during this process, but don't worry, we have recorded the deployed and initialized contracts into ./config/resumeState.json, next time you rerun the script, it will restart from where it failed 
Done in 8.10s.

Look like package for fetch is missing in package.json.

@RISHABHAGRAWALZRA
Copy link

Change the node version to v20.11.1, it works for me

@hovanhoa
Copy link

hovanhoa commented Jun 3, 2024

I think u should change the default RPC to infura RPC for Arbitrum. It makes this process more smooth.

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

No branches or pull requests

3 participants