Proposal. IPFS dynamic website.

Proposal. IPFS dynamic website.

1)) We have 2 computers, caller_pc and responder_pc with IPs: caller_ip and responder_ip;

2)) The responder_pc has several files:
QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp34a
QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp34b
QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp34c

3)) The responder_pc has a small database, say sqlite, with 2 columns:

‘picture_jhon_2009.jpg’, QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp34a
‘video_of_mary_2012.mp4’, QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp34b
‘pdf_book_neverland.pdf’, QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp34c

tag: #smalldatabase

4)) Both the caller_pc and responder_pc have a small udp socket.
The UDP socket sends and receives messages via the UDP protocol;

https://nodejs.org/api/dgram.html

https://docs.python.org/3/library/socketserver.html

5))The caller_pc sends to the responder_pc the string ‘picture_jhon_2009.jpg’ over UDP.
Here we assume the caller_pc knows the responder_ip;

6))The responder_pc replies to the caller_pc with the string ‘QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp34a’, over UDP.
Here we assume the responder_pc knows the caller_ip;

7))The caller_pc download the file QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp34a, with ipfs_ipget

8))Dynamicity.
In the #smalldatabase, the user can change the old entry with the new entry:
OLD ENTRY: ‘picture_jhon_2009.jpg’, QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp34a
NEW ENTRY: ‘picture_jhon_2009.jpg’, QmRBkKi1PnthqaBaiZnXML6fH6PNqCFdpcBxGYXoUQfp35d

This is essentially what ipns does, your database being the files in MFS. Updating the database means doing ipfs ipns publish <mfs_root>.

2 Likes

Yes. I know, ipns already does this.
But when people use ipns, they usually use it with a http gatway.
Example bellow.

https://gateway.ipfs.io/ipns/k51qzi5uqu5dkkciu33khkzbcmxtyhn376i1e83tya8kuy7z9euedzyr5nhoew

The domain gateway.ipfs.io is under the control of the ICANN, which is a centralized authority.

I wanna create a system like ipns which doesn’t need the http gatway.

I already know there are some alternative like HandShake.org DNS, but projects like HandShake.org use a blockchain.

I was trying to develop a simpler system.

Is it possible use IPNS without the http gatway??
I don’t find any information online about this point in particular.

Every IPNS example in the official documentation uses the http gatway.

you can use ipns without gateways… just ipfs get /ipns/xxxxx.

2 Likes

OK. Thanks.
Maybe this can help me.

Content Based Addressing is a feature of IPFS, it shouldn’t be considered as a limitation.

Your idea is nothing wrong, but this is against the philosophy of IPFS. You can have dynamic content based on IPNS, where your IPNS can point to any hash, or possibly other IPNS address. But having lot of IPNS addresses is not good either, IPFS is meant to be static, so that the files can be cached and later sent to other nodes. I think you should at a look at Decentralized Databases like OrbitDB and then have dynamic content over it.

Your concept of Dynamic website is not so clear, let’s say a JavaScript program gets file over HTTP (‘image.png’) and later the content is changed (still ‘image.png’). Does this mean that I have created something dynamic with IPFS ? No!!.
The script is still the same, the script still has same IPFS hash. So in your case you are not actually creating any dynamic website at all, the way you get the IPFS hash is independent process from getting the content with IPFS.

1 Like