arweave-nft-uploader is a Python tool to improve the experience of uploading NFTs to the Arweave storage for use with the Metaplex Candy Machine.

Overview

arweave-nft-uploader

arweave-nft-uploader is a Python tool to improve the experience of uploading NFTs to the Arweave storage for use with the Metaplex Candy Machine.

The tool has an additional (optional) feature to manage complex NFTs with multiple asset files (e.g. a PNG and an SVG). See more about it in this section.

This tool is for experienced users. I decline any responsibility for unneeded expenses caused by the incorrect usage of this tool. Read this guide carefully before using it.

Prerequisites

Installing

To install this tool run:

pip install -U git+https://github.com/0xEnrico/arweave-nft-uploader.git

Creating the Metaplex Candy Machine

The Metaplex Candy Machine can be created in the standard way, with a few differences in the command line and the asset folder, since we will manage the upload ourselves:

  • Prepare a which should contain only the first asset: 0.json and 0.png. Do NOT put other assets in that directory.
  • Initialize the Candy Machine program with the addition of the -n switch that specifies the total number of NFTs that will be uploaded, with a command line like this (for other command line options please refer to the Metaplex Candy Machine documentation):
ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts upload <single asset directory> -n <total number of NFTs> --keypair <Solana keypair file> --env <Solana cluster env name>

Uploading assets to Arweave

From the same folder where you run candy-machine-cli.ts, you can invoke this command to start the upload from the which should contain ALL assets to be uploaded:

arweave-nft -e <Solana env name> -k <Arweave wallet json file> <full assets dir>

e.g.:

arweave-nft -e mainnet-beta -k my_arweave_wallet.json /path/to/my/asset/dir

Invoke arweave-nft -h to get a full list of the available options:

usage: arweave-nft [-h] [-e ENV] [-k KEYPAIR] [-v] [-c CACHE_NAME] [--force-upload] [--assets-from-json] directory

positional arguments:
  directory             Directory containing images named from 0-n

optional arguments:
  -h, --help            show this help message and exit
  -e ENV, --env ENV     Solana cluster env name (default: "devnet")
  -k KEYPAIR, --keypair KEYPAIR
                        Arweave wallet location (default: "--keypair not provided")
  -v, --verbose         increase output verbosity
  -c CACHE_NAME, --cache-name CACHE_NAME
                        Cache file name (default: "temp")
  --force-upload        Force upload all assets, even the ones that have already been uploaded
  --assets-from-json    If this flag is specified, assets file names are read from properties.files.uri/type (e.g. for
                        uploading both png and svg), instead of the default pair NNN.json/NNN.png

In case you get an error like this at the end, it could be caused by upload errors or invalid asset structure in the json file:

WARNING There have been 6 upload errors. Please review them and retry the upload with the same command

Please review the preceeding errors, fix the json files content if needed, then run arweave-nft again with the same command line to retry.

At the end, you should get this message, and you can proceed to the next section:

INFO Upload complete! Now you can update the index with 'candy-machine-cli.ts upload' using the full assets directory (see documentation)

Rebuilding the Candy Machine index

After the upload has completed successfully, you need to rebuild the Candy Machine index.

This time you have to run candy-machine-cli.ts upload using the :

ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts upload <full assets directory> -n <total number of NFTs> --keypair <Solana keypair file> --env <Solana cluster env name>

⚠️ When you run this command, the command prompt MUST be in the same folder where you ran it previously to create the Candy Machine. ⚠️

Failure to do this will incur in unneeded expenses as you will recreate the Candy Machine and start upload assets through the Candy Machine itself.

The only thing you need to change is the argument of the command from to .

If you have done everything correctly at this point, it will not re-upload.

You will see a very quick Processing file log:

Processing file: 0
Processing file: 50
Processing file: 100
...
Processing file: 850
Processing file: 900
Processing file: 950

Then a slower set of Writing indices lines:

Writing indices 0-9
Writing indices 10-19
Writing indices 20-29
...
Writing indices 970-979
Writing indices 980-989
Writing indices 990-999
Done. Successful = true.

At this point the process is complete, and you can run candy-machine-cli.ts verify:

ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts verify --keypair <Solana keypair file> --env <Solana cluster env name>

If you have followed everything correctly, verify will succeed for all files, and your upload will be done!

Complex NFTs with multiple asset files

You can upload complex NFTs with multiple asset files using the --assets-from-json option.

Your json files must contain a files section like the one below, where you specify the asset files (in this example 0.png and 0.svg, which must be in the same directory as the json file) in the uri fields and the corresponding MIME type in the type fields:

"properties": {
    "files": [
        {
            "uri": "0.png",
            "type": "image/png"
        },
        {
            "uri": "0.svg",
            "type": "image/svg+xml"
        }
    ],
...

arweave-nft-uploader will manage the upload of all the referenced files and will create a correct json file on the Arweave blockchain with all the links.

Donations

If this project provides you a smoother experience while uploading your NFT assets to Arweave, I will appreciate a small donation to my Arweave wallet :)

