maxsam4 / fork-off-substrate

This script allows bootstrapping a new substrate chain with the current state of a live chain
MIT License
109 stars 65 forks source link

Cannot convert undefined or null to object #116

Closed flipchan closed 2 years ago

flipchan commented 2 years ago

Hey, I'm trying to get fork-off-substrate to work with https://github.com/edgeware-network/edgeware-node/tree/erup-5-latest.

I assume it's because I have not added the custom types but, I have imported them into the index.js file(const { spec } = require('@edgeware/node-types');) and that should work. Am I missing something here that causes problems?

HTTP_RPC_ENDPOINT=http://mynode:9988 npm start

> fork-off-substrate@1.0.0 start
> node index.js

We are intentionally using the HTTP endpoint. If you see any warnings about that, please ignore them.
Custom Schema missing, using default schema.
2022-07-26 22:54:26        API/INIT: Api will be available in a limited mode since the provider does not support subscriptions
2022-07-26 22:54:27        API/INIT: RPC methods not decorated: contracts_upload_code, dev_getBlockStats, eth_feeHistory, eth_maxPriorityFeePerGas
2022-07-26 22:54:27        API/INIT: Error: FATAL: Unable to initialize the API: Cannot convert undefined or null to object
    at ApiPromise.value (/fork-off-substrate/node_modules/@polkadot/api/base/Init.cjs:88:25)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Custom types imported: https://github.com/hicommonwealth/edgeware-node-types

ghzlatarev commented 2 years ago

Update polkadot-api to latest (^9.0.1)

flipchan commented 2 years ago

HTTP_RPC_ENDPOINT=http://mynode:9988 npm start

This worked