-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #836 from multiversx/chain-simulator-docs
Chain simulator docs
- Loading branch information
Showing
7 changed files
with
215 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
id: chain-simulator | ||
title: Chain simulator | ||
--- | ||
|
||
[comment]: # (mx-context-auto) | ||
|
||
## Overview | ||
|
||
Chain simulator is a piece of software that provides all the `mx-chain-proxy-go` endpoints and includes additional endpoints | ||
for specific operations. | ||
|
||
Instead of setting up a local testnet with a proxy and nodes, using chain simulator is a simpler option. | ||
It mimics the behavior of a local testnet, making it easier to test smart contracts in a simulated environment. | ||
|
||
The chain simulator offers faster testing since it eliminates the need for consensus, allowing blocks to be generated | ||
in milliseconds rather than the typical 6-second intervals on a local testnet. | ||
|
||
The chain simulator provides new endpoints that allow developers to replicate the state of a contract from the mainnet to the simulator. | ||
This enables testing with the same state as on the mainnet, facilitating more accurate and realistic development scenarios. | ||
|
||
[comment]: # (mx-context-auto) | ||
|
||
## Architectural Overview | ||
|
||
![img](/technology/chainsimulator.png) | ||
|
||
This simulator is designed to replicate the behavior of a local testnet. Unlike a traditional testnet, this simulator | ||
operates without a consensus group, allowing for isolated testing and development. | ||
|
||
|
||
[comment]: # (mx-context-auto) | ||
|
||
## Features | ||
|
||
- Implements all `mx-chain-proxy-go` endpoints. | ||
- Extra endpoints for specific operations. | ||
- Simulates the behavior of a local testnet without a consensus group. | ||
|
||
The GitHub repository for the chain simulator and more information | ||
about how to use can be found [here](https://github.com/multiversx/mx-chain-simulator-go). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<mxfile host="app.diagrams.net" modified="2024-02-27T10:39:15.564Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36" etag="ph4Y5ugfU1mbP7bKnenz" version="23.1.7" type="device"> | ||
<diagram name="Page-1" id="XZ3qhjXyUbHVMeMBHV_s"> | ||
<mxGraphModel dx="1728" dy="983" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> | ||
<root> | ||
<mxCell id="0" /> | ||
<mxCell id="1" parent="0" /> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-1" value="" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="30" y="30" width="265" height="300" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-2" value="Chain Simulator" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=12;fontStyle=1" vertex="1" parent="1"> | ||
<mxGeometry x="115" y="20" width="95" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-4" value="node<br>shard 0" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="55" y="60" width="70" height="60" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-5" value="node<br>shard 1" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="55" y="130" width="70" height="60" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-6" value="node&nbsp;<br>shard meta" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="55" y="250" width="70" height="60" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-12" value="" style="endArrow=none;dashed=1;html=1;rounded=0;" edge="1" parent="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="145" y="60" as="sourcePoint" /> | ||
<mxPoint x="145" y="320" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="145" y="60" /> | ||
</Array> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-13" value="proxy endpoints" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="182.5" y="80" width="72.5" height="120" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-14" value="new&nbsp;<br>endpoints" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="182.5" y="230" width="72.5" height="50" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-15" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;rounded=0;" edge="1" parent="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="89.57999999999998" y="240" as="sourcePoint" /> | ||
<mxPoint x="89.57999999999998" y="210" as="targetPoint" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-16" value="User" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1"> | ||
<mxGeometry x="395" y="150" width="30" height="60" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-19" value="" style="endArrow=classic;startArrow=classic;html=1;rounded=0;" edge="1" parent="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="310" y="179.57999999999998" as="sourcePoint" /> | ||
<mxPoint x="380" y="179.57999999999998" as="targetPoint" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="EWHMPKfBnV-rQj-S9Va0-20" value="REST APIS" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=10;" vertex="1" parent="1"> | ||
<mxGeometry x="306" y="150" width="80" height="30" as="geometry" /> | ||
</mxCell> | ||
</root> | ||
</mxGraphModel> | ||
</diagram> | ||
</mxfile> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<mxfile host="app.diagrams.net" modified="2024-02-27T10:43:34.521Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36" etag="aEpt2a9mltiY280u4Ev0" version="23.1.7" type="device"> | ||
<diagram name="Page-1" id="2CUQH800xFhHVJmL9mho"> | ||
<mxGraphModel dx="2074" dy="1180" grid="1" gridSize="20" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" background="none" math="0" shadow="0"> | ||
<root> | ||
<mxCell id="0" /> | ||
<mxCell id="1" parent="0" /> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="6Ij9C6XUDUhVDzcWqF8C-1" target="6Ij9C6XUDUhVDzcWqF8C-29" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="285" y="200" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="285" y="110" /> | ||
<mxPoint x="285" y="200" /> | ||
</Array> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-1" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#5EFFEF;" parent="1" vertex="1"> | ||
<mxGeometry x="175" y="80" width="60" height="60" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-31" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="6Ij9C6XUDUhVDzcWqF8C-6" target="6Ij9C6XUDUhVDzcWqF8C-29" edge="1"> | ||
<mxGeometry relative="1" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-6" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#5EFFEF;" parent="1" vertex="1"> | ||
<mxGeometry x="175" y="170" width="60" height="60" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-32" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="6Ij9C6XUDUhVDzcWqF8C-7" target="6Ij9C6XUDUhVDzcWqF8C-29" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="285" y="200" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="285" y="340" /> | ||
<mxPoint x="285" y="200" /> | ||
</Array> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-7" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#5EFFEF;" parent="1" vertex="1"> | ||
<mxGeometry x="175" y="310" width="60" height="60" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-13" value="Shard 0" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> | ||
<mxGeometry x="105" y="95" width="60" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-14" value="Shard 1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> | ||
<mxGeometry x="105" y="185" width="60" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-15" value="Metachain" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> | ||
<mxGeometry x="105" y="325" width="60" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-16" value="" style="shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;" parent="1" vertex="1"> | ||
<mxGeometry x="195" y="240" width="20" height="20" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-17" value="" style="shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;" parent="1" vertex="1"> | ||
<mxGeometry x="195" y="260" width="20" height="20" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-18" value="" style="shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;" parent="1" vertex="1"> | ||
<mxGeometry x="195" y="280" width="20" height="20" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-23" value="" style="endArrow=none;dashed=1;html=1;rounded=0;" parent="1" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="375" y="370" as="sourcePoint" /> | ||
<mxPoint x="375" y="40" as="targetPoint" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-24" value="Observer Nodes" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;" parent="1" vertex="1"> | ||
<mxGeometry x="155" y="30" width="100" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-25" value="Elastic indexer service" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;" parent="1" vertex="1"> | ||
<mxGeometry x="415" y="30" width="130" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-27" value="" style="endArrow=none;dashed=1;html=1;rounded=0;" parent="1" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="575" y="370" as="sourcePoint" /> | ||
<mxPoint x="575" y="40" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="575" y="190" /> | ||
</Array> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-36" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.017;entryY=0.465;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="6Ij9C6XUDUhVDzcWqF8C-29" target="6Ij9C6XUDUhVDzcWqF8C-35" edge="1"> | ||
<mxGeometry relative="1" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-29" value="Elasticindexer instance" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#CCE5FF;" parent="1" vertex="1"> | ||
<mxGeometry x="420" y="170" width="120" height="60" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-33" value="WebSocket messages" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> | ||
<mxGeometry x="305" y="170" width="60" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-34" value="Elasticsearch<br>cluster" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=13;" parent="1" vertex="1"> | ||
<mxGeometry x="620" y="30" width="130" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-37" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="6Ij9C6XUDUhVDzcWqF8C-35" target="6Ij9C6XUDUhVDzcWqF8C-29" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<Array as="points"> | ||
<mxPoint x="615" y="200" /> | ||
<mxPoint x="615" y="200" /> | ||
</Array> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="6Ij9C6XUDUhVDzcWqF8C-35" value="Elasticsearch&nbsp;<br>cluster" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#D5E8D4;" parent="1" vertex="1"> | ||
<mxGeometry x="625" y="120" width="120" height="170" as="geometry" /> | ||
</mxCell> | ||
</root> | ||
</mxGraphModel> | ||
</diagram> | ||
</mxfile> |