bxQ7fygEV2meOp_z_3TZyy-VWbSCuzYRWnIE0FANQZo
Owner
0xEnrico
Old school developer in crypto space
0xEnrico
Create Multiple CF entry for multiple websites

AWS-CloudFront Problem: Deploy multiple CloudFront for account with multiple domains. Functionality: Running this script in loop and deploy CloudFront

Giten Mitra 5 Nov 18, 2022
Async client API for the Telegram Group Calls

PyTgCalls This project allow to make Telegram group call with MTProto Api using Pyrogram and WebRTC, this is possible thanks to the power of NodeJS's

185 Jan 03, 2023
Savecontentbot - Telegram Save Content Bot With Same more Features

Save Restricted Content Bot A simple telegram bot to save restricted content wit

Group Dc Bots 3 Jan 26, 2022
Fast IP address lookup

ipscoop Fast IP Scoop Table of Contents Installation CLI Getting Started Ref Installation To install ipscoop, simply: $ python3 -m pip install -U git+

6 Mar 16, 2022
Web app for spotify playlist management with last.fm integration

Music Tools Set of utility tools for Spotify and Last.fm. Built on my other libraries for Spotify (spotframework), Last.fm (fmframework) and interfaci

andy 3 Dec 14, 2022
Debugging with Stack Overflow: Web Search Behavior in Novice and Expert Programmers

Debugging with Stack Overflow: ICSE SEET, 2022 This is the GitHub repository associated with the 2022 ICSE SEET paper, Debugging with Stack Overflow:

Madeline Endres 1 Jan 31, 2022
A Simple, Easy to use and light-weight Pyrogram Userbot

Nexa Userbot A Simple, Easy to use and light-weight Pyrogram Userbot Deploy With Heroku With VPS (Local) Clone Nexa-Userbot repository git clone https

I'm Not A Bot #Left_TG 28 Nov 12, 2022
Demonstrating attacks, mitigations, and monitoring on AWS

About Inspectaroo is a web app which allows users to upload images to view metadata. It is designed to show off many AWS services including EC2, Lambd

Alex McCormack 1 Feb 11, 2022
Building and deploying AWS Lambda Shared Layers

AWS Lambda Shared Layers This repository is hosting the code from the following blog post: AWS Lambda & Shared layers for Python. The goal of this rep

Flaneer 7 Dec 02, 2021
For specific function. For my own convenience. Remind owner to share data to another DITO user.

For specific function. For my own convenience. Remind owner to share data to another DITO user.

Meigo 1 Dec 14, 2021
Fully automated Chegg Discord bot for "homework help"

cheggbog Fully automated Chegg Discord bot for "homework help". Working Sept 15, 2021 Overview Recently, Chegg has made it extremely difficult to auto

Bryce Hackel 8 Dec 23, 2022
Yet another random discord bot.

YARDB (r!) Yet another fully functional and random discord bot. I might add more features if I'm bored also don't criticize on my code. Commands: 4 Di

kayle 1 Oct 21, 2021
Url-shortener - A url shortener made in python using the API's from the pyshorteners lib

URL Shortener Um encurtador de link feito em python usando as API's da lib pysho

Spyware 3 Jan 07, 2022
Github repository started notify 💕

Github repository started notify 💕

4 Aug 06, 2022
Upload on Doodstream by Url, File and also by direct forward post from other channel...

Upload on Doodstream by Url, File and also by direct forward post from other channel...

Pʀᴇᴅᴀᴛᴏʀ 8 Aug 10, 2022
Heroku app to explore boardgame data

A Dashboard for the Board Game Geeks among us Link to Application As many Board Game Geeks like myself track the scores of board game matches I decide

Maarten Grootendorst 20 Nov 23, 2022
A Python API for Connected 2

connected API for Connected 2 api for the { connected 2 } programmer : api report api follow api check username api forget password api Search api cha

2 Jun 05, 2022
The Easy-to-use Dialogue Response Selection Toolkit for Researchers

Easy-to-use toolkit for retrieval-based Chatbot Our released data can be found at this link. Make sure the following steps are adopted to use our code

GMFTBY 32 Nov 13, 2022
An API wrapper for Henrik's Unofficial VALORANT API

ValorantAPI.py An API wrapper for Henrik's Unofficial VALORANT API Warning!! This project is still in beta and only contains barely anything yet. If y

Jakkaphat Chalermphanaphan 0 Feb 04, 2022
0-1 knapsack with an additional constraint of maximum number of items used

extended_knapsack 0-1 knapsack with an additional constraint of maximum number of items used. Usage pip3 install extended_knapsack from extended_knaps

Lion Ralfs 1 Jan 06, 2022