- This is the famous empty tree object from any GIT repository in the world ... now you can own it, i.e your NFT will be in the source repository of every software around :)
Last active
November 27, 2021 13:11
-
-
Save michel47/265459b6ff51e28d179a7f4b7778c603 to your computer and use it in GitHub Desktop.
git tokens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
git init | |
export GIT_AUTHOR_DATE='Thu, 01 Jan 1970 00:00:00 +0000' | |
export GIT_COMMITTER_DATE='Thu, 01 Jan 1970 00:00:00 +0000' | |
git commit --allow-empty -m 'Initial commit' | |
git tag "init" | |
gitid=$(git rev-parse HEAD) | |
git filter-branch --env-filter "if [ \$GIT_COMMIT = $gitid ]; then | |
export GIT_AUTHOR_DATE='$GIT_AUTHOR_DATE' | |
export GIT_COMMITTER_DATE='$GIT_COMMITTER_DATE' | |
fi" -- --all | |
git log | |
git remote add origin git@hologit.ml:anony/init.git | |
# read more : | |
# https://hardbin.com/ipfs/QmNcWM3HM4RNrP6YP8JHBp7wHpgCPsk6H4gmGxxBaLPjeZ/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
gitdir=$(git rev-parse --git-dir) | |
emptytree=$(git hash-object -t tree /dev/null) | |
file="$1" | |
if [ -f $file ]; then | |
git add $file | |
githash=$(git hash-object $file) | |
git reset $file | |
else | |
if [ -e README.md ]; then | |
githash=$(git hash-object README.md) | |
else | |
githash=$emptytree | |
fi | |
fi | |
shard=$(echo $githash | cut -c-2) | |
obj=$(echo $githash | cut -c3-) | |
objf=$gitdir/objects/$shard/$obj | |
echo objf: $objf | |
if [ ! -e $objf ]; then | |
echo "! -e $objf" | |
fi | |
perl -S dat2png.pl -r 1 -o $githash.png $objf | |
ls -l $githash.png | |
token=$(ipfs add -Q $objf --pin=true) | |
echo "qmtoken: $token" | |
token=$(ipfs add -Q $objf --pin=true --hash sha1 --raw-leaves --cid-base base16) | |
echo "token: $token" | |
echo -n "provs: " | |
ipfs dht findprovs -n 1 /ipfs/$token | |
echo "qmgit=\$(ipfs add -Q -r \$(git rev-parse --git-dir))" | |
echo "ipfs object patch add-link \$qmgit --create objects/$shard/$obj $token" | |
#qmgit=$(ipfs add -Q -r $(git rev-parse --git-dir)) | |
#ipfs object patch add-link $qmgit --create objects/$shard/$obj $token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# remarkable object | |
echo -n "blob 0\0" | pigz -9 -z > blob.z | |
echo -n "tree 0\0" | pigz -1 -z > tree.z | |
echo -n "commit 0\0" | pigz -9 -z > commit.z | |
for obj in *.z; do | |
echo // $obj | |
pigz -d -c -k $obj | openssl sha1 -r | |
dat2png.pl -r 1 $obj ${obj%.*}.png | |
magnify.sh ${obj%.*}.png | |
ipfs add -w ${obj%.*}* | |
echo . | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment