Ganache-like node #4290
Replies: 6 comments 8 replies
-
Would single node suffice or is there some need for having multiple nodes? |
Beta Was this translation helpful? Give feedback.
-
I think it's best if we keep as close to real node as possible (including RocksDB, etc) as long as we can tune parameter to get good enough performance (e.g. by reducing block production time) and provide debug APIs like save/rollback state, fast forward time, etc. Making WASM-runnable node seems like more or less independent project which needs more significant effort. |
Beta Was this translation helpful? Give feedback.
-
Agree, having |
Beta Was this translation helpful? Give feedback.
-
Some of the features such as produce N blocks are (Max also mentioned) available via adversarial feature. But this feature is specifically designed for simulate malicious node in chain test, therefore I decide to make contract developer facing ganache-like features under feature
Should we compile wasmer to wasm, and that is running wasm in browser wasm runtime (wasm in wasm) or implement a contract-runtime on top of browser native wasm runtime
I generally agree, except I think it should be under different feature name: |
Beta Was this translation helpful? Give feedback.
-
CC @austinabell |
Beta Was this translation helpful? Give feedback.
-
Maybe also worth discussing how the initialization of state would happen if a user wanted to start from a snapshot or import state at runtime. Would either/both be supported? If so, would this import happen through a file, through some HTTP/stream call directly into the store, and/or some other transport? I suppose it could also re-use the state of a Might be worth defining and deciding how any export functionality would be exposed or what would be a provider for the exports. This might be out of the scope of the initial implementation, if it's only required to start with a fresh state for the initial version. |
Beta Was this translation helpful? Give feedback.
-
Motivation
We need a lightweight version of the nearcore node that will be used in the following situations:
Based on the above requirements the node need to satisfy the following criteria:
It might potentially need to support:
It does not necessarily need to support:
Note, while there is not direct incentive to explicitly not include the above components into the node, not including them might significantly reduce the number of the dependencies, speed up compilation time, and potentially even allow the node to be compiled into Wasm to be run as part of devtools or near-api-js. If it does not allow compilation to Wasm then we would have to maintain https://github.com/nearprotocol/nearcore/tree/master/runtime/runtime-standalone which wouldn't be supporting RPC, full protocol spec. The are advantages of trying to make the standalone node compile to Wasm:
Proposed design
@SkidanovAlex proposed to directly repurpose the fact that nearcore node has an adversarial RPC API that allows fine grain control of the node. Here is his proposed plan for Ganache-node:
We might start with working towards this initial design implementation and later work towards the case when it is a non-concurrent Wasm-compilable node.
WDYT?
Beta Was this translation helpful? Give feedback.
All reactions