Search the Community
Showing results for tags 'website'.
How to build a basic censorship resistant website using in wallet Jupiter Upload to IPFS and then message that to someone all in wallet. From what I understand this will bypass the Chinese firewall. First download the wallet, Windows binary release located hereÂ https://github.com/carsenk/denarius/releasesÂ or compile from source. I am going to use the full features of the wallet for this example which does cost 0.001 Denarius per upload, but this can be done all for free. Start the wallet and go to Jupiter tab to upload your image, select Upload to IPFS and Pay 0.001 D to POD/Timestamp. The goal here is we are going to proof of data each upload to prove our images belong to us with an IPFS upload timestamp. The first line is the IPFS hash which is the link to our image. And the 2nd line is the timestamp of when the image was uploaded to IPFS. Create a text file to save these so its easier to remember. Our image is located hereÂ https://ipfs.io/ipfs/Qmci9khjndoearoPqpW6B6qfMWRe7rLnZ5BXdKYDaUhhRn and POD address isÂ D82zkzEDgfHSuAmYjJ6LZbLb1W74YLPjM7 with a timestamp of upload. Also we will use the Proof of Data tab next to POD the image itself for a hash checksum that gets thrown into the Denarius blockchain. This will verify the authenticity of the file itself. Our POD Address for the image itself isÂ DN7fo3bxDYNcREL7nKEWMDbEFbuqTdDLmA Once that is uploaded we want to save the full link to put into our webpage. Also save the POD address so we can include that into our webpage as proof. Create an index.html which we will post the image with a link to the Proof of Data (POD) address in a block explorer. <html> <head> <title>Denarius Fully Decentralize Website Example</title> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="CoronaVirus Death Tracker 2020"> <meta name="twitter:description" content="Cant Censor Us You Assholes"> <meta name="twitter:image" content="https://i.imgur.com/cl0MchI.png"> </head> <body> using <a href="https://github.com/carsenk/denarius/releases">Denarius</a> Jupiter IPFS Uploader<br> <center> <a href="https://denarius.io/"> <img src="https://ipfs.io/ipfs/Qmci9khjndoearoPqpW6B6qfMWRe7rLnZ5BXdKYDaUhhRn" alt="Denarius Logo"> </a> </center> <table style="border:1px solid black;margin-left:auto;margin-right:auto;"> <tr> <th>IPFS Image Upload Proofs</th> </tr> <tr> <td style="text-align:center">IPFS timestamp: Qmci9khjndoearoPqpW6B6qfMWRe7rLnZ5BXdKYDaUhhRn<td> </tr> <tr> <td style="text-align:center">POD Timestamp: <a href="https://www.coinexplorer.net/D/address/D82zkzEDgfHSuAmYjJ6LZbLb1W74YLPjM7">D82zkzEDgfHSuAmYjJ6LZbLb1W74YLPjM7</a><td> </tr> <tr> <td style="text-align:center">IPFS Image Link <a href="https://ipfs.io/ipfs/Qmci9khjndoearoPqpW6B6qfMWRe7rLnZ5BXdKYDaUhhRn"</a>Qmci9khjndoearoPqpW6B6qfMWRe7rLnZ5BXdKYDaUhhRn<td> </tr> <tr> <td style="text-align:center">POD of Image: <a href="https://www.coinexplorer.net/D/address/DN7fo3bxDYNcREL7nKEWMDbEFbuqTdDLmA">DN7fo3bxDYNcREL7nKEWMDbEFbuqTdDLmA</a><td> </tr> </table> <br> <a href="https://denariustalk.org/index.php?/topic/339-how-to-build-a-completely-censorship-resistant-web-page-with-denarius-and-ipfs/">Tutorial Here</a> </html> Save index.html and go back to the Proof of Data tab to hash checksum our index.html.Â Then upload to IPFS using POD again. The reason to do this is we will next message our friend to prove this is also my upload, which is giving a timestamp of the file itself and a checksum address of index.html which means this can't be faked and is authentic. Upload the final index.html to IPFS and POD this. Quickly we can use the infura or cloudflareÂ links, or use the default IPFS and type this in ourselves, 3 examples below using same file hash we just uploaded. https://ipfs.infura.io/ipfs/QmXAJ1o76XtmcQERcMYfaA6uWJNrgWmhviRCTZ6vLEjJBB https://cloudflare-ipfs.com/ipfs/QmXAJ1o76XtmcQERcMYfaA6uWJNrgWmhviRCTZ6vLEjJBB https://ipfs.io/ipfs/QmXAJ1o76XtmcQERcMYfaA6uWJNrgWmhviRCTZ6vLEjJBB This POD address from above imageÂ DD6xmZTTH6TgdD8sn3tqB5MnWsS4xZhSb6 we can use in our message to someone. Go to the Messages tab. I sent to myself because I need more Denarius friends. Checking my inbox I can see I got something. And there is my message delivered. Â Go think of new ways you can use this to create censorship resistant apps as the Denarius command line daemon also allows all of these commands.
The goal here is to setup 2 or more vps's to run IPFS in cluster mode. The IPFS daemons will stay in sync to distribute the files so its always up. Then use a typical domain name to serve the hash using Cloudflare gateway on Cloudflare's dashboard. From there a typical web browser sees your domain like usual, but behind the scenes can still use the IPFS Browser to directly see the website. create user denarius or whoever you want, but notice in the systemd files User=whoeveryoucreated adduser denarius usermod -aG sudo denarius exit If you are using ssh keys already ssh-copy-id [email protected] login ssh [email protected] install ipfs (Snapcraft), since snap might have to logout and back in after the sudo apt install snapd part. Mainly just wanted to show how to use snap IPFS daemon. https://snapcraft.io/ipfs sudo apt update sudo apt install snapd sudo snap install ipfs ipfs version ipfs init systemd service sudo nano /etc/systemd/system/ipfs.service [Unit] Description=IPFS daemon After=network.target [Service] ### Uncomment the following line for custom ipfs datastore location # Environment=IPFS_PATH=/path/to/your/ipfs/datastore User=denarius ExecStart=/snap/bin/ipfs daemon Restart=always [Install] WantedBy=multi-user.target sudo systemctl restart ipfs sudo systemctl status ipfs sudo systemctl enable ipfs install ipfs cluster ctl https://dist.ipfs.io/#ipfs-cluster-ctl wget https://dist.ipfs.io/ipfs-cluster-ctl/v0.13.0/ipfs-cluster-ctl_v0.13.0_linux-amd64.tar.gz tar -xzvf ipfs-cluster-ctl_v0.13.0_linux-amd64.tar.gz cd ipfs-cluster-ctl sudo cp ipfs-cluster-ctl /usr/local/bin/ install ipfs cluster service https://dist.ipfs.io/#ipfs-cluster-service wget https://dist.ipfs.io/ipfs-cluster-service/v0.13.0/ipfs-cluster-service_v0.13.0_linux-amd64.tar.gz tar -xzvf ipfs-cluster-service_v0.13.0_linux-amd64.tar.gz cd ipfs-cluster-service sudo cp ipfs-cluster-service /usr/local/bin/ initialize ipfs cluster ipfs-cluster-service init the secret to use across all the clusters is in ~/.ipfs-cluster/service.json example a2e2f791d26a04e76cbea370696964614a574a4265593aeaf4 systemd service sudo nano /etc/systemd/system/ipfsc.service [Unit] Description=IPFS Cluster daemon After=network.target [Service] ### Uncomment the following line for custom ipfs datastore location # Environment=IPFS_PATH=/path/to/your/ipfs/datastore User=denarius ExecStart=/usr/local/bin/ipfs-cluster-service daemon Restart=always [Install] WantedBy=multi-user.target Start, Status and Enable service sudo systemctl restart ipfsc sudo systemctl status ipfsc sudo systemctl enable ipfsc in status look for a line like this, this will be your bootstrap for the other nodes in the cluster /ip4/22.214.171.124/tcp/9096/p2p/12D3KooWL6FJgyiY3BUMx8PXpqCK3B6Qcn6X5dPPtGvgAaB7gTxW how bootstrap looks in systemd on the helpers sudo nano /etc/systemd/system/ipfsc.service [Unit] Description=IPFS Cluster daemon After=network.target [Service] ### Uncomment the following line for custom ipfs datastore location # Environment=IPFS_PATH=/path/to/your/ipfs/datastore User=denarius ExecStart=/usr/local/bin/ipfs-cluster-service daemon --bootstrap /ip4/126.96.36.199/tcp/9096/p2p/12D3KooWL6FJgyiY3BUMx8PXpqCK3B6Qcn6X5dPPtGvgAaB7gTxW Restart=always [Install] WantedBy=multi-user.target then to pin we use ipfs-cluster-ctl ipfs-cluster-ctl peers ls Add some random example file. Like nano example.txt, "this is a test" ipfs-cluster-ctl add example.txt ipfs-cluster-ctl pin ls now go to, to add the newly created hash directly to cloudflare to serve through their gateway. I see a 50mb limit on files, so be aware of this if making a website. https://www.cloudflare.com/distributed-web-gateway/ Add the CNAME and TXT Record like below Then back on the cloudflare link above, input your domain name, and Submit. Now you have an instant website serving using the Cloudflare IPFS gateway and a cluster of IPFS daemons keeping the files in sync. The website will also stay fully decentralized using IPFS directly because of that initial cluster we setup above. An example which I am not going to keep up forever. But wanted to show how this looks across different browsers and URLs. Just remember no nginx proxy pass is being used in this guide. ipfs-cluster-ctl add -r ~/website which gave me a hash of QmSrrb571Gm1RLvxHePEMXfuzjTG1nbCNb5PrZutJLde5L spread between the cluster Some Examples then in Brave Nightly as an example I can type ipfs://QmSrrb571Gm1RLvxHePEMXfuzjTG1nbCNb5PrZutJLde5L Which since directly seems slow, and still learning how this works, appears like this. This is how same page looks using Firefox with IPFS Companion, going directly through the hash And how a typical user would see in Chrome going directly to denarius.guide