Skip to content

Instantly share code, notes, and snippets.

@samcamwilliams
Created November 21, 2020 02:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samcamwilliams/26e0505d11a7c25cafc95e08c5be9c13 to your computer and use it in GitHub Desktop.
Save samcamwilliams/26e0505d11a7c25cafc95e08c5be9c13 to your computer and use it in GitHub Desktop.
Download the state of all land parcels in CryptoVoxels and deploy them to the Arweave's permaweb. Path to your Arweave keyhole must be changed in the `arweave deploy` line.
#!/bin/bash
mkdir -p CryptoVoxelsArchive/parcels
echo "Downloading map info..."
curl -s 'https://www.cryptovoxels.com/api/parcels.json' > CryptoVoxelsArchive/parcels.json
curl -s 'https://www.cryptovoxels.com/api/suburbs.json' > CryptoVoxelsArchive/suburbs.json
curl -s 'https://www.cryptovoxels.com/api/islands.json' > CryptoVoxelsArchive/islands.json
cat CryptoVoxelsArchive/parcels.json | jq '.parcels | .[] | .id' | while read id ;
do
echo "Downloading land parcel info $id..."
curl -s "https://www.cryptovoxels.com/grid/parcels/$id" > CryptoVoxelsArchive/parcels/$id.json ;
done
echo "Creating zip."
zip -r -q CryptoVoxels-latest-archive.zip CryptoVoxelsArchive
echo "Deploying archive to Arweave."
arweave deploy --force-skip-confirmation CryptoVoxels-latest-archive.zip --key-file PATH_TO_YOUR_KEYFILE --tag AppName:CryptoVoxelsArchive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment