migrating javascript ssb pub to go ssb pub?
mhfowler opened this issue · 2 comments
I had a javascript ssb pub, and I would like to migrate it to be a go ssb pub.
I imagined putting the right secret and private key into ~/.ssb-go , and then letting the database "repopulate".
what info is needed exactly for go ssb to repopulate correctly starting from a private key?
If you only managed to backup the secret
file, that is enough to bootstrap from the network. ~/.ssb-go/secret
is the correct location. You would just have to point it to at another peer (or let another peer connect to it) to resync via network.
If you also still have the ~/.ssb/flume/log.offset
file from a ssb-db(1) installation, you can use cmd/ssb-offset-converter
from this repo which we made for netsim but is general purpose. ssb-offset-converter -if lfo ~/.ssb/flume/log.offset ~/.ssb-go/log
should create three files (data, ofst and jrnl) in ~/.ssb-go/log
and they will contain all the messages in the JS offset file. When you now start the go-sbot it will just reindex them an be at the state of the previous JS installation without any need for network i/o.
thanks @cryptix. Repopulating from ~/.ssb-go/secret appeared to work. I just created an empty directory with the secret file, then ran:
sbotcli connect "net:ssb.learningsocieties.org:8008~shs:uMiN0TRVMGVNTQUb6KCbiOi/8UQYcyojiA83rCghxGo="
and after that ./sbotcli log
returned all my latest feeds. leaving this here for anyone else who finds this issue.