You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop chain after a specified number of blocks mined or reach a specified height.
A proposal:
# Exit after mine 10 blocks.
axon run --mine-limit 10
# Exit after reach block 10
axon run --mine-to 10
Reason
When run axon run, there is no way to:
stop process programmatically.
stop it at a specified height accurately.
This feature would help a lot for tests.
For example:
If I want to test migrations:
Start a chain with the old binary, mine 10 blocks.
Stop the chain.
Start a chain with the new binary.
In above example, I have to use JSON-RPC to test which height is reached, then stop it.
And, if I am correct, currently there is no truncate / rollback method.
When I want to test a chain that tip is 10, I check the height with JSON-RPC, when it reaches height 10, then send stop signal, it may reaches 11.
I could not truncate the chain, so I have to re-run the chain.
See, to control the tip is difficult.
In Further
As I said in above section, if I am correct, currently there is no truncate / rollback method.
Because these methods are unsuitable for a account model chain.
But it is useful for testing forked blocks and a bad chain network with abnormal nodes.
For a alternative choice, I checked ethereum clients:
geth has a command geth attach, it could sync blocks to a specific block. (ref: a guide in reddit)
Axon could add a similar command.
Alternatives you've considered
No response
Anything else?
All features I proposed in this issue, are used for testing.
So the priority is low.
The text was updated successfully, but these errors were encountered:
Contact Details
No response
Propose-a-new-feature
Proposed Feature
Stop chain after a specified number of blocks mined or reach a specified height.
A proposal:
Reason
When run
axon run
, there is no way to:This feature would help a lot for tests.
For example:
In above example, I have to use JSON-RPC to test which height is reached, then stop it.
And, if I am correct, currently there is no truncate / rollback method.
When I want to test a chain that tip is 10, I check the height with JSON-RPC, when it reaches height 10, then send stop signal, it may reaches 11.
I could not truncate the chain, so I have to re-run the chain.
See, to control the tip is difficult.
In Further
As I said in above section, if I am correct, currently there is no truncate / rollback method.
Because these methods are unsuitable for a account model chain.
But it is useful for testing forked blocks and a bad chain network with abnormal nodes.
For a alternative choice, I checked ethereum clients:
geth
has a commandgeth attach
, it could sync blocks to a specific block. (ref: a guide in reddit)Axon could add a similar command.
Alternatives you've considered
No response
Anything else?
All features I proposed in this issue, are used for testing.
So the priority is low.
The text was updated successfully, but these errors were encountered: