[BUG] Sync issues with changing external IP from ISP + workaround solution
See original GitHub issueDescribe the bug In germany we get disconnected with our IPv4 addresses every 24h. After disconnect and reconnect we do get a new external IP. As soon as this happens at a certain time in the night, sync of chia full client gets lost.
To Reproduce
- reboot router
- change external IP
Expected behavior Chia client should be able to reconnect by itself after external IP change
Screenshots n/a
Desktop (please complete the following information):
- OS: Windows 10
- Port 8444 open from external
Additional context Possible workaround below for FritzBox users developed. Windows Powershell-Script checks for external IP-change on FritzBox router via UPNP / SOAP request and will initiate a restart via “./chia.exe start farmer -r”. Tested on FritzBox 7530, maybe this helps somebody until final fix.
function check-ip{
param (
[String] $URL = "http://192.168.178.1:49000/igdupnp/control/WANIPConn1"
)
$soapWebRequest = [System.Net.WebRequest]::Create($URL)
$soapWebRequest.Headers.Add("SOAPAction",'"urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress"')
$soapWebRequest.ContentType = 'text/xml;charset="utf-8"'
$soapWebRequest.Accept = "text/xml"
$soapWebRequest.Method = "POST"
$requestStream = $soapWebRequest.GetRequestStream()
[string]$SOAPRequest='<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetExternalIPAddress xmlns:u=urn:schemas-upnp-org:service:WANIPConnection:1 />
</s:Body>
</s:Envelope>';
$SOAPRequestbytearray = ([system.Text.Encoding]::ASCII).GetBytes($SOAPRequest)
$requestStream.write($SOAPRequestbytearray,0,$SOAPRequestbytearray.count)
$requestStream.Close()
$resp = $soapWebRequest.GetResponse()
$responseStream = $resp.GetResponseStream()
$soapReader = [System.IO.StreamReader]($responseStream)
$ReturnXml = [Xml] $soapReader.ReadToEnd()
$responseStream.Close()
$ip=$ReturnXml.Envelope.Body.GetExternalIPAddressResponse|foreach { $_.NewExternalIPAddress }
return $ip
}
# VARIABLES
$localappdata=$env:LOCALAPPDATA
$chiapath="chia-blockchain\app-1.1.5\resources\app.asar.unpacked\daemon"
$currentIP=check-ip
$lastIP=$currentIP
if (Test-Path -Path $localappdata\$chiapath\chia.exe){
write-host "Path to chia.exe checked and valid"
}else{
write-host "Path to chia.exe NOT valid, please check script"
pause
exit
}
write-host ""
write-host "Your current FritzBox external IP: $currentIP"
write-host "Start monitoring " -NoNewline
while($true){
if(test-connection 8.8.8.8 -quiet){
$currentIP = check-ip
}
if ($currentIP -ne $lastIP){
cls
write-host "IP change detected !"
write-host "Old IP: $lastIP New IP: $currentIP"
$lastIP = $currentIP
write-host "Restarting chia client now ..."
start-process $localappdata\$chiapath\chia.exe -argumentlist "start farmer -r"
write-host ""
write-host "Start monitoring " -NoNewLine
}
Start-Sleep -Seconds 360
write-host "." -NoNewline
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
Loopback to forwarded Public IP address from local network
1.2:80) without changing the source IP (192.168.1.3); Client waits for a SYN-ACK from the external IP; Server send his answer back to the...
Read more >What's an IP Conflict and How Do You Resolve It? - MakeUseOf
Click Change adapter options on this menu, then double-click the name of your network connection in the resulting window.
Read more >Dynamic DNS (DDNS) Troubleshooting Guide | Support - No-IP
Use this basic troubleshooting guide to navigate through the most common errors you may run into when using No-IP's services.
Read more >Incorrect IP in contact header - FreePBX Community Forums
When connecting to FreePBX via PJSIP from outside the local network everything works just fine most of the time.
Read more >When Your ISP Won't Give You A Static IP - Inlets
The workaround here is for you to install software on your router, or on a PC in your home to continually update a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
same here in the CLI. “-t” is the first temp directory “-2” is the second temporary location (like in the GUI) and “-d” defines final directory. You can leave out “-2” location if do not have separate “slow” SSD’s. Check https://github.com/Chia-Network/chia-blockchain/wiki/CLI-Commands-Reference for all CLI options.
Add your comment to my request to just decouple plotting from the rest so we can restart Chia GUI anytime without losing plotting in progress.
https://github.com/Chia-Network/chia-blockchain/discussions/5467