WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

Node Migration Guide - Complete

All Tasks Completed ✅

  • Reviewed existing documentation (migration-service.md, migration-service-how-to.md)
  • Examined backup-cli crate and its commands
  • Analyzed contract migration methods
  • Studied test files to understand real-world migration workflow
  • Created comprehensive node migration guide (docs/node-migration-guide.md)
  • Updated migration-service-how-to.md to reference new guide
  • Addressed all code review feedback
  • Added detailed explanations of JSON structure
  • Updated installation to use cargo install
  • Added note about encryption key file location
  • Updated cargo install command with --locked flag
  • Added contract state retrieval step

Recent Updates (Addressing PR Comments)

Comment 2636513358: Added step to get contract state before backup

  • Added new "Get Contract State" section before the backup step
  • Includes command to query contract state using near contract call-function as-read-only
  • Saves contract state to $BACKUP_HOME_DIR/contract_state.json
  • Explains that backup-cli uses this to determine which keyshares to request

Comment 2636490048: Updated cargo install command

  • Changed path from /path/to/mpc/repository/crates/backup-cli to crates/backup-cli (assumes repository root)
  • Added --locked flag to ensure correct dependency versions
  • Updated description to clarify running from repository root

Comment 2636460323: Changed installation method to use cargo install instead of building from source

  • Updated all command invocations from ./target/release/backup-cli to just backup-cli
  • Simplified installation instructions

Comment 2636462302: Added note about finding encryption key on existing nodes

  • Added information about backup_encryption_key.hex file in $MPC_HOME directory
  • Included command to retrieve the key from the file

Documentation Created

New File: docs/node-migration-guide.md

  • Complete step-by-step migration process (9 steps)
  • Prerequisites and setup instructions
  • All necessary commands with concrete, accurate examples
  • Detailed field explanations for contract method calls
  • Security considerations and best practices
  • Troubleshooting section
  • Cross-references to related documentation

Updated File: docs/migration-service-how-to.md

  • Added reference to the new detailed guide

Acceptance Criteria Met ✅

✅ Guide allows node operators to easily migrate a node
✅ Covers all commands needed to perform migration
✅ Accurate JSON structures matching contract interface
✅ Troubleshooting and security considerations included
✅ Integrates with existing documentation structure
✅ Clear explanations of potentially confusing structures
✅ Simplified installation and command usage
✅ Information about encryption key storage location
✅ Easy to copy-paste commands with correct dependency locking
✅ Includes contract state retrieval for backup operations

Original prompt

This section details on the original issue you should resolve

<issue_title>Public guide for how to perform node migrations</issue_title>
<issue_description>### Background

Currently there's no simple guide for which commands to run to perform a node migration using the backup CLI.

User Story

As a node operator I'd like to be able to find instructions to help me migrate my nodes between cloud providers.

Acceptance Criteria

We have a guide that allows a node operator to easily migrate a node.

Resources & Additional Notes

No response</issue_description>

<agent_instructions>Look through the existing docs in the /docs/ folder to understand which pieces are already explained. Especially the migration-service docs for an explanation of the migration functionality. Look through the backup-cli crate to understand how it works, and the contract in crates/contract/src/lib.rs to understand the interface for migrations.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add public guide for node migrations docs: add node migration guide for operators Dec 19, 2025
Copilot AI requested a review from netrome December 19, 2025 12:54
Copy link
Collaborator

@netrome netrome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes requested.

Copilot AI requested a review from netrome December 19, 2025 22:24
Install the backup-cli tool using cargo:

```bash
cargo install --path /path/to/mpc/repository/crates/backup-cli
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you write this assuming the reader is at the crate root to make this easy to copy-paste? Also add the --locked argument to ensure it's using the right versions of dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use relative path crates/backup-cli (assumes repository root) and added --locked flag. See commit 4c7e81d.

Copilot AI requested a review from netrome December 19, 2025 22:38
Comment on lines +131 to +138
```bash
backup-cli \
--home-dir $BACKUP_HOME_DIR \
get-keyshares \
--mpc-node-address node.example.com:3000 \
--mpc-node-p2p-key "ed25519:YourNodeP2PPublicKey..." \
--backup-encryption-key-hex $BACKUP_ENCRYPTION_KEY
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Before running this we need to get the contract state and write it to the $BACKUP_HOME_DIR/contract_state.json - can you add this to the instructions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new "Get Contract State" section before the backup step with the command to query and save the contract state to $BACKUP_HOME_DIR/contract_state.json. See commit 893b17d.

Copilot AI requested a review from netrome December 19, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public guide for how to perform node migrations

2 participants