Hector Bardales
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Sugar **working on this section** Sugar was introduced by Metaplex to make operating the candy machine an easier process. It also introduced the use of a cache file that contains information about a collection that can now be stored onchain. It also increase the overall speed of the process from uploading to the mint. The first step is to install it. For MacOs and Linux: ``` bash <(curl -sSf https://sugar.metaplex.com/install.sh) ``` For Windows download the [installer](https://github.com/metaplex-foundation/winstaller/releases/latest/download/winstaller.exe). Open it and try to look at the version you have in your terminal with the following: ```js= sugar --version ``` And to view the available commands: ```js= sugar -h //Result sugar-cli 0.6.1 Command line tool for creating and managing Metaplex Candy Machines. USAGE: sugar [OPTIONS] <SUBCOMMAND> OPTIONS: -h, --help Print help information -l, --log-level <LOG_LEVEL> Log level: trace, debug, info, warn, error, off -V, --version Print version information SUBCOMMANDS: bundlr Interact with the bundlr network collection Manage the collection on the candy machine create-config Interactive process to create the config file deploy Deploy cache items into candy machine config on-chain hash Generate hash of cache file for hidden settings help Print this message or the help of the given subcommand(s) launch Create a candy machine deployment from assets mint Mint one NFT from candy machine reveal Reveal the NFTs from a hidden settings candy machine show Show the on-chain config of an existing candy machine sign Sign one or all NFTs from candy machine update Update the candy machine config on-chain upload Upload assets to storage and creates the cache config validate Validate JSON metadata files verify Verify uploaded data withdraw Withdraw funds from candy machine account closing it ``` To begin using Sugar, we will want to to prepare the assets that we will upload to decentralized storage and later mint. ## Asset Preparation Preparing your assets can be done with some tools that are available on Github or can be created manually for smaller collections. The first repository we'll be looking at was originally made by Hashlips, but for this test we can use a fork which has been edited to fit the current [token metdata standard](https://docs.metaplex.com/programs/token-metadata/token-standard). We will begin by cloning the [repository](https://github.com/HectorNBL/SOL-NFT-Generator-HNB): ```javascript= git clone https:https://github.com/HectorNBL/SOL-NFT-Generator-HNB.git ``` Open the folder in your IDE of choice. For this step, we'll use VSCode. You should see the following folders: ![Folders in the art generator](https://i.imgur.com/RzN4D8d.png =160x) In the main folder, you should see a `Layers` folder and you can proceed to place your layers' folders in here. The rarity of the layers in this generator is set by adding a `#` after a layer's name with a number. > Layer Name Example: Green#20.png Then, we'll go to the `src` folder which contains a `config.js` and a `main.js` file. You'll set the content of the jsons files for your collection within the `config.js` file. In this same file you will set the number of assets you want to generate. ```javascript= growEditionSizeTo: 5, ``` In this example, we are generating 5 assets which inlcudes both image and json files for the metdata. After changing all necessary information in the `config.js` file, you can proceed to open a terminal and change the directory to the generator folder. We will now install yarn: ```javascript= yarn install ``` We can then generate our files: ```javascript= node index.js //Result Created edition: 1 Created edition: 2 Created edition: 3 Created edition: 4 Created edition: 5 ``` The assets are then found in the `Build` folder. :::warning Note that assets must start from 0.png and 0.json. ::: ### Collection Preparation Finally, if you are creating a collection you will require an additional NFT which will be set as the collection NFT. To do this you can add an extra image and json file that will be uploaded with the rest of your assets. The names for these are the following: > colleciton.png > collection.json :::info The collection.json doesn't require any attributes as it will only be used to create the collection. ::: ## Sugar Usage Many of the fields for a collection are now set onchain, and to do this sugar will take in a config file. You can find an example of this file [here](https://docs.metaplex.com/developer-tools/sugar/guides/configuration) in the Metaplex Docs. You might have noticed from the subcommands listed above that Sugar also has the option of generating a config file using the following command in your terminal ```js= sugar create-config ``` After doing this you will have to answer a set of questions and your answers will be stored in your config file. ![](https://i.imgur.com/cd9iTWN.png =750x) :::info Keep in mind that for this you will need to have your treasury wallet and wallets that will receive royalties ready. ::: This image shows the answers we chose for this test. The next step is to upload your assets, these include both your images and json files: ```js= sugar upload <ASSETS DIRECTORY> -c <CONFIG FILE> ``` Once the upload was succeful we can proceed to deploy sugar. ```js= sugar deploy ``` If you are working with a collection you'll want to set the collection at this point. ```js= sugar collection set <COLLECTION NFT MINT ID> ``` The last step is to mint our NFTs. Sugar also allows you to directly mint to your wallet with: ```js= sugar mint ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully