0xddfc2e10…3e91sent to0x165cd37b…5e14·#16,015,258·view on Etherscan
https://github.com/Plasmmer/SharedChain.git
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/0.json ---->
---------------------------------------------------------------------------------------------------------------------------
{
"commonchain-v": "1.0",
"type": "github-releases",
"gitrepo": "ipfs/go-ipfs",
"fileprefix": "go-ipfs_",
"filesufix": "_linux-amd64.tar.gz",
"firstblock": "QmXdFawbXkwjMEYLWk1eQLjr2CKSeNYBekRsKRv2iSqzbo"
}
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/0.json
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/1.json ---->
---------------------------------------------------------------------------------------------------------------------------
{
"prevblock": "",
"tag": "",
"url": "https://github.com//releases/download//go-ipfs__linux-amd64.tar.gz",
"ipfs": ""
}
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/1.json
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/2.json ---->
---------------------------------------------------------------------------------------------------------------------------
{
"prevblock": "QmXdFawbXkwjMEYLWk1eQLjr2CKSeNYBekRsKRv2iSqzbo",
"tag": "v0.9.1",
"url": "https://github.com/ipfs/go-ipfs/releases/download/v0.9.1/go-ipfs_v0.9.1_linux-amd64.tar.gz",
"ipfs": "QmYhnrBkoU57C6EoBMrQqYFHuayayhGmaNyDucMVXJWxKr"
}
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/2.json
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/3.json ---->
---------------------------------------------------------------------------------------------------------------------------
{
"prevblock": "QmS5RtdirDvXvbWT9t4JRKeBrx9DDFqdP1yw988pdNJhKj",
"tag": "v0.10.0",
"url": "https://github.com/ipfs/go-ipfs/releases/download/v0.10.0/go-ipfs_v0.10.0_linux-amd64.tar.gz",
"ipfs": "QmWrZAyfLFZM4GWCiRrRh4ZXAiFQFzuLxABcFstAxWD4Sx"
}
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/3.json
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/4.json ---->
---------------------------------------------------------------------------------------------------------------------------
{
"prevblock": "QmdrN7Nv3tzzJBnxgVa1RkTzR2b2WJDwEsUkP3VLTPVqZ9",
"tag": "v0.11.0",
"url": "https://github.com/ipfs/go-ipfs/releases/download/v0.11.0/go-ipfs_v0.11.0_linux-amd64.tar.gz",
"ipfs": "QmemU3t9bRWBzRrWLVaHfmqyTLsRowg3DVJfJEPftB4PvZ"
}
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/4.json
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/5.json ---->
---------------------------------------------------------------------------------------------------------------------------
{
"prevblock": "QmRFcZAH6rTFQbLUPM4NDKaATEdfP5pVj7nGSzWPKx3bRw",
"tag": "v0.12.0",
"url": "https://github.com/ipfs/go-ipfs/releases/download/v0.12.0/go-ipfs_v0.12.0_linux-amd64.tar.gz",
"ipfs": "QmS5N5LjvhYueK2uYG4npy6pKhwgaYBezBRFMxyzU6Doar"
}
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/5.json
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/6.json ---->
---------------------------------------------------------------------------------------------------------------------------
{
"prevblock": "QmVSCKGZULdRjC2sAA1FjbnJLH8sCCMbmdy1iajjLPP9WX",
"tag": "",
"url": "https://github.com/ipfs/go-ipfs/releases/download//go-ipfs__linux-amd64.tar.gz",
"ipfs": ""
}
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/6.json
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/commonchain.sh ---->
---------------------------------------------------------------------------------------------------------------------------
#!/bin/bash -e
nm="CommonChain"
vs="r1"
commonchainversion="""
\e[1;42m $nm \e[0m\e[100m version $vs \e[0m
\e[100m Created in 10-21-2021 by Daniella Mesquita \e[0m
"""
lastblockpath=$(find -maxdepth 1 -name '*.json' | sort -t_ -nk2,2 | tail -n1)
tmp="${lastblockpath##*/}" # gives 2.json
lastblock="${tmp%.*}" # gives 2
if [ "$lastblock" -ge "2" ]
then
prevblock="$(($lastblock - 1))"
else
prevblock="Can't verify previous block because this commonchain is still at block 1. Wait until it reach block 2 or more."
fi
gitrepo="$(jq -r '.gitrepo' 0.json)"
lastblocktag="$(jq -r '.tag' $lastblock.json)"
releasetag="$(
curl --silent "https://api.github.com/repos/$gitrepo/releases/latest" \
| grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
)"
releasetagnov="$(
curl --silent "https://api.github.com/repos/$gitrepo/releases/latest" \
| grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' \
| cut -c 2-
)"
export nm && export vs && export commonchainversion && export lastblockpath && export lastblock && export prevblock && export gitrepo && export releasetag && export releasetag && export lastblocktag
if [ "$1" = "" ]; then
if [ "$lastblocktag" != "$releasetag" ]; then
./check.sh
./commonchain.sh && exit
fi
if [ -f justupdated.now ]; then
rm justupdated.now
echo "This commonchain has been updated just now; from block $prevblock to $lastblock!"
echo "Its advisable to run 'commonchain validate' in order to verify this update is legit."
echo "--------------------"
fi
echo "$commonchainversion"
echo "Type 'commonchain --help' (without quotes) to see a list of available commands."
echo "--------------------"
echo "gitrepo: $gitrepo" #test
echo "Latest registered release: $lastblocktag"
echo "Latest release: $releasetag"
fi
if [ "$1" = "latest" ]; then
if [ "$2" = "" ]; then
echo "Latest block is: $lastblock"
fi
if [ "$2" = "--plain" ]; then
echo "$lastblock"
fi
fi
if [ "$1" = "previous" ]; then
if [ "$2" = "" ]; then
echo "Previous block is: $prevblock"
fi
if [ "$2" = "--plain" ]; then
echo "$prevblock"
fi
fi
if [ "$1" = "validate" ]; then
./validate.sh
fi
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/commonchain.sh
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/justupdated.now ---->
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/justupdated.now
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/Tasks.txt ---->
---------------------------------------------------------------------------------------------------------------------------
init in folder + list commonchains
no need to detect if file exist to append
BrightID validators (uses reputation instead of tokens)
CommonPoint is a precursor to OmniLink
kinds of commonchain: github, urlsh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh QmVoGaTVUVzgHEwyyiKsYcQG36AFZezb1kvGEFPwYsyN92
sh -c "$(curl -fsSL https://starship.rs/install.sh)" Qmf1XqY9vjU1yHDwEPj3hFBWJqtwGeUyoWPR77kYA7f65D
sh <(curl -L https://nixos.org/nix/install) –no-daemon QmX5Jp4JtCSjaKj1efdaT31dRZiivGKz6qf3kHoCKRb2W4
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash QmPcQV6uQvAH5nESBhRX1B4kXgdcSNCxt1ivFVy5bgiMJs
if commonchain type is github, support more than 1 release files
gitrepo="ipfs/go-ipfs"
https://github.com/$gitrepo/releases/download/$releasetag/go-ipfs_$releasetag_linux-386.tar.gz
https://github.com/$gitrepo/releases/download/$releasetag/go-ipfs_$releasetag_linux-arm.tar.gz
https://github.com/$gitrepo/releases/download/$releasetag/go-ipfs_$releasetag_linux-arm64.tar.gz
- At checking version, display two - app and this commonchain, if it is identified
- Check this commonchain type (also contain gitrepo if type is github-releases) and firstblock
- Install system-wide
- Wizard to create a new commonchain (stored in /home/.commonchain, folder named with 0.json CID)
gitrepo="wealdtech/ethereal"
https://github.com/$gitrepo/releases/download/$releasetag/ethereal-$releasetagnov-linux-amd64.tar.gz
https://github.com/$gitrepo/releases/download/$releasetag/ethereal-$releasetagnov-linux-arm64.tar.gz
gitrepo="ipfs/ipfs-desktop"
https://github.com/$gitrepo/releases/download/$releasetag/ipfs-desktop-$releasetagnov-linux-amd64.deb
https://github.com/$gitrepo/releases/download/$releasetag/ipfs-desktop-$releasetagnov-linux-x64.tar.xz
gitrepo="floating/frame"
https://github.com/$gitrepo/releases/download/$releasetag/frame_$releasetagnov_amd64.deb
gitrepo="godotengine/godot"
https://github.com/$gitrepo/releases/download/$releasetag/Godot_v$releasetag_x11.32.zip
https://github.com/$gitrepo/releases/download/$releasetag/Godot_v$releasetag_x11.64.zip
gitrepo="nushell/nushell"
https://github.com/$gitrepo/releases/download/$releasetag/nu_0_40_0_linux.tar.gz (have to replace "." to "_" in $releasetag)
gitrepo="johnnesky/beepbox"
https://github.com/$gitrepo/releases/download/$releasetag/BeepBox_4_0_1.zip (have to replace "." to "_" in $releasetag)
- Init service for periodicaly running check.sh
https://github.com/gohugoio/hugo/releases
https://geth.ethereum.org/downloads/
- Option to pin file
- From latest block, traverse into previous blocks (optionally, to fully validate)
- With ETH adress, sign if this address has been compromised and tell frnds
- Validate comparing with trusted DAOs' ENS (genesis and latest blocks)
- Prevent updating when it wasn't checked for more than a day and there are previous blocks missing
Lch:
https://discuss.ipfs.io/
Are you ready for the next IPFS release? CommonChain are.
--
Every commonchain watches for a specific release file (for example, every go-ipfs_*_linux-amd64.tar.gz).
-
At every new release, CommonChain receives the latest tag, downloads the file (such as go-ipfs_*_linux-amd64.tar.gz), verifies its CID, and stores all the infos (URL, CID, previous block) in a newly generated block.
--
go-ipfs, files, ipld, multihash
CommC
https://addons.mozilla.org/firefox/downloads/file/3701081/ublock_origin-1.32.4-an+fx.xpi
CommonBytes+CommonChain for UniStore:
Instead of serving/downloading a whole XPI/APK file, use its internal files that are linked (OmniLink) with the bundle/package.
(input/output)
Next challenges:
dl yt vd and verify with CommonPoint. When hash changes, turn into CommonChain.
CommonPoint for NFTs
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/Tasks.txt
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/check.sh ---->
---------------------------------------------------------------------------------------------------------------------------
#!/bin/bash -e
tmp="$(($lastblock + 1))"
cat > $tmp.json << ENDOFFILE
{
"prevblock": "",
"tag": "",
"url": "",
"ipfs": ""
}
ENDOFFILE
tmp2="$(ipfs add -q --only-hash ./$lastblock.json)"
contents="$(jq ".prevblock = \"$tmp2\"" $tmp.json)" && \
echo "${contents}" > $tmp.json
tmp2=""
contents="$(jq ".tag = \"$releasetag\"" $tmp.json)" && \
echo "${contents}" > $tmp.json
filename=$(jq -r '.fileprefix' 0.json)$releasetag$(jq -r '.filesufix' 0.json)
freshurl="https://github.com/"$gitrepo"/releases/download/"$releasetag"/"$filename
contents="$(jq ".url = \"$freshurl\"" $tmp.json)" && \
echo "${contents}" > $tmp.json
wget -q $freshurl
tmp2="$(ipfs add -q --only-hash ./$filename)"
contents="$(jq ".ipfs = \"$tmp2\"" $tmp.json)" && \
echo "${contents}" > $tmp.json
rm $filename
tmp2="" && filename="" && freshurl="" && tmp=""
echo -n >justupdated.now
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/check.sh
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Plasmmer/cmnchn/validate.sh ---->
---------------------------------------------------------------------------------------------------------------------------
#!/bin/bash -e
echo "Validating..."
echo "[1/4] Fresh URL vs. latest block's URL:"
filename=$(jq -r '.fileprefix' 0.json)$lastblocktag$(jq -r '.filesufix' 0.json)
freshurl="https://github.com/"$gitrepo"/releases/download/"$lastblocktag"/"$filename
echo "$lastblocktag"
if [ "$(jq -r '.url' $lastblock.json)" = "$freshurl" ]; then
echo "Done! There's a match!"
echo "Validation 1/4 passed."
echo "[2/4] latest block's URL vs. IPFS CID:"
echo "Downloading release file from Fresh URL..."
wget $freshurl
echo "Checking for package integrity..."
# if [ "$(ipfs add -q --only-hash ./$filename | ipfs cid base32)" = "$(jq -r '.ipfs' $lastblock.json)" ]
if [ "$(ipfs add -q --only-hash ./$filename)" = "$(jq -r '.ipfs' $lastblock.json)" ]
then
echo "CID/Hash is the same from requested and the downloaded file, so the download is ok."
#tar -xzf $filename
echo "Done! There's a match!"
echo "Validation 2/4 passed."
echo "The latest block seems valid! But, next step..."
echo "[3/4] Validating first block with genesis block:"
if [ "$(ipfs add -q --only-hash ./1.json)" = "$(jq -r '.firstblock' 0.json)" ]
then
echo "Done! There's a match!"
echo "Validation 3/4 passed."
echo "[4/4] Previous block's hash:"
if [ "$lastblock" -ge "2" ]
then
if [ "$(ipfs add -q --only-hash ./$prevblock.json)" = "$(jq -r '.prevblock' $lastblock.json)" ]
then
echo "Done! There's a match!"
echo "Validation 4/4 passed. Traversing into all previous blocks will be implemented futurely."
else
echo "Requested CID/Hash $(jq -r '.prevblock' $lastblock.json) is different from the result: $(ipfs add -q --only-hash ./$prevblock.json)."
echo "Validation 4/4 failed. This commonchain is corrupted in the last, previous or more blocks. Please search a way to fix."
fi
else
echo "Validation 4/4 passed. Can't verify previous block because this commonchain is still at block 1. Wait until it reach block 2 or more."
fi
else
echo "Requested CID/Hash $(jq -r '.firstblock' 0.json) is different from the result: $(ipfs add -q --only-hash ./1.json)."
echo "Validation 3/4 failed. This commonchain is corrupted. Please search a way to fix."
fi
else
echo "Requested CID/Hash $(jq -r '.ipfs' $lastblock.json) is different from the result: $(ipfs add -q --only-hash ./$filename). Your download is corrupt. Please try again."
echo "Validation 2/4 failed."
fi
rm $filename
fi
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Plasmmer/cmnchn/validate.sh
---------------------------------------------------------------------------------------------------------------------------