bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 19쪽 중 16쪽
final **LEAVE** transaction and have you received your BOND back - ie 1,000,000 RUNE, and can you account for any slash points or rewards?
If yes, then proceed:
### DESTROY
To destroy and remove previously created resources, you can run the command below.
{% hint style="danger" %}
Destroying your cluster will completely destroy your node, including purging all keys on it.
**DO NOT DO THIS UNTIL YOUR NODE HAS CHURNED OUT AND YOU HAVE VERIFIED YOUR BOND IS COMPLETELY RETURNED**
IF YOU DESTROY A NODE PREMATURELY, YOU MAY LOSE A SIGNIFICANT AMOUNT OF FUNDS
{% endhint %}
### 1) Destroying the Node and Tools
First, destroy the node and tools, this will delete your node then your tooling 1-by-1. Do this from the `node-launcher` repo:
```bash
make destroy-tools
```
.png?alt=media)
### 2) Destroy the cluster
Then destroy the cluster from the `cluster-launcher` repo:
{% tabs %}
{% tab title="AWS" %}
You will be asked to enter your cluster name and region (the same as what you [put in when you first deployed](https://docs.thorchain.org/thornodes/kubernetes/setup#deploy-kubernetes-cluster)).
```bash
make destroy-aws
```
{% endtab %}
{% tab title="DO" %}
You will be asked to enter your cluster name and region, as well as your Personal Token (the same as what you [put in when you first deployed](https://docs.thorchain.org/thornodes/kubernetes/setup#deploy-kubernetes-cluster)).
```bash
make destroy-do
```
{% endtab %}
{% endtabs %}
You will be asked to confirm:
.png?alt=media)
{% hint style="danger" %}
**DO NOT DESTROY YOUR NODE UNTIL YOU HAVE CHURNED OUT AND HAVE RECEIVED YOUR FULL BOND BACK IN YOUR CUSTODY**
**IF YOU DESTROY YOUR NODE WITH FUNDS LOCKED UP - YOU WILL LOSE A SIGNIFICANT QUANTITY OF FUNDS**
{% endhint %}
.png?alt=media)
# Emergency Procedures
This page describes how to react in a network-wide emergency (funds-at-risk).
This document outlines the procedures for Node Operators to respond to network-wide emergencies, such as funds-at-risk scenarios or critical network attacks, on THORChain’s Mainnet. THORChain is a cross-chain decentralized exchange (DEX), and Node Operators play a critical role in maintaining network security and integrity. These procedures ensure rapid, coordinated, and secure responses while preserving the network’s impartiality and resistance to capture.
The overarching ethos for THORChain's security posture is "an abundance of caution". **Halt Earn, Halt Often!**
`make pause` is the big red button that stops everything. Node Operators are supported by the community, developers and all stakeholders to `make pause` if there is any doubt. It is easily undone if incorrectly used (Eg: `make resume`)
See the Additional Resources for more in-depth information and guides.
### Key Principles
* **Rapid Response**: Node Operators must act swiftly to secure the network when a funds-at-risk bug or attack is detected.
* **Pseudo-Anonymity**: Operators should avoid revealing personal information, even during emergencies, to maintain network neutrality and security. Use tools like make relay to communicate anonymously via the THORChain Dev Discord. Alternatively, create a burner email and Discord account.
* **Decentralized Governance**: The removal of admin mimir means network decisions, such as halts or parameter changes, are now managed through [node voting](/thornodes/overview#node-voting) or Mimir overrides initiated by nodes.
* **Mainnet Context**: THORChain operates on Mainnet, with robust mechanisms like node churn, Threshold Signature Scheme (TSS), and Bifrost for cross-chain security.
## Reporting a Bug
If you discover a bug that poses a risk to funds or network stability, follow these steps:
1. **Immediate Notification**: Directly message the THORChain team or admins via the Dev Discord (tag @thorsec if needed) or other secure channels. Alternatively, submit the bug through the formal [Bounty Program](https://gitlab.com/thorchain/thornode/-/blob/develop/bugbounty.md) for evaluation.
2. **Bug Report Details**: Include the following in your report:
* A clear description of the bug or vulnerability.
* Steps to reproduce the issue, if applicable.
* Potential impact (e.g., funds at risk, network disruption).
* Any relevant logs or evidence from your THORNode.
3. **Bounty Program**: If the bug is verified as critical, you may be eligible for a bounty proportional to its severity. Do not disclose the bug publicly until it is resolved to prevent exploitation.
## Emergency Classifications and Responses
Emergencies are classified based on severity, with corresponding actions for Node Operators:
#### Critical - Funds At Risk
* **Description**: A vulnerability or attack threatens the security of funds in liquidity pools/vaults or anything that poses an existential risk to the protocol.
* **Actions**:
1. **Initiate Network Halt**: If a critical threat is confirmed, a Node Operator must issue the `make pause` to halt the entire network. This pauses the entire network for 720 blocks (\~1.5 hrs) to allow time for investigation and corrective actions such as voting to pause specific chain operations (e.g., [halting signing](https://dev.thorchain.org/concepts/network-halts.html)). `make resume` will reduce the pause period by 720 blocks & another `make pause` will increase the pause by another 720 blocks. Once the first `make pause` is dispatched, the issue is not time critical as the entire network is paused and this pause period can and should be increased as appropriate.
2. **Node Voting**: Propose and vote on actions through [Node Voting](/thornodes/overview#node-voting) such as Mimir overrides, to adjust network parameters. This will be discussed in the Dev Discord `#mainnet channel`.
* Use `thornode tx thorchain mimir <key> <value> --from <node-address>` to submit Mimir changes.
3. **Monitor and Communicate**: Use monitoring tools like [Vǫrðr](https://github.com/sourcapital/vordr) to check chain health and sync status. Relay critical updates anonymously via `make relay` to the Dev Discord `#mainnet channel`.
4. **Coordinate with Team**: Work with the core team and other operators to verify the threat and deploy patches. Avoid premature public disclosure to prevent panic or exploitation.
#### Major - Network Disruption (Funds Not At Risk)
* **Description**: A bug or attack disrupts network operations (e.g., chain sync issues, high slash points) but does not directly threaten funds.
* **Actions**:
1. **Assess Node Status**: Check your node’s health using make status to ensure it is synced and operational. Review slash points and chain sync status via Grafana or Prometheus dashboards.
2. **Vote on Parameters**: If required, Propose Mimir changes to adjust network parameters (e.g., reduce `ChurnInterval` to stabilize the network).
3. **Restart Services**: If your node is affected, restart services using `make restart` or reset the node with make reset for unrecoverable issues (note: this is destructive and resets chain data).
4. **Monitor Logs**: Access logs via Grafana’s Loki interface to diagnose issues. Select the relevant service (e.g., thornode/bifrost) in the Log browser.
#### Minor - No Funds or Network At Risk
* **Description**: Non-critical issues, such as minor performance degradation or isolated node failures.
* **Actions**:
1. **Diagnose Locally**: Check your node’s metrics (CPU, memory, disk) using Prometheus or Kubernetes dashboards.
2. **Apply Updates**: Deploy patches or updates to your THORNode services using Helm charts from the node-launcher repository.
3. **Report**: Inform the team via Discord or the Bounty Program for tracking and future improvements. Alternatively, raise an issue within the THORChain [Thornode ](https://gitlab.com/thorchain/thornode)or [NodeLauncher ](https://gitlab.com/thorchain/devops/node-launcher)repositories.
## Network Halts
### Make Pause and Make Resume
These commands are in the Makefile of the [node-launcher](https://gitlab.com/thorchain/devops/node-launcher/-/blob/master/Makefile?ref_type=heads#L161) repository and have specific rules.
1. A pause sent by one node lasts 720 blocks. It sets `NodePauseChainGlobal` to the current block height plus `NodePauseChainBlocks`, the network constant of 720. Trading starts again when the current block is higher than `NodePauseChainGlobal`.
2. A pause effectively sets `IsChainHalted` to true. Observations, swaps, and signing of outbound transactions stop. The THORChain blockchain continues to produce blocks. The process is: `IsChainHalted` reads `NodePauseChainGlobal` and the halt Mimirs, and reports the chain halted while `NodePauseChainGlobal` is at or above the current block.
3. Another node can send a pause command to extend the pause, this will increment `NodePauseChainGlobal` by 720 only while the pause is active, else it acts the same as point 1 and 2.
4. When several pauses are stacked, one resume reduces `NodePauseChainGlobal` by 720 and the network stays paused until the block height to the `NodePauseChainGlobal`. When only one node has paused, one resume from a different node ends it. If that subtraction lands on the current block, the pause still holds for that block.
#### Usage
1. Every effective pause and resume command (that changes `NodePauseChainGlobal`) sent by a node is recorded by the network.
2. Only one pause or resume command can be used by a node between churns. A subsequent pause or resume from a node that has already used this between churn will be rejected by the network with the message 'node has already chosen pause/resume since the last churn'.
In addition to the network wide pausing via the `make pause` command, THORChain supports blockchain specific halts to pause operations during critical emergencies:
* **Initiating a Halt**: [Node voting](/thornodes/overview#node-voting) to pause signing for a specific chain (e.g., BTC, ETH). This prevents outbound transactions until the issue is resolved. All Halt controls are [listed here](https://dev.thorchain.org/concepts/network-halts.html).
* **Voting on Halts**: Nodes can vote to approve or extend halts via the node voting mechanism. How many votes are needed is in [Mimir - Network Settings](/technical-documentation/technical-deep-dive/governance#mimir-network-settings).
* **Resuming Operations**: Once the threat is mitigated, nodes vote to lift the halt using Mimir overrides or resume normal operations.
## Monitoring and Recovery
* **Monitoring Tools**: Use [Vǫrðr](https://github.com/sourcapital/vordr) for real-time chain health and sync status monitoring. Deploy Prometheus and Grafana for detailed metrics on node performance and network status.
* **Backups**: Ensure your THORNode’s persistent volumes are backed up via your Kubernetes provider (e.g., AWS, Google Cloud or bare-metal). Regularly verify backups to protect against data loss.
* **Recovery**: In case of node failure, restore from backups or resync your node. Avoid using `make reset or hard-reset-thornodes` unless absolutely necessary, as it deletes chain data.
## Network Upgrades
Network upgrades are critical for patching vulnerabilities, addition capabilities or improving protocol performance during emergencies. All active nodes must run the updated version for the network to proceed with an upgrade. The process can be managed in three ways:
* **Natural Upgrade**: Versions are proposed in the Dev Discord for a certain block height, nodes follow instructions to signal support, at the block height the network stops for nodes to update their software, and the network naturally resumes when >2/3 of nodes adopt the newest version. Node with older versions are churned out via the regular churn process.
* **Assertive Upgrade**: Once a supermajority of nodes has upgraded, demonstrating acceptance, operators can vote to ban nodes running outdated versions. Banned nodes are churned out, removed from the Threshold Signature Scheme (TSS), and ejected from the consensus set. These nodes must fully leave, destroy their setup, and redeploy a new node to rejoin.
* Use node voting (Node Voting) to propose and approve banning outdated nodes.
* **Forced Upgrade (Hard Fork)**: In time-critical scenarios, a hard fork may be initiated to exclude old nodes. This carries significant risks, such as consensus failures or network instability, and should be a last resort.
* Coordinate via the Dev Discord and use Alerting for THORNodes to monitor fork outcomes.
* **Best Practices for Upgrades**:
* Deploy updates using Helm charts from the Node Launcher Repository.
* Ensure backups are current before upgrading, as described in Restore Validator Backup and THORNode Snapshot Recovery and Storage Management.
* Monitor node sync and health post-upgrade using Vǫrðr Monitoring and Prometheus dashboards.
* Verify multi-validator cluster stability if applicable, as outlined in Multi-Validator Cluster Setup.
## Best Practices
* **Stay Synced**: Ensure your node is fully synced with all connected chains (e.g., Bitcoin, Ethereum) before taking action. Unsynchronized nodes may accrue slash points.
* **Secure Keys**: Protect your operator key and node mnemonic. Loss of the operator key results in loss of bond access, and loss of the validator key may brick your node.
* **Regular Updates**: Keep your THORNode software and Helm charts up to date using the node-launcher repository.
* **Community Coordination**: Engage with other operators and the core team via the Dev Discord or Community Telegram for real-time collaboration.
## Additional Resources
* [Network Halts](https://dev.thorchain.org/concepts/network-halts.html)
* [Alerting for THORNodes](https://gitlab.com/thorchain/devops/node-launcher/-/blob/master/docs/Alerting.md?ref_type=heads)
* [Multi-Validator Cluster Setup](https://gitlab.com/thorchain/devops/node-launcher/-/blob/master/docs/Multi-Validator-Cluster.md?ref_type=heads)
* [Restore Validator Backup](https://gitlab.com/thorchain/devops/node-launcher/-/blob/master/docs/Restore-Validator-Backup.md?ref_type=heads)
* [THORNode Snapshot Recovery and Storage Management](https://gitlab.com/thorchain/devops/node-launcher/-/blob/master/docs/Thornode-Snapshot-Recovery-and-Storage-Management.md?ref_type=heads)
* [Node Voting](/thornodes/overview#node-voting)
* [THORNode Stack](/thornodes/overview/thornode-stack)
* [Vǫrðr Monitoring](https://github.com/sourcapital/vordr)
* [Node Launcher Repository](https://gitlab.com/thorchain/devops/node-launcher) (For THORNode deployment)
* [THORNode Repository](https://gitlab.com/thorchain/thornode) (For THORNode Software)
# CHECKLIST
Checklist of items for Node Operators
## Deploying
* [ ] I have set up a local `thornode` repository with a `cluster-launcher` and `node-launcher` git cloned into the right sub-folders
* [ ] I have installed all the pre-requisites
* [ ] I have a AWS/DO account ready with credentials if using a service provider
* [ ] I have deployed a cluster and saved my node details (name of node, region)
* [ ] I have installed tools via `make tools`
* [ ] I have deployed a node by running `make mainnet-validator`
* [ ] I have securely saved my THORNode Password and THORNode Mnemonic
{% content-ref url="/pages/KOVyvL9C028BNKA5rxlw" %}
[Cluster Launcher](/thornodes/kubernetes)
{% endcontent-ref %}
{% content-ref url="/pages/FDqh84xQVZS59Rrcmrof" %}
[Deploying](/thornodes/deploying)
{% endcontent-ref %}
## Joining
* [ ] I have retrieved the latest VAULT address and sent a small test bond
* [ ] I have confirmed my node has been credited the small bond
* [ ] (Optional) I have confirmed I can unbond a small amount
* [ ] I have sent the final bond, higher than the MinimumBond
* [ ] I have run `make set-ip-address` to set my Node's IP address
* [ ] I have run `make set-node-keys` to set my Node's public keys
* [ ] I have run `make set-version` to set my Node's version
* [ ] I have verfied in `make status` that my node is ready to churn in
* [ ] (Optional) I have added my node key to the Telegram Bot for notifications
{% content-ref url="/pages/cPfGgXpXBkXVvwyZMbhT" %}
[Joining](/thornodes/joining)
{% endcontent-ref %}
{% hint style="info" %}
The BOND memo is `BOND:<node-address>`
{% endhint %}
## Upgrading
* [ ] I have run `make status` to verify the current state of my node
* [ ] I have run `kubectl get pods -n thornode` to verify all my node's services are running properly, resetting any that are faulty
* [ ] I have run the upgrade command
* [ ] I have run `make set-version` to set my new Node version
* [ ] I have run `make status` to verify the final state of my node
## Unbonding
* [ ] I have waited until my node is churned out and is in `standby`
* [ ] I have sent an UNBOND transaction from the same wallet registered to my node
* [ ] I have verified that I have received my BOND back
{% content-ref url="/pages/lT1adLDxEt4QovlTHz9z" %}
[Leaving](/thornodes/leaving)
{% endcontent-ref %}
{% hint style="info" %}
The UNBOND memo is `UNBOND:<node-address>:<amount>`
{% endhint %}
## Leaving Whilst Active
* [ ] I have confirmed my node is active and I wish to leave before waiting to churn naturally
* [ ] I have sent the first LEAVE transaction and verified my node has "requested to leave".
* [ ] I have verified that a churn has taken place and my node is in STANDBY
* [ ] I have verified that my node has returned hot funds
* [ ] I have sent the final LEAVE transaction and received my bond back
{% content-ref url="/pages/lT1adLDxEt4QovlTHz9z" %}
[Leaving](/thornodes/leaving)
{% endcontent-ref %}
{% hint style="info" %}
The LEAVE memo is `LEAVE:<node-address>`
{% endhint %}
## Leaving Whilst Standby
* [ ] I have verified that a churn has taken place and my node is in STANDBY
* [ ] I have verified that my node has returned all funds
* [ ] I have sent the final LEAVE transaction and received my bond back
{% content-ref url="/pages/lT1adLDxEt4QovlTHz9z" %}
[Leaving](/thornodes/leaving)
{% endcontent-ref %}
## Destroying a Node
* [ ] I have verified that I have either UNBONDED my entire BOND or LEFT and received my BOND back.
* [ ] I have run `make destroy destroy-tools` to destroy my node from `node-launcher`
* [ ] I have run `make destroy-aws` to destroy my cluster from `cluster-launcher`
{% content-ref url="/pages/lT1adLDxEt4QovlTHz9z" %}
[Leaving](/thornodes/leaving)
{% endcontent-ref %}
# Multi-node Deployment
Some node operators may desire to run multiple validators within the same cluster, while sharing a single set of daemons among them to save resource cost. This can be performed via the following method. These instructions are relevant for mainnet at the time of writing, but please ensure that correct network and current set of daemons are used.
{% embed url="<https://gitlab.com/thorchain/devops/node-launcher/-/blob/master/docs/Multi-Validator-Cluster.md>" %}
# Developing
Deploying a custom stagenet to have a developer-controlled environment
THORChain uses multiple network environments to move from an idea to mainnet deployment, each with a specific role:
* **Mainnet**: The live production network where real assets are transacted. Security and reliability are ensured through validator consensus, with only well-tested changes deployed to minimize risks.
* **Stagenet**: A pre-production network mirroring mainnet, used to test new features and chain integrations with real assets an프로젝트로 돌아가기