@@ -48,6 +48,7 @@ Commands:
4848 init --resume Continue init from where it left off (after deploy failure)
4949 update-config Update existing node configs without wiping data
5050 update-binaries Pull latest code, build, and install binaries on all validators
51+ deploy-binaries Copy existing binaries to validators (no build)
5152 check Comprehensive health check on all nodes
5253 diagnose [name] Detailed diagnostics for troubleshooting (all or one validator)
5354 restart Graceful restart of all nodes
@@ -95,6 +96,7 @@ Examples:
9596 $0 check # Run health checks
9697 $0 update-binaries --branch main # Update binaries from main branch
9798 $0 update-binaries -C local --branch main # Build locally, deploy to validators
99+ $0 deploy-binaries --path ./target/release # Copy binaries to all validators
98100 $0 watch-finality # Monitor parent finality progress
99101 $0 watch-blocks # Monitor block production
100102 $0 logs validator-1 # View logs from validator-1
486488 update_all_binaries " $branch " " $compile_mode "
487489}
488490
491+ # Deploy binaries to validators (copy only, no build)
492+ cmd_deploy_binaries () {
493+ local binary_path=" "
494+ local target_validator=" "
495+
496+ # Parse options
497+ while [[ $# -gt 0 ]]; do
498+ case $1 in
499+ --path)
500+ binary_path=" $2 "
501+ shift 2
502+ ;;
503+ --help|-h)
504+ cat << EOF
505+ Copy ipc-cli and fendermint binaries to validators (no build)
506+
507+ Usage: $0 deploy-binaries [options] [validator-name]
508+
509+ Options:
510+ --path DIR Path to directory containing ipc-cli and fendermint
511+ --help Show this help message
512+
513+ If --path is omitted, auto-detects from local IPC repo:
514+ - target/release/ (native build)
515+ - target/x86_64-unknown-linux-gnu/release/ (cross-compiled)
516+
517+ Examples:
518+ $0 deploy-binaries --path ./target/release
519+ $0 deploy-binaries --path ./target/x86_64-unknown-linux-gnu/release
520+ $0 deploy-binaries validator-2 # Deploy to single validator (uses auto-detect path)
521+ EOF
522+ exit 0
523+ ;;
524+ -* )
525+ log_error " Unknown option: $1 "
526+ exit 1
527+ ;;
528+ * )
529+ target_validator=" $1 "
530+ shift
531+ ;;
532+ esac
533+ done
534+
535+ load_config
536+
537+ # Auto-detect path if not specified
538+ if [ -z " $binary_path " ]; then
539+ local local_repo
540+ local_repo=$( get_config_value " paths.local_ipc_repo" 2> /dev/null || true)
541+ if [ -z " $local_repo " ] || [ " $local_repo " = " null" ]; then
542+ local_repo=$( cd " ${SCRIPT_DIR} /../.." && pwd)
543+ fi
544+ if [ -f " $local_repo /target/release/ipc-cli" ]; then
545+ binary_path=" $local_repo /target/release"
546+ elif [ -f " $local_repo /target/x86_64-unknown-linux-gnu/release/ipc-cli" ]; then
547+ binary_path=" $local_repo /target/x86_64-unknown-linux-gnu/release"
548+ else
549+ log_error " Binaries not found. Specify --path or run from IPC repo with built binaries."
550+ log_info " Expected: target/release/ or target/x86_64-unknown-linux-gnu/release/"
551+ exit 1
552+ fi
553+ log_info " Using binaries from: $binary_path "
554+ fi
555+
556+ binary_path=$( cd " $binary_path " 2> /dev/null && pwd)
557+ if [ -z " $binary_path " ]; then
558+ log_error " Invalid path"
559+ exit 1
560+ fi
561+
562+ log_header " Deploying Binaries"
563+ deploy_binaries_only " $binary_path " " $target_validator "
564+ }
565+
489566# Update existing node configs
490567cmd_update_config () {
491568 log_header " Updating Node Configurations"
@@ -868,7 +945,7 @@ main() {
868945
869946 # Acquire lock for destructive operations
870947 case $command in
871- init|restart|update-binaries)
948+ init|restart|update-binaries|deploy-binaries )
872949 acquire_lock
873950 ;;
874951 esac
@@ -887,6 +964,9 @@ main() {
887964 update-binaries)
888965 cmd_update_binaries " $@ "
889966 ;;
967+ deploy-binaries)
968+ cmd_deploy_binaries " $@ "
969+ ;;
890970 check)
891971 cmd_check " $@ "
892972 ;;
0 commit comments