Able to create alexander APIRx but not kusama, substratetest in react-native
See original GitHub issueCan connect and get details for Alexander, hosted by parity and Web3 Foundation
- wss://poc3-rpc.polkadot.io/
- wss://alex.unfrastructure.io/public/ws
import { ApiRx, WsProvider, ApiPromise } from '@polkadot/api';
var provider;
var api;
try {
provider = new WsProvider(rpcServer);
api = await ApiRx.create(provider).toPromise();
} catch (error) {
console.log(error);
}
But the issue is, Fails in following Wsproviders with below error
- Kusama wss://kusama-rpc.polkadot.io/
- wss://canary-5.kusama.network/
- wss://substrate-rpc.parity.io/
console.error: “2019-09-10 13:04:50”, " RPC-CORE:", “getMetadata (block: Hash): Metadata:: U8a: failed on ‘MagicNumber’:: U8a: failed on ‘MetadataEnum’:: Unable to create Enum via index 7, in MetadataV0, MetadataV1, MetadataV2, MetadataV3, MetadataV4, MetadataV5”
console.error 7455fce6-615b-432d-a856-c602438c55d6:72976:24 apply 7455fce6-615b-432d-a856-c602438c55d6:537382:25 Object.error 7455fce6-615b-432d-a856-c602438c55d6:537414:16 call$ 7455fce6-615b-432d-a856-c602438c55d6:536287:21 tryCatch 7455fce6-615b-432d-a856-c602438c55d6:32250:19 Generator.invoke [as _invoke] 7455fce6-615b-432d-a856-c602438c55d6:32425:24 Generator.prototype.<computed> [as next] 7455fce6-615b-432d-a856-c602438c55d6:32293:23 tryCatch 7455fce6-615b-432d-a856-c602438c55d6:32250:19 invoke 7455fce6-615b-432d-a856-c602438c55d6:32326:22
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Working fine after clean install
watchman watch-del-all && rm package-lock.json && rm -rf node_modules && rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-map-* && NODE_OPTIONS=--max_old_space_size=8192 npm install
But, header.blockNumber is undefined, header.number gives block numbers instead.
header = {“parentHash”:“0xecf52f1796f9f3b50bc92691967ebd6c0d29f07c8aaf17bb6c0fea9a5ee1bb13”,“number”:259454,“stateRoot”:“0x3f9e149a64f9531aebd2ce66366c8489ab192d3f45c1e0b2b6d733693746b551”,“extrinsicsRoot”:“0x5a2cb032e3f3ac5af7747e66d6abeda0e70b2dfa5f41067eba1a886501198e39”,“digest”:{“logs”:[“0x064241424544010300000085f2930f0000000067f60000”,“0x05424142450101e67bd36607f4ac701db9775f618c159544f589a88d6d7b2d74ba39d0c688b30d452b0c4299ece78df1a58ac472922673d0951b8dd796c85785b4b2b90b7b1881”]}}
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.