Documents of Recommended Practices. - #51
Conversation
kithminisg
commented
Dec 9, 2022
- Keeping anchor nodes
- Monitoring contract health
- Anchor nodes - Performance check
| @@ -0,0 +1,138 @@ | |||
| ## Creating Anchor Nodes. | |||
|
|
|||
| Once you deploy a contract to Evernode instance cluster, you do not have direct access to the data of the smart contract. Hence, if you face to a data recovery requirement there may be a hassle. Hence, Evernode foundation recommend you to use anchor nodes when deploying smart contracts. | |||
There was a problem hiding this comment.
If you need to recover your data, Evernode foundation recommends you to use anchor nodes when deploying smart contracts.
|
|
||
| Mainly there are two methods that you can adhere to when creating an anchor node for your cluster. | ||
|
|
||
| ### First Method : Create the anchor node when starting a create cluster. |
There was a problem hiding this comment.
Create an anchor node before creating the contract cluster
| There,you have to run your own HotPocket contract on your machine. | ||
|
|
||
| Here we are using a Docker container to setup our anchor node. | ||
| You can define your own `Docker image` for this process with other additional command line tools for your ease. |
There was a problem hiding this comment.
There are pre-packaged HotPocket docker images that support nodejs and c contracts (evernodedev/hotpocket:0.6.0-ubt.20.04, evernodedev/hotpocket:0.6.0-ubt.20.04-njs.16)
| Then we need to create the Docker container by binding an external volume. | ||
|
|
||
| ```docker | ||
| docker container create --name anchor_node --privileged -v ~/evernode/anchor/contract_data:/home/mnt/contract/contract_fs/seed/state -p 8080:8080 --restart unless-stopped --mount type=volume,src=hp_default_vol,dst=/home/mnt/ evernode-anchor-node:0.1.0-hp.0.6.0 run /home/mnt/contract |
There was a problem hiding this comment.
What if we keep whole contract directory in the volume mount
|
question around the anchor node here, is this also possibly for a way for a entity deploying a contract also to have the ability to have a node in their contracts network? I could see that those deploying contracts would also want to have a node they run as part of the consens, to have at least some way to validate their contract has in no way diverged from the results they expect? Similarly as a participant on the XRPL I run my own node in the network for that vary reason. |
|
@lathanbritz, The purpose of this document is to provide guidance on maintaining an anchor node when a user lacks access to any relevant Evernode instances. These approaches allow users to refer to logs and maintain a replica of the state data. We suggest two methods. Firstly, we propose starting the cluster from the anchor node. Secondly, the anchor node can be joined to an existing cluster as an observer. In this observer role, the node does not impact the consensus. It is important to note that this is not a mandatory action but rather a helpful tip. Also, we may enhance this document further. |