availproject / avail

772 stars 529 forks source link

avail-substrate-api-sidecar #621

Closed yaoyf888 closed 1 month ago

yaoyf888 commented 1 month ago

{ "code": 500, "message": "createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec\"}:: Struct: failed on extrinsics: Vec:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding system.killPrefix:: Struct: failed on args: {\"prefix\":\"Bytes\",\"subkeys\":\"u32\"}:: decodeU8aStruct: failed at 0x0300b645fbddf5d8407f771af3e2c082… on prefix (index 1/2): Bytes:: Bytes length 4215649792 exceeds 10485760", "stack": "Error: createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec\"}:: Struct: failed on extrinsics: Vec:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding system.killPrefix:: Struct: failed on args: {\"prefix\":\"Bytes\",\"subkeys\":\"u32\"}:: decodeU8aStruct: failed at 0x0300b645fbddf5d8407f771af3e2c082… on prefix (index 1/2): Bytes:: Bytes length 4215649792 exceeds 10485760\n at createTypeUnsafe (/Users/yaoyf/WorkSpace/Bitmart/code/avail-substrate-api-sidecar/node_modules/@polkadot/types-create/cjs/create/type.js:54:22)\n at TypeRegistry.createTypeUnsafe (/Users/yaoyf/WorkSpace/Bitmart/code/avail-substrate-api-sidecar/node_modules/@polkadot/types/cjs/create/registry.js:230:52)\n at RpcCore._formatOutput (/Users/yaoyf/WorkSpace/Bitmart/code/avail-substrate-api-sidecar/node_modules/@polkadot/rpc-core/cjs/bundle.js:331:25)\n at RpcCore._formatResult (/Users/yaoyf/WorkSpace/Bitmart/code/avail-substrate-api-sidecar/node_modules/@polkadot/rpc-core/cjs/bundle.js:169:20)\n at callWithRegistry (/Users/yaoyf/WorkSpace/Bitmart/code/avail-substrate-api-sidecar/node_modules/@polkadot/rpc-core/cjs/bundle.js:190:25)", "level": "error" }

yaoyf888 commented 1 month ago

i use this code:https://github.com/availproject/avail-substrate-api-sidecar

yaoyf888 commented 1 month ago

@kroos47 Do you have the source code of sidecar? I use your avail-substrate-api-sidecar to request block information and report errors. Is there any version to solve this problem?

yaoyf888 commented 1 month ago

@QEDK Can you help me?

kroos47 commented 1 month ago

@yaoyf888 Are you running the sidecar locally?(like building from source and not docker), If yes did you add the avail specific types which is in the root of the repo and the url to the env? If you did all these above steps then what was the request that you were trying?

yaoyf888 commented 1 month ago

I do want to run sidecar using the source code, but get an error when requesting block details. How do I add the avail type and env url in the repo root directory? I am currently using docker pull availj/sidecar-api:zenitsu, this docker is OK

kroos47 commented 1 month ago

so try to add the files to the .env file or so export SAS_SUBSTRATE_URL=wss://mainnet-rpc.avail.so/ws and export SAS_SUBSTRATE_TYPES_BUNDLE="<_path_to_types.json_files_in_local_repo_"

yaoyf888 commented 1 month ago

docker pull availj/sidecar-api:zenitsu Is this available on the mainnet? Will that be a problem?

kroos47 commented 1 month ago

yes it is available on the mainnet! But make sure you pass URL and Types when running

kroos47 commented 1 month ago

@yaoyf888 let me know if its resolved the issue

kroos47 commented 1 month ago

closing this for now!