Cointime

Download App
iOS & Android

NFT Teams: Free Yourself From Never-Ending IPFS Pinning Fees by Uploading Images to Arweave via the CLI Method

another lifetime, I was actually a marketing & business development director at a regional CPA firm. And prior to that, I was in marketing and business development at Deloitte. So, I’ve had a ton of marketing and sales training throughout my crazy-long career (I’m old — a GenXer through and through). Anyway, in that training, there’s a famous sales maxim that uses the mattress industry as an example: You aren’t selling mattresses, you’re selling sleep.

And, really, that is what Arweave, a decentralized data storage protocol, provides for the NFT space (and for other general permanent-storage-dependent business / industry niches, of course).

Yes, Arweave is a product / service. Yes, it’s a storage protocol. But those descriptions miss the mark because it’s the benefits of using Arweave that set it apart from the nonstop hassles of IPFS. IPFS is a mattress; Awreave is nice, peaceful sleep.

Okay, enough with the metaphors! Let’s get into some tech stuff. 

In the above, I was new to exploring the protocol, and I began by using the excellent GUI / web site, ArDrive. I still use ArDrive via the site/app, as it’s just a super interface and very intuitive. And, you know, even if you live life on the command line, it’s still nice to work visually on some things.

That all said, as I continued to explore Arweave, I realized that some specialized things I was doing called for a programmatic approach. And for that, ArDrive offers a CLI (here’s the github repo). It has various install options. For me, just a quick npm install & it was ready to go.

The github repo linked to above has super documentation that will cover most of the situations you’ll have when uploading. I thought I’d show some concrete examples of my own little process, just to show how easy it is to upload images. So, here’s my own process:

Prerequisites

You of course to have AR tokens in your Arweave wallet (how-to here), and you need to have the CLI installed in your IDE (see above).

1. Break your files into manageable chunks locally (in prep for uploading)

To be honest, I’m not 100% sure what the upload limits are. The repo mentions that that there is no theoretical limit on numbers of files (although you could be uploading thousands of really tiny files, so that’s understandable). But all in all, I seem to recall a 2–3 GB total size limit stated somewhere. I was definitely able to successfully upload MORE than the stated limit using the app, and I think the CLI allows even a bit more than the app does. (I’ll clarify this part later.) But anyway, for practical purposes, maybe limit your first few uploads to a few gigs, and go from there with pushing the limits. (Also, in fairness, it could depend on some outside factors. For instance, I have giga-bit service here, so I can upload at crazy high speeds, which might mean my limit differs from yours.)

2. Establish a folder into which you’ll put your NFT images.

While the CLI will let you easily do this, I actually like to just be on the ArDrive app for this part. You just click NEW and then “New Folder” and then name it. I’m in my “z_dog” drive here, and I’ve just made a folder called “test1”. When it’s done, I just click on it (and it highlights in pink — super handy) and then I click the info button (top center), and the right panel pops up where I can click the Folder ID icon to auto-copy that.

From there, I have a folder locally called “sample” into which I’ve popped 6 sample images for this article. So, to upload that, I simply need to go to a terminal and pop in the command:

ardrive upload-file --local-path /path/to/folder --parent-folder-id "FOLDERID" -w /path/to/wallet.json

Customize that with your folder ID (as copied above), paths to the upload folder, and wallet path, of course. But, upon running that, it soon returns a JSON wad of data related to what you just did there.

The top item is always a folder because I’m uploading a folder myself, and so that’s the ArDrive folder info for that local folder. (Did I say “folder” enough in that last sentence? lol). And below that is the data I sent and the various properties for each item.

BTW, if I wanted to fetch all of the individual file data as a nice clean JSON file, I could now run…

ardrive list-folder --parent-folder-id"e6be9dd8-e100-4a91-a822-c541076a87da"

… and I’d get a big JSON set of that whole folder:

That “dataTxID” is key for linking back out. We just preface it with https://arweave.net/ and, for example, the URL…

https://arweave.net/A4izFjirmqqs3Jhne1eYX0uwj5_dewAr4LZYLLECDvI

… indeed shows the dog I just uploaded:

(That’s a copy of an image from my Loopies NFT drop. Go grab one — the floor is currently just 48 cents! lol.)

Dealing with Latency

One important note here is that there’s a bit of latency in the system, in that Arweave needs some time to take in your upload and get it all situated. (“Situated” is a fine technical term, right?) The more you upload, the more time it needs (although, relatively speaking, it’s fairly quick). But, that’s why I wanted to show you the “list-folder” command — because you shouldn’t count on the immediate JSON response as being the final one.

The system needs a few minutes to fully process things. In fact, one thing that I’ve come to do as I upload is that I’ll do an upload (e.g., let’s say I’m uploading 1,000 NFT images), and then I’ll wait like five minutes and I’ll then run the “list folder” command. Then, I’ll save the JSON output of that to a file and programmatically iterate over that file to count the dataTxId instances. If my count matches the number of files that I uploaded, then it’s all finalized on Arweave. If the count comes up less than I expected, then it’s not done processing yet. (So I give it a few more minutes and then re-request the folder data via list-folder.)

And then, of course, once I know all 1,000 files are there, and have dataTxIds, I then simply iterate again over the final JSON file (from the list-folder command) and this time I save the dataTxIds into my database of NFT data. (Note that the JSON file includes the “name” field, which is the name of the file I’ve uploaded. So, that’s how I match up the dataTxIds to my NFT database when I do that update.)

