paritytech / paritytech/try-runtime-cli
Expose RPC endpoint
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Rust
- Star
- 25
- Fork
- 29
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Original issue https://github.com/paritytech/substrate/issues/13563
When we do follow-chain, it would be useful to have the basic RPCs implemented and exposed on a specific port, so that you can connect PJS Apps to your fake chain.
An alternative for this is to actually integrate this in the node. https://github.com/paritytech/substrate/pull/12537 envisioned that you would be able to run a node that is normally syncing, but instead of calling Core_execute_block, it would call into TryRuntime_execute_block. This would give us a fully working client.
Relevant comment: https://github.com/paritytech/substrate/issues/13563#issuecomment-1498622775
the scenario that he is interested in is:
You run execute-block or fast-forward, and once the block have all executed, you want to inspect the state.
one way to approach this is to make try-runtime cli programmable, so you can define more tests to be written, but this is a holy PITA in Rust.
an easier way, which Alan from Moonbeam is also asking is, to make the try-runtime cli capable of implementing a few important RPCs like state_getStorage and so on, and then we query it with Polkadot JS api/apps.
in principle, I think this is not hard, but I have no idea how hard it is.
So, imagine the try-runtime CLI being able to return a value to a subset of the RPC requests, namely all of the ones that can be answered by having a state.
because end of the day, try-runtime-cli is just a wrapper for remote-externalities, which is a "test state".
the problem though is that the underlying remote-ext can have a partial state etc. So there are a lot of edge cases that we may not be able to handle, and developers might confuse themselves.
For example, you would run:
try-runtime fast-forward 1000 --rpc and this will run 1000 empty blocks for you, and the process is still running, hosting an RPC server.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Đọc luồng CLI của try-runtime cho execute-block và fast-forward, sau đó kiểm tra cách remote-externalities cung cấp trạng thái kiểm thử. Xác định tập con RPC được hỗ trợ dựa trên trạng thái, bao gồm state_getStorage, và xác minh rằng try-runtime fast-forward 1000 --rpc vẫn giữ một máy chủ RPC chạy sau khi thực thi để Polkadot JS có thể kiểm tra trạng thái kết quả.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- rust
- Lĩnh vực
- api, blockchain, cli
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100