Skip to content

Custom token bridging example fails on could not detect network #41

@jeffywu

Description

@jeffywu

When running npm run custom-token-bridging from the custom-token-bridging folder I get the following error:

My .env variables are set, this appears to be an issue with the L2 provider:
Set as:

# Hosted Aggregator Node (JSON-RPC Endpoint)
L2RPC="https://rinkeby.arbitrum.io/rpc" 

Added this code and it appears to fail at the l2Wallet.getChainId() call:

  await arbLog('Setting Up Your Token With The Generic Custom Gateway')
  /**
  * Use wallets to create an arb-ts bridge instance
  * We'll use bridge for its convenience methods around registering tokens to the custom gateway
  */
 console.log("chainId L1", await l1Wallet.getChainId())
 console.log("chainId L2", await l2Wallet.getChainId())
 console.log("completed")

Output:

chainId L1 4
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.4.5)
    at Logger.makeError (/home/jwu/code/notional-finance/arbitrum-tutorials/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
    at Logger.throwError (/home/jwu/code/notional-finance/arbitrum-tutorials/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
    at JsonRpcProvider.<anonymous> (/home/jwu/code/notional-finance/arbitrum-tutorials/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:396:23)
    at step (/home/jwu/code/notional-finance/arbitrum-tutorials/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
    at Object.throw (/home/jwu/code/notional-finance/arbitrum-tutorials/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
    at rejected (/home/jwu/code/notional-finance/arbitrum-tutorials/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)
    at runNextTicks (internal/process/task_queues.js:60:5)
    at listOnTimeout (internal/timers.js:524:9)
    at processTimers (internal/timers.js:498:7) {
  reason: 'could not detect network',
  code: 'NETWORK_ERROR',
  event: 'noNetwork'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions