mrusme / superhighway84

USENET-inspired, uncensorable, decentralized internet discussion system running on IPFS & OrbitDB
https://xn--gckvb8fzb.com/superhighway84
GNU General Public License v3.0
694 stars 24 forks source link

[Bug] "initializing TUI and loading database, please wait ..." wait forever #42

Closed diyism closed 2 years ago

diyism commented 2 years ago
$ ipfs version
ipfs version 0.12.2

$ git clone --depth 1 https://github.com/mrusme/superhighway84
$ cd superhighway84
$ nano go.mod        #modify ipfs version from "github.com/ipfs/go-ipfs v0.11.0" to "github.com/ipfs/go-ipfs v0.12.2"
$ go mod tidy
$ go build .
$ killall ipfs
$ ./superhighway84
2022/04/16 00:55:38 loading configuration ...
2022/04/16 00:55:38 initializing logger ...
2022/04/16 00:55:38 initializing cache ...
2022/04/16 00:55:38 initializing TUI and loading database, please wait ...

# It seems it will wait forever
mrusme commented 2 years ago

You're not supposed to modify the deps on your own. Your local IPFS version has basically nothing to do with Superhighway84. Just clone, build and start. Wait a little initially as it takes some time to sync the db.

diyism commented 2 years ago

The current code in https://github.com/mrusme/superhighway84 won't work:

$ git restore .

$ git log
commit 8802d55663e4821aa47742529fe32c54dbf6ff6b (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: マリウス <marius@xn--gckvb8fzb.com>
Date:   Sun Apr 3 16:01:53 2022 -0500

$ go build .
$ killall ipfs

$ ./superhighway84
2022/04/16 11:30:50 loading configuration ...
2022/04/16 11:30:50 initializing logger ...
2022/04/16 11:30:50 initializing cache ...
2022/04/16 11:30:50 initializing TUI and loading database, please wait ...
2022/04/16 11:30:51 Your programs version (11) is lower than your repos (12).
Please update ipfs to a version that supports the existing repo, or run
a migration in reverse.

See https://github.com/ipfs/fs-repo-migrations/blob/master/run.md for details.
panic: Your programs version (11) is lower than your repos (12).
Please update ipfs to a version that supports the existing repo, or run
a migration in reverse.

See https://github.com/ipfs/fs-repo-migrations/blob/master/run.md for details.

goroutine 1 [running]:
log.Panicln({0xc00260ff48, 0xc0000bb500, 0xc0006a9080})
    /home/malcolm/WorkSpace/forkgo/gosrc/go/src/log/log.go:645 +0x65
main.main()
    /home/malcolm/Downloads/test/superhigh/superhighway84/superhighway84.go:155 +0x5e6
mrusme commented 2 years ago

Please refer to the RUNNING section in the README.md. You can find out how to run IPFS alongside Superhighway84 there.

Sorry, I overlooked the following line and was under the assumption that you were trying to use both, the official IPFS daemon as well as Superhighway84 simultaneously:

panic: Your programs version (11) is lower than your repos (12).

This lines tells that you have the IPFS repo initialized with a newer IPFS version than Superhighway84 is using internally. Indeed, in this case Superhighway84 is indeed sort of depending on your local IPFS version - but not in the sense of dependencies or the binary. It simply requires you to provide an IPFS repo that was initialized using the same IPFS version.

The reason why Superhighway84 can't use the latest IPFS version can be looked up in the README.md under KNOWN LIMITATIONS.

As for your specific case, I would suggest you to simply download version 11 of the IPFS binary from go-ipfs, do not install it but rather just run it from the downloads folder with the instructions given in the Superhighway84 README.md for creating a dedicated IPFS repository:

$ cd downloads/ipfs-binary/
$ export IPFS_PATH=~/.ipfs-sh84
$ ./ipfs init
$ superhighway84

Then make sure to always export the IPFS_PATH accordingly before starting Superhighway84. In case you're looking to run both, the official IPFS as well as Superhighway84 simultaneously, please consider the remarks given in the README.md.

Hope this helps!

mrusme commented 2 years ago

I've created a todo to implement a way for initializing the repo through Superhighway84 in the future.

diyism commented 2 years ago
$ wget https://ipfs.io/ipns/dist.ipfs.io/go-ipfs/v0.11.1/go-ipfs_v0.11.1_linux-amd64.tar.gz
$ tar xzf go-ipfs_v0.11.1_linux-amd64.tar.gz
$ export IPFS_PATH=~/.ipfs-sh84
$ ./go-ipfs/ipfs init
$ ./superhighway84
#first time, it shows the TUI
#I type ctrl+c  to close it
$./superhighway84
#now it wait forever with "initializing TUI and loading database, please wait ..."
mrusme commented 2 years ago

Define forever. :-) It could take a while for IPFS to sync, indeed. It really depends on the amount of peers. You might give it a few tries at first to see whether that's really not just a latency issue.

When you started it the first time, did you see any content? If not I assume the IPFS repo wasn't synced yet. If you did and now it doesn't come back up, then it's tricky indeed. 🤔

mrusme commented 2 years ago

On a side-note, your profile says Shanghai, China. Trying not to be insensitive, but have you tried whether IPFS generally works from your location? Just to make sure it's not blocked. For example, I had a situation while in Spain where IPFS was indeed blocked by the provider.

diyism commented 2 years ago

Amazing, it works after waiting for 5 minutes.

2022-04-17-021536_2560x1688_scrot

mrusme commented 2 years ago

:-) cool, happy to hear!

FYI: Subsequent updates of the IPFS repo should be much quicker from now on. So it's not like you'll have to wait 5 minutes every time you start it. It's really just the initial sync that takes forever, heh.

mrusme commented 2 years ago

FYI: go-orbit-db was upgraded to 1.17.1, which now uses go-ipfs 0.12.2. I have just pushed an update, 0.2.0, which includes the updated libraries. Now Superhighway84 is able to run on IPFS 0.12 repositories!

diyism commented 2 years ago

Great, thank you.