Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/blocks/head return error #350

Closed
xianggy opened this issue Nov 21, 2020 · 4 comments · Fixed by #351
Closed

/blocks/head return error #350

xianggy opened this issue Nov 21, 2020 · 4 comments · Fixed by #351

Comments

@xianggy
Copy link

xianggy commented Nov 21, 2020

how to solve it, thx.

2020-11-21 17:05:22 error: Cannot read property 'validators' of undefined
TypeError: Cannot read property 'validators' of undefined
at BlocksService.fetchBlock (/Users/xiangguangyue/Workplace/Product/node/substrate-api-sidecar/build/src/services/blocks/BlocksService.js:30:31)
at BlocksController.getLatestBlock (/Users/xiangguangyue/Workplace/Product/node/substrate-api-sidecar/build/src/controllers/blocks/BlocksController.js:77:68)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /Users/xiangguangyue/Workplace/Product/node/substrate-api-sidecar/build/src/controllers/AbstractController.js:138:9
2020-11-21 17:05:22 error: GET /blocks/head 500 4ms

@emostov
Copy link
Contributor

emostov commented Nov 21, 2020

What network are you using sidecar against?

@xianggy
Copy link
Author

xianggy commented Nov 23, 2020

Kulupu.
in BlocksService.ts:

		const [{ block }, events, validators=[]] = await Promise.all([
			api.rpc.chain.getBlock(hash),
			this.fetchEvents(api, hash),
			api.query.session.validators.at(hash),  // api.query.session is undefined
		]);

@emostov
Copy link
Contributor

emostov commented Nov 23, 2020

Sidecar does not yet accommodate Kulupu, but it will in the future. For the time being though, what endpoints are you looking to use? I could possibly create a branch of Sidecar that will have some endpoints work with Kulupu.

@xianggy
Copy link
Author

xianggy commented Nov 23, 2020

Well, thank you very much.
I need some apis for exchange wallet integration:
blocks:
/blocks/head[?finalized=false]
/blocks/{blockId} for the extrinsics details and events
accounts:
/accounts/{accountId}/balance-info
transaction details:
/tx/{txHash}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants