For some reason, go-sbot was not accepting connections when the address was specified in config.toml as:
lis = "127.0.0.1:8008" (version A)
However, if we specified the address in config.toml as:
lis = ":8008" (version B)
then go-sbot would happily accept connections, invites and sync with peers :-)
However, if we specified the address as so, then golgi stopped being able to communicate with go-sbot for some reason.
So it was a sort of catch22, which took me a while to pin down exactly, where in version A go-sbot can talk to peers, and in version B golgi can talk to go-sbot.
I'm not sure why this is the case, but empirically this is what I found.
In this PR, I make it so that if golgi finds that a configured address starts with :, then it prefixes it with 127.0.0.1.
This is tested and now if we specify the address with version A in config.toml, then both things are working.
For some reason, go-sbot was not accepting connections when the address was specified in config.toml as:
lis = "127.0.0.1:8008" (version A)
However, if we specified the address in config.toml as:
lis = ":8008" (version B)
then go-sbot would happily accept connections, invites and sync with peers :-)
However, if we specified the address as so, then golgi stopped being able to communicate with go-sbot for some reason.
So it was a sort of catch22, which took me a while to pin down exactly, where in version A go-sbot can talk to peers, and in version B golgi can talk to go-sbot.
I'm not sure why this is the case, but empirically this is what I found.
In this PR, I make it so that if golgi finds that a configured address starts with :, then it prefixes it with 127.0.0.1.
This is tested and now if we specify the address with version A in config.toml, then both things are working.
notplants
requested review from glyph 2022-05-26 21:16:04 +00:00
@notplants
The behaviour of version B matches the example given in the go-sbot config example: https://github.com/cryptoscope/ssb/blob/27a936da805d127f22af539760849e03f07358e6/docs/config.md
I suspect version A would have worked if you used `localhost` instead of `127.0.0.1`. That's the approach I was using when testing PeachPub.
I wonder if it's better to prefix `localhost` or `127.0.0.1`, and what the difference might be?
Here's how I handle the `lis` config value for display in the web interface sbot settings page: https://git.coopcloud.tech/PeachCloud/peach-workspace/src/branch/main/peach-web/src/routes/settings/scuttlebutt/configure.rs#L36
Interesting question, I hadn't looked this up before either. According to this post and this post localhost is usually just a local domain which is mapped to the IP address 127.0.0.1 which is the "self" ip address. The first post also says that using 127.0.0.1 is faster than localhost because it doesn't require a lookup of the IP address from the domain (although I guess this difference is negligible).
Interesting question, I hadn't looked this up before either. According to [this post](https://www.tutorialspoint.com/difference-between-localhost-and-127-0-0-1) and [this post](https://www.quora.com/Is-there-any-difference-between-localhost-and-127-0-0-1?share=1) localhost is usually just a local domain which is mapped to the IP address 127.0.0.1 which is the "self" ip address. The first post also says that using 127.0.0.1 is faster than localhost because it doesn't require a lookup of the IP address from the domain (although I guess this difference is negligible).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
For some reason, go-sbot was not accepting connections when the address was specified in config.toml as:
lis = "127.0.0.1:8008" (version A)
However, if we specified the address in config.toml as:
lis = ":8008" (version B)
then go-sbot would happily accept connections, invites and sync with peers :-)
However, if we specified the address as so, then golgi stopped being able to communicate with go-sbot for some reason.
So it was a sort of catch22, which took me a while to pin down exactly, where in version A go-sbot can talk to peers, and in version B golgi can talk to go-sbot.
I'm not sure why this is the case, but empirically this is what I found.
In this PR, I make it so that if golgi finds that a configured address starts with :, then it prefixes it with 127.0.0.1.
This is tested and now if we specify the address with version A in config.toml, then both things are working.
@notplants
The behaviour of version B matches the example given in the go-sbot config example: https://github.com/cryptoscope/ssb/blob/27a936da805d127f22af539760849e03f07358e6/docs/config.md
I suspect version A would have worked if you used
localhostinstead of127.0.0.1. That's the approach I was using when testing PeachPub.I wonder if it's better to prefix
localhostor127.0.0.1, and what the difference might be?Here's how I handle the
lisconfig value for display in the web interface sbot settings page: https://git.coopcloud.tech/PeachCloud/peach-workspace/src/branch/main/peach-web/src/routes/settings/scuttlebutt/configure.rs#L36Interesting question, I hadn't looked this up before either. According to this post and this post localhost is usually just a local domain which is mapped to the IP address 127.0.0.1 which is the "self" ip address. The first post also says that using 127.0.0.1 is faster than localhost because it doesn't require a lookup of the IP address from the domain (although I guess this difference is negligible).
All these committs were merged via this PR #41, so I am closing this branch.
Pull request closed