Cli tool using the latest Umi framework from metaplex to handling minting and updating cNFTs on Solana. Still a work in progress. Please feel free to contribute!
- Install node.js, yarn (or use npm).
- Clone this repository, and using a terminal navigate to its directory.
- Run
yarnornpm installto install the dependencies.
- Copy the contents of the
.env.examplefile to a.envnext to it, and edit it with your values. - Run
yarn cli <cmdname> -args
To interact with the CNFT CLI, you can use the following commands. Make sure you have set up your environment correctly as per the installation instructions.
-
Create LUT (Lookup Table)
Create a new LUT or CNFT LUT with specified addresses.
yarn cli createLUT -a <path-to-addresses> [--cnft]
-a, --addresses <path>: Path to a JSON file containing addresses to add to LUT.--cnft: Optional flag to create a CNFT LUT.
-
Extend LUT
Extend an existing LUT with additional addresses.
yarn cli extendLUT -a <path-to-addresses> -l <LUT-address>
-a, --addresses <path>: Path to a JSON file containing addresses to add.-l, --lut <string>: LUT address to extend.
-
Create Collection
Create a new CNFT collection.
yarn cli createCollection -n <name> -s <symbol> -d <description> -i <imagePath> [-ex <externalUrl>] [-l <lutAddress>]
-n, --name <string>: Collection name.-s, --symbol <string>: Collection symbol.-d, --description <string>: Collection description.-i, --imagePath <string>: Path to the collection image.-ex, --externalUrl <string>: External URL (optional).-l, --lut <string>: LUT address (optional).
-
Fetch CNFTs
Fetch CNFTs by collection or owner.
yarn cli fetchCnfts -co <collectionAddress> [-ow <ownerAddress>] [--no-paginate]
-co, --collection <string>: Collection address of the CNFT.-ow, --owner <string>: Owner address to fetch CNFTs (optional).--no-paginate: Do not paginate all results. Returns 1000 max (optional).
-
Search CNFTs
Search CNFTs by collection or owner.
yarn cli search -co <collectionAddress> [-ow <ownerAddress>] [--no-paginate] [--no-compressed]
-co, --collection <string>: Collection address of the CNFT.-ow, --owner <string>: Owner address to fetch CNFTs (optional).--no-paginate: Do not paginate all results. Returns 1000 max (optional).--no-compressed: Search non-compressed assets (optional).
Most commands support the following additional options:
-e, --env <string>: Solana cluster env name (default: devnet).-k, --keypair <path>: Solana wallet location. This option is mandatory for commands that require a wallet.-r, --rpc <string>: Custom RPC URL.--no-log: Do not log results to outfile (default: true).
Create a new LUT with addresses from a file:
yarn cli createLUT -a ./addresses.jsonCreate a new CNFT collection:
yarn cli createCollection -n "My Collection" -s "MYC" -d "This is my collection." -i ./image.pngSearch CNFTs by owner:
yarn cli search -ow H3tJWnY9Wm6pF3V9LzZ3ZhVFeXgE8YkiGd6zGR4gX6G-
Build:
docker build -t my-app .Replacing
my-appwith the image name. -
Run
docker run -d -p 3000:3000 my-appReplacing
my-appwith the image name, and3000:3000with thehost:containerports to publish.
- Installing the Eslint (
dbaeumer.vscode-eslint) and Prettier - Code formatter (esbenp.prettier-vscode) extensions is recommended.
- Run
yarn lintornpm lintto lint the code. - Run
yarn formatornpm formatto format the code.
Check the placeholder test examples to get started :
/src/app.tsthat provide a functionsum/test/app.spec.tswho test thesumfunction
This files are just an example, feel free to remove it
- Run
yarn testornpm testto execute all tests. - Run
yarn test:watchornpm test:watchto run tests in watch (loop) mode. - Run
yarn test:coverageornpm test:coverageto see the tests coverage report.