Your own processes will vary, of course. Again, see the robust documentation for the ArDrive CLI tool! But the point is that there are many options for uploading files, both GUI and CLI, and they’re all easy, user-friendly, and intended to be permanent with no ongoing pinning fees, which means you’ll sleep better. 

https://medium.com/web-design-web-developer-magazine/nft-teams-free-yourself-from-never-ending-ipfs-pinning-fees-uploading-images-to-arweave-via-the-a94ca51e99f4

NFT
Comments

All Comments

Recommended for you

  • U.S. Congressman Mike Flood: Looking forward to working with the next SEC Chairman to revoke the anti-crypto banking policy SAB 121

     US House of Representatives will investigate Representative Mike Flood's recent statement: "Despite widespread opposition, SAB 121 is still operating as a regulation, even though it has never gone through the normal Administrative Procedure Act process." Flood said, "I look forward to working with the next SEC chairman to revoke SAB 121. Whether Chairman Gary Gensler resigns on his own or President Trump fulfills his promise to dismiss Gensler, the new government has an excellent opportunity to usher in a new era after Gensler's departure." He added, "It's not surprising that Gensler opposed the digital asset regulatory framework passed by the House on a bipartisan basis earlier this year. 71 Democrats and House Republicans passed this common-sense framework together. Although the Democratic-led Senate rejected it, it represented a breakthrough moment for cryptocurrency and may provide information for the work of the unified Republican government when the next Congress begins in January next year."

  • Indian billionaire Adani summoned by US SEC to explain position on bribery case

    Indian billionaire Gautam Adani and his nephew, Sahil Adani, have been subpoenaed by the US Securities and Exchange Commission (SEC) to explain allegations of paying over $250 million in bribes to win solar power contracts. According to the Press Trust of India (PTI), the subpoena has been delivered to the Adani family's residence in Ahmedabad, a city in western India, and they have been given 21 days to respond. The notice, issued on November 21 by the Eastern District Court of New York, states that if the Adani family fails to respond on time, a default judgment will be made against them.

  • U.S. Congressman: SEC Commissioner Hester Peirce may become the new acting chairman of the SEC

    US Congressman French Hill revealed at the North American Blockchain Summit (NABS) that Republican SEC Commissioner Hester Peirce is "likely" to become the new acting chair of the US Securities and Exchange Commission (SEC). He noted that current chair Gary Gensler will step down on January 20, 2025, and the Republican Party will take over the SEC, with Peirce expected to succeed him.

  • Tether spokesperson: The relationship with Cantor is purely business, and the claim that Lutnick influenced regulatory actions is pure nonsense

     a spokesperson for Tether stated: "The relationship between Tether and Cantor Fitzgerald is purely a business relationship based on managing reserves. Claims that Howard Lutnick's joining the transition team in some way implies an influence on regulatory actions are baseless."

  • Bitwise CEO warns that ETHW is not suitable for all investors and has high risks and high volatility

    Hunter Horsley, CEO of Bitwise, posted on X platform that he was happy to see capital inflows into Bitwise's Ethereum exchange-traded fund ETHW, iShares, and Fidelity this Friday. He reminded that ETHW is not a registered investment company under the U.S. Investment Company Act of 1940 and therefore is not protected by the law. ETHW is not suitable for all investors due to its high risk and volatility.

  • Musk said he liked the "WOULD" meme, and the related tokens rose 400 times in a short period of time

    Musk posted a picture on his social media platform saying he likes the "WOULD" meme. As a result, the meme coin with the same name briefly surged. According to GMGN data, the meme coin with the same name created 123 days ago surged over 400 times in a short period of time, with a current market value of 4.5 million US dollars. Reminder to users: Meme coins have no practical use cases, prices are highly volatile, and investment should be cautious.

  • Victory Securities: Funding Rates halved and fell, Bitcoin's short-term direction is not one-sided

    Zhou Lele, the Vice Chief Operating Officer of Victory Securities, analyzed that the macro and high-level negative impact risks in the cryptocurrency market have passed. The risks are now more focused on expected realization, such as the American entrepreneur Musk and the American "Efficiency Department" (DOGE) led by Ramaswamy. After media reports, the increase in Dogecoin ($DOGE) was only 5.7%, while Dogecoin rose by 83% in the week when the US election results were announced. Last week, the net inflow of off-exchange Bitcoin ETF was US$1.67 billion, and the holdings of exchange contracts and CME contracts remained high, but the funding rates halved and fell back, indicating that the direction of Bitcoin in the short term is not one-sided, and bears are also accumulating strength.

  • Careers in Crypto: 5 Insights for 2024

    In an overwhelming job market, leaning into personal networks and connections are more important than ever. Emily Landon, CEO of The Crypto Recruiters, outlines what is happening in the crypto job market and how you can position yourself or your company in 2024.

  • Cointime August 10th News Express

    1. The U.S. Internal Revenue Service has released a new draft of the crypto tax form, which no longer requires filling in wallet addresses and transaction IDs

  • Adidas and Doodles collaborate to launch a limited edition NFT collection pack

    Sportswear giant Adidas is collaborating with Ethereum NFT series Doodles to sell virtual gift packages that support buyers in purchasing exclusive physical clothing. Adidas and Doodles stated in a joint statement that these limited edition collectible packages will be available for purchase before August 16th, with two items in each package. The Adidas Originals x Doodles online store shows that the retail price for a single package is $4.99, while the price for 2 to 100 packages ranges from $8.49 to $374.99.Some joint sets include physical collectibles featuring Deysi, the digital mascot in Pharrell Williams and Coi Leray's new song "Not in the Store". These collectibles include Deysi sportswear and Superstar shoes, with each limited to 200 pieces.