AcalaNetwork / acala.js

https://developer.acala.network/
Apache License 2.0
59 stars 26 forks source link

Cannot retrieve data on an uninitialized chain #236

Open polariseye opened 3 years ago

polariseye commented 3 years ago

dependencies:

"dependencies": {
    "@acala-network/api": "^3.0.2",
    "@clover-network/node-types": "1.0.4",
    "@polkadot/api": "^6.5.2",
    "@phala/typedefs": "^0.2.29",
    "commander": "^8.1.0",
    "express": "^4.17.1",
    "fs-extra": "^10.0.0",
    "jsutility": "../jsutility",
    "log4js": "^6.3.0",
    "moonbeam-types-bundle": "^1.2.7",
    "npm": "^6.14.15"
  }
invoke function fail ["",{},"Error: Cannot retrieve data on an uninitialized chain
    at assert (./node_modules/@polkadot/util/assert.cjs:34:11)
    at ApiPromise._getBlockRegistry (./substrateProxy/node_modules/@polkadot/api/base/Init.cjs:216:22)
    at ApiPromise.getBlockRegistry (./node_modules/@polkadot/api/base/Init.cjs:281:22)
    at ./node_modules/@polkadot/api/base/Init.cjs:130:53
    at RpcCore.memoized (./node_modules/@polkadot/util/memoize.cjs:33:41)
    at callWithRegistry (./node_modules/@polkadot/rpc-core/bundle.cjs:252:214)
    at Observable._subscribe (./node_modules/@polkadot/rpc-core/bundle.cjs:265:9)
    at Observable._trySubscribe (./node_modules/rxjs/dist/cjs/internal/Observable.js:41:25)
    at ./node_modules/rxjs/dist/cjs/internal/Observable.js:35:31
    at Object.errorContext (./node_modules/rxjs/dist/cjs/internal/util/errorContext.js:22:9)"] stack:Error
    at Log.error (/usr/local/work/chainProxy/jsutility/log_util/index.js:64:15)
    at SubstrateProxy.<anonymous> (./substrate.js:450:36)
    at Generator.throw (<anonymous>)
    at rejected (./substrate.js:25:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

how can i fix this

qwer951123 commented 3 years ago

Could you provide your code?