0xddfc2e10…3e91sent to0x875e63b7…1d13·#12,377,651·view on Etherscan
Web3Updater is simply amazing, and I'm less tired/sad after starting to make it.
.git
new_patch_at.json:
{
"new_patch_at": 3
}
README.md:
Imagine Windows Update, but for the Web 3.0 and for any app/CLI program/OS.
Web3Updater takes use of ENS (Ethereum Name System) to store file/folder content hashes (known on IPFS as CIDs - Content IDs), so updates are secured by the Ethereum blockchain; in the next step, these updates are downloaded directly from IPFS and patched, and also seeded to other neighboor users (P2P, faster updates).
It can not only be itself updating itself, but can also be initiated in your projects; for now only CLI apps, but soon we will enable new creative uses such as an NPM package to decentralizedly update Electron apps.
Every time you wish to add an new update: edit files such as update.sh and new_patch_at.json adding commands and increasing numbers and... ...more instructions coming.
Web3Updater is developed with focus on being:
- Modular
- Agnostic
- Portable
- Scalable
update.sh:
#!/bin/bash
if [ $(jq -r '.patch_at' update.json) = "0" ]; then
echo "Installing update 1..."
echo "This is a thing that the first update did." > patch_1.txt
contents="$(jq '.patch_at = "1"' update.json)" && \
echo "${contents}" > update.json
fi
if [ $(jq -r '.patch_at' update.json) = "1" ]; then
echo "Installing update 2..."
echo "This is another effect made by an update." > another_effect.txt
contents="$(jq '.patch_at = "2"' update.json)" && \
echo "${contents}" > update.json
fi
#if [ $(jq -r '.patch_at' update.json) = "2" ]; then
# echo "Installing update 3..."
# rm patch_1.txt
# rm another_effect.txt
## jq '. += ["cid_at": ""]' update.json
# contents="$(jq '.patch_at = "3"' update.json)" && \
#echo "${contents}" > update.json
#fi
web3updater.sh:
#!/bin/bash
echo "Welcome to Web3Updater!"
echo "Made in a day where my mom couln't sleep because of an Hare Krishna that lives with my uncle, and the whole day she yelled at us and I became confused. Half day building this piece of art+utility, half day reasoning poorly and thinking to burn all my crypto because money != peace in some cases. But I won't burn my tokens because there are my mom, my uncle and my sister counting on me, and I hope I can change the life of more people, if I even can change the life of my mom and myself/; which is being hard. My brain bugged now to think more so I'll try to focus back on outbursting by building this heresy that no one of these machist transphobe beared professional programmers have thought of. I know Im writing like in 2019 and this is an backstep, but my brain really bugged today, my rare peace of mind from a whole month has been partly broken today. My mom is bipolar, and about Hare I don't want to judge while irritated."
echo "Made in Itajai, Santa Catarina; but IMPORTANT: this is not an Brazilian funk music remix."
if [ ! -f update.json ]; then
echo ""
echo "It looks like its your first time using Web3Updater..."
echo ""
echo "The web3 (that came from Ethereum and IPFS) is replacing the web 2.0, and Web3Updater will put it also on OS/app updates!"
echo ""
echo "Never more depend on centralized servers to get updates."
echo ""
echo "As Web3Updater can be used in any product to manage updates (such as Electron apps), it uses itself to update itself (meta-language)."
echo ""
echo "Initializing..."
cat > update.json <<EOF
{
"patch_at": 0
}
EOF
#git remote add web3updater tmp-remote
echo "Done!"
fi
echo ""
echo "Version: v1 / Patch: $(jq -r '.patch_at' update.json)"
echo ""
echo "Checking for new updates..."
if [ "$(jq -r '.new_patch_at' new_patch_at.json)" -gt "$(jq -r '.patch_at' update.json)" ]; then
echo "Updating Web3Updater..."
sh ./update.sh
else
echo "UP-TO-DATE like a breeze! No new updates to install, yet."
#echo "Recently checked at: "
#echo "Recently updated at: "
fi
#- install IPFS if not detected (mark it as a template feature for Floflis installer)
#ipfs ls $(ethereal ens contenthash get --domain=update.updating.eth)
#ipfs get --output=tmp-remote $(ethereal ens contenthash get --domain=update.updating.eth)
#ipfs pin add $(ethereal ens contenthash get --domain=update.updating.eth)
#git pull web3updater && rm -rf tmp-remote
#- install on /libs folder like Floflis, with its /bin exec
#- command to init on a project (only CLI, for now - adds the full web3updater lib installable globally + its custom new_patch_at.json, update.sh, update.json, etc) - "web3updater init"
#- help and version
#- EPNS notifications
#- suggest adding CLI app into UniStore instead of web3updater init (Plugz on UniStore will add web3updater as dependency, as IPFS is a dependency of web3updater)
#- guide to add/write new updates (both on update.sh and new_patch_at.json)
#- "web3updater check/update"
#- command to finalize adding an update: makes an bare git repo tmp folder, push/uploads into it, adds this folder into IPFS, copies its CID and shows it to user until ethereal uses an Floflis keychain to automatically sign/update ENS
I wasn't able to directly use https://ipfs.io/ipfs/, so I've invented some workarounds to put it to work <3
It mixes the best of Ethereum+ENS+IPFS+git, and paves the way for UniStore, Internet Cat, IceCream Wallet, Floflis and a lot of useful Web 3.0 tools that are screaming at my mind to be born (namely OmniLink, CommonChain, Dedup, Gitty, GIPFS, etc)