Pause and Resume
If you've deployed an Avalanche L1, you can preserve and restore the state of your deployed Avalanche L1s.
In this section, you’ll learn how to pause and resume your deployed Avalanche L1 using GitHub Codespaces. This will allow you to preserve the state of your blockchains and easily restore them when you return to development.
Restarting the Network After Codespace Pauses
With GitHub Codespaces, you can easily spin up and manage your Avalanche L1 blockchains. However, after a period of inactivity, Codespace instances will automatically pause, or you can stop them manually.
When you want to resume your work, start the Codespace instance again and follow these steps to restore your network.
Start the Avalanche Network
After restarting your Codespace instance, use the following command to restart your Avalanche network:
Here’s what the output of this command looks like:
Make Ports Public Again
After the network starts, all ports are closed by default in Codespaces. You need to make the necessary ports public, like port 9650
for RPC access:
- Open the Codespace settings.
- Go to Ports.
- Select the row with the port 9650.
- Right Click > Port Visibility > Public.
Changing Timeout Duration for Codespaces
By default, Codespaces will pause after 30 minutes of inactivity. You can extend this period to up to 4 hours to avoid frequent pauses during development.
To configure the timeout duration:
- In the upper-right corner of any page on GitHub, click your profile photo, then click "Settings".
- In the "Code, planning, and automation" section of the sidebar, click "Codespaces".
- Under "Default idle timeout", enter the time that you want, then click Save. The time must be between 5 minutes and 240 minutes (4 hours).
This will help keep your blockchain running for longer periods without interruption.
Fee Considerations for Paid Users
If you're a paid user, be cautious about the costs associated with running long-running Codespaces. It's important to avoid undesired fees, especially if you're keeping instances alive for extended periods but also the resource usage. Memory, storage, traffic, and bandwidth usage can significantly impact costs if not managed properly.
You can manage these settings in GitHub:
- In the upper-right corner of any page on GitHub, click your profile photo, then click "Settings".
- In the "Access" section of the sidebar, click "Billing and Plans", and click "Spending Limits".
- Set a budget or limitation on Codespace usage to prevent unexpected fees. Leaving it at $0.00 will avoid any extra expenses.