Skip to main content
Hugo’s IT journal Hugo's IT journal

Notes about Solana

·
blockchain solana nft

Useful links #

Explorer>

Explorer #

NFT marketplace>

NFT marketplace #

Good articles to understand the concept of solana>

Good articles to understand the concept of solana #

In the Solana world, data will be stored in different accounts. Accounts will be associated with each other by cross-referencing. The Solana program will be used to manipulate those accounts (create, delete, set link). Business logic will be introduced from a separated program.

Common tasks eg: creating token / nft can be done with some universal solana programs ( spl Token program, metaplex) on solana network. Developers don’t need to write their own solana program. This makes things become more standard. People write their own business logic by extending the functions of those universal programs but won’t start from zero.

Notes>

Notes #

  • solfaucet can claim free SOL (devnet) for development
  • Most of the people use metaplex to create nft
  • Metaplex’s Token Metadata Program defined the standard of a solana NFT
  • Metaplex’s candy machine provided abilities to sell the nft eg: loot box, start/end date, whitelist
  • sugar is a cli tool to create candy machines. It simplified the task but I got a “Request header too large” error when uploading a large file (100MB)
  • Metaplex javascript sdk can solve the issue of sugar but their documentation at this moment is a bit old (even on github README). The examples are still in V1 but sugar cli has already moved V2. The syntax of V2 is quite different from V1. Therefore, I have to refer to this sdk doc for development.
  • If “animation_url” is set to a mp4 / gif, it will playable inside the solana wallet (like phantom). I thought it was related to the “properties.files” field.
  • “properties.files” should include all related resources. For examples, if the NFT have a mp4 “animation_url” and jpg “image”, “properties.files” should include both
  • When uploading files to arweave with metaplex sdk, it will not append ?ext=<extension> to the URL. This caused the image and videos to fail to be shown correctly on the phantom wallet. The file extension should always be included like https://www.arweave.net/efgh1234?ext=mp4.
  • this calculator is useful to calculator how much do we need to pay for the persistent storage on arweave
  • spl token program cli is used to create token / nft but it provides the basic functions only. For instance, there is no metadata for the nft token created from the token program. Metaplex is kind of extension which added the metadata and venting machine functions on top of the token program
  • solana cli - will be used to create accounts / transfer / check balances. More use cases are in here.
  • When create a solana account, it will print out 12-words seed phases and save the private key in ~/.config/solana/id.json. Please save the seed phases. The private key can be derived from seed phases but we can’t recover the seed phases from private keys.
  • Solana-cli-created accounts can only be imported to the phantom wallet with a private key. The default derivation path of Phantom is different from solana-cli. Changing the derivation path is only supported when importing a hardware wallet to phantom. Therefore, there is no way to import the account from seed phases.
  • To do that, we have to convert uint8array (id.json) to base58. This can be done by library like base58-js
  • web3.js - web3 library of solana but people usually use the anchor’s version because most of the solana programs are developed from anchor
  • this shows the public clusters in the solana network. I use quicknode to create a dedicated solana endpoint instead.
  • More examples can be found on Solana Cookbook, Solana Web3 Demo, Solana Development Guide