thousandetherhomepage / ketherhomepage

Own a piece of blockchain history!
https://thousandetherhomepage.com
MIT License
144 stars 38 forks source link

ipfs deployment #21

Open mveytsman opened 7 years ago

mveytsman commented 7 years ago

Here's what I was expecting to do:

1) Create a shared ipfs key (there's one in keybase now called ketherkey) 2) On deploy run ipfs add thousandetherhomepage.github.io -> this returns a hash 3) run ipfs name publish --key=ketherkey /ipfs/<HASH> this fixes to a for ketherkey which is constant 4) Set a DNS TXT record of /ipns/<PeerID> 5) Now we're available at /ipfs/<HASH> (only this version) or /ipns/<PeerID> (immutable name) or /ipns/thousandetherhomepage.com (immutable name)

This should work in theory, but it looks like ipns is pretty slow on resolution based on my testing. The PeerID for the ketherkey isQmPNsQkxFh5zp6CaGDTp1EhZzhH6Tre6Bdt12ZrY7M8q4k and you'll see that https://gateway.ipfs.io/ipns/QmPNsQkxFh5zp6CaGDTp1EhZzhH6Tre6Bdt12ZrY7M8q4k is much slower than https://gateway.ipfs.io/ipfs/QmbmyPwSTn4XZQnc2GJ6WxfQQXVCQcT74tCeZWRjbNNWL5/

This appears to be a known issue, i.e. see https://github.com/ipfs/go-ipfs/issues/3860#issuecomment-335063820

One thing we can do is skip ipns and just use the DNS. If we set the TXT record to /ipfs/<HASH>, then /ipns/thousandetherhomepage.com should resolve to the ipfs hash, skipping slow ipns resolution.

The problem is that we would have to update DNS on every deploy to point to the latest version. We can do this manually, or if it's too much effort we can use the Cloudflare API. Unfortunately, Cloudflare doesn't have per-domain keys, so if we're sharing this API key, we'd need to create a new Cloudflare account just for thousandetherhomepage.com and move the domain to it....

What do you think about all of this @shazow

shazow commented 7 years ago

IMO implement it "properly" and let it be slow until IPNS is fixed. Meanwhile we can workaround with publishing the latest hash somewhere and let people access it directly if they want?

mveytsman commented 7 years ago

In that case, can you start by setting a TXT record of dnslink=/ipns/QmPNsQkxFh5zp6CaGDTp1EhZzhH6Tre6Bdt12ZrY7M8q4k to thousandetherhomepage.com

mveytsman commented 7 years ago

Linking this for future reference https://github.com/ipfs/examples/tree/master/examples/websites

shazow commented 7 years ago

Done.

mveytsman commented 7 years ago

https://gateway.ipfs.io/ipns/thousandetherhomepage.com/ works for me!!!

mveytsman commented 7 years ago

TODO