skyone

skyone

Hello, World

ARMakeNFT

image

Photo by Alexander Elliott

Abandon IPFS, embrace AR 💮

The tutorial mainly goes through how to abandon IPFS and use AR to create NFTs.

Final result showcase: Click here


ArDrive Preparation#

  1. You can experience 0.2 AR for free. Refer to ArDrive official website for the steps. Send a tweet, it's not easy to verify with a small account to receive 0.2 AR. After completing this step, there will be a json file containing wallet private key information.

  2. After completion, use ArConnect, the AR plugin wallet, to import the Json file we just downloaded. Pay attention to the steps demonstrated below.

    image

    image

  3. After successfully importing the wallet, log in to https://app.ardrive.io/ to register and log in.

    image

    Provide a username and password to register.

    image


Using ArDrive#

  1. Drive and Folder. Drive contains many Folders. You can share Drive separately with others. Pay attention ⚠️ when creating Drive, you will be asked to choose Public or Private. For details on Public and Private, please refer to Here. Just understand the literal meaning, no need for further explanation.

    1. Note that each Drive and Folder will have its own identifier, https://app.ardrive.io/#/drives/ee70c85b-f140-49c7-80b1-856625fcb103/folders/77c4b073-5ce5-4f5a-bd59-b3a14e29a68d for example,

      1. FolderID=77c4b073-5ce5-4f5a-bd59-b3a14e29a68d will be used when uploading, specify the FolderID for the upload.
      2. DriveID=ee70c85b-f140-49c7-80b1-856625fcb103

    image

  2. Simply upload the data. After uploading the image, we will have a display like this. After obtaining the DataID, use this gateway ➕ dataID to access, for example, https://arweave.net/l1n24_cORIcDAOkzFc0I1IWs2qvv-eelHp4Qgb1f9vk image


NFT#

  1. Upload the image.

    • At this point, we can upload the image to AR and get the corresponding DataID.

      const { readJWKFile, arDriveFactory, wrapFileOrFolder, EID } = require('ardrive-core-js');
      
      // wallet is your json file, downloaded earlier
      // filePath is the path of the png
      // FolderID is the one we mentioned above
      async function upload(wallet, filePath, folderID){
          const arDrive = arDriveFactory({ wallet: wallet });
          const wrappedEntity = wrapFileOrFolder(filePath);
      
          const destFolderId = EID(folderID);
      
          const uploadFileResult = await arDrive.uploadAllEntities({
              entitiesToUpload: [{ wrappedEntity, destFolderId }]
          });
      
          let {created} = uploadFileResult;
          // The returned value is the DataID
          return created[0].dataTxId.transactionId;
      }
      
    • After uploading each image, the DataID can be obtained, and then a JsonFile can be generated.

      {
        "name":"name #0",
        "description":"balabala.",
        "traits":[
          {"trait_type":"backgroud","value":"blue"},
          {"trait_type":"body","value":"body"},
          {"trait_type":"eye","value":"happy"},
          {"trait_type":"hat","value":"hat"},
          {"trait_type":"clothes","value":"hoodie_B"},
          {"trait_type":"plant","value":"alsophilaspinulosa"}
        ],
        "image":"https://arweave.net/l1n24_cORIcDAOkzFc0I1IWs2qvv-eelHp4Qgb1f9vk"}
      
    • Let's talk about the cost here. Each transaction has two fields related to the cost. For example, this transaction tx 👈

      • Fee: The cost we spent on storing this file, which is the majority of the storage cost 🤕. The above transaction corresponds to a 655kb png, and the Fee is 0.000109 AR.

        In terms of Fee alone, it is generally cheaper than Pinata, of course, Infura's price is better, but Infura's access is too slow.

      • Value: This field is similar to the value field on eth, but gas is also included here.
  2. Upload the json files in directory format.

    • After uploading all the png files, we will have many json files in one directory.

    • What we need to do now is to upload these jsonFiles in a directory-accessible format.

    • Two methods

      • Note that arupload is the folder for json files, and wallet.json contains wallet private key and other information [the json file downloaded at the beginning🍎 ]
      • Replace it with your own.
      • Simple: Use a third-party tool, refer to this arkb github. This seems to charge an additional 10% fee.

      • Complex: More native, AR's own set of tools. Refer to ardrive-cli github

        • Install with npm install -g ardrive-cli

        • Upload with the command ardrive upload-file --local-path ./arupload/ --parent-folder-id "2639094e-cb4a-4546-b5fb-f582db582fae" -w ./wallet.json

          Note the parent-folder-id parameter here, which is the FolderID we mentioned above.

        • Create a manifest with the command ardrive create-manifest -f "2639094e-cb4a-4546-b5fb-f582db582fae" -w ./wallet.json

          Similarly, the -f here is the folderID.

        • After uploading, the following will be returned

          image

        • This URL plus the suffix, for example, https://arweave.net/ruwoIvbk7oLa87xKUTd-_DY4MGJ6UR8iWEE3egRkfOI/arupload/1.json can be accessed.

  3. Basically, it ends here. Set the tokenURI on etherscan, format: ar//《Path》. For example, based on the complex red box value above, it should be set as: ar://ruwoIvbk7oLa87xKUTd-_DY4MGJ6UR8iWEE3egRkfOI/arupload/


References#

https://mirror.xyz/pfeffunit.eth/iLX1IKglGDxRTufg64RdYJCrNRAMIogmLhfdJ6ZAXUY

https://blog.developerdao.com/getting-started-with-arweave#heading-introduction-to-arweave

https://docs.arweave.org/info/

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.