Skip to content

Resume Support

FuryMesh includes robust support for resuming interrupted file transfers, allowing you to continue downloads from where they left off rather than starting over. This feature is particularly valuable for large files or in environments with unreliable connections.

How It Works

When a file transfer is in progress, FuryMesh:

  1. Tracks which chunks have been successfully downloaded
  2. Periodically saves this information to a resume data file
  3. If the transfer is interrupted, the resume data can be used to continue the transfer later

When resuming a transfer, FuryMesh:

  1. Loads the resume data for the file
  2. Identifies which chunks have already been downloaded
  3. Requests only the missing chunks from peers
  4. Continues the transfer from where it left off

Using Resume Support

Basic Usage

If a transfer is interrupted (for example, if you close FuryMesh or lose your internet connection), you can resume it using the resume command:

# Resume a transfer
furymesh resume --file-id <file-id>

FuryMesh will automatically detect which chunks have already been downloaded and will only request the missing ones.

You can monitor the progress of the resumed transfer:

Resuming transfer for file 3f7b8a1c2d9e4f5a6b7c8d9e0f1a2b3c...
Found resume data: 13/20 chunks already downloaded (65%)
Requesting remaining 7 chunks...

Progress: [====================] 100% Complete
File saved to /path/to/output/file.txt

Combining with Multi-Peer Transfers

Resume support works seamlessly with Multi-Peer Transfers. When resuming a transfer, FuryMesh can download the remaining chunks from multiple peers:

# Resume a transfer using multiple peers
furymesh resume --file-id <file-id> --multi-peer

Configuring Resume Support

You can configure resume support in your configuration file:

# config.yaml
transfer:
  # Enable or disable resume support
  resume_enabled: true
  # Directory to store resume data
  resume_dir: "./data/resume"
  # How often to save resume data (in seconds)
  resume_save_interval: 30

Start FuryMesh with this configuration:

furymesh start --config config.yaml

Command Line Options

When using the resume command, you can specify several options:

# Resume a transfer with a specific output path
furymesh resume --file-id <file-id> --output /path/to/output

# Resume a transfer with a specific peer
furymesh resume --file-id <file-id> --peer-id <peer-id>

# Resume a transfer with verbose output
furymesh resume --file-id <file-id> --verbose

Viewing Resume Data

You can view information about available resume data:

furymesh list-resume

This will show all files that have resume data available:

+----------------------------------+-------------+----------+-------+------------+
| File ID                          | Name        | Size     | Chunks | Progress   |
+----------------------------------+-------------+----------+-------+------------+
| 3f7b8a1c2d9e4f5a6b7c8d9e0f1a2b3c | file.txt    | 1.2 MB   | 5/10   | 50%        |
| 7a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d | image.jpg   | 2.5 MB   | 8/10   | 80%        |
+----------------------------------+-------------+----------+-------+------------+

For more detailed information about a specific file's resume data:

furymesh resume-info --file-id <file-id>

This will show detailed information about the resume data:

Resume Data for file 3f7b8a1c2d9e4f5a6b7c8d9e0f1a2b3c:
File Name: file.txt
File Size: 1.2 MB
Total Chunks: 10
Completed Chunks: 5 (50%)
Last Updated: 2025-03-09 15:30:45

Chunk Status:
[X][X][X][X][X][_][_][_][_][_]

Cleaning Up Resume Data

Resume data is automatically deleted when a transfer is completed successfully. However, you can manually clean up resume data if needed:

# Delete resume data for a specific file
furymesh clean-resume --file-id <file-id>

# Delete all resume data
furymesh clean-resume --all

Performance Considerations

Storage Usage

Resume data is stored in the resume directory specified in your configuration. The amount of storage used is minimal, typically just a few kilobytes per file.

Resume Frequency

By default, FuryMesh saves resume data every 30 seconds during a transfer and whenever a chunk is successfully downloaded. You can adjust this interval in the configuration:

transfer:
  resume_save_interval: 60  # Save every 60 seconds

A shorter interval provides better protection against data loss but may cause more disk I/O.

Encryption

If you're using encryption for your transfers, the resume data will include information about the encryption keys used. When resuming an encrypted transfer, FuryMesh will automatically use the correct keys.

Troubleshooting

Missing Resume Data

If resume data is missing or corrupted, FuryMesh will start the transfer from the beginning. This can happen if:

  • The resume data file was deleted
  • The resume data file was corrupted
  • The resume feature was disabled when the original transfer was started

Incomplete Chunks

If a chunk was partially downloaded when the transfer was interrupted, FuryMesh will request the entire chunk again. This ensures data integrity but may result in some redundant data transfer.

Changing Peers

When resuming a transfer, you can use different peers than the ones used in the original transfer. FuryMesh will request the missing chunks from the available peers, regardless of which peers were used originally.

Conclusion

Resume support is a powerful feature that makes FuryMesh resilient to interruptions and network issues. By saving and restoring transfer state, it ensures that you can efficiently download files even in challenging network environments.