Today I’m going to take you through the whole process of getting your NFT collection on the salona network my name’s daniel aka hashtags and welcome to the channel where i teach you how to code and we talk about everything blockchain-related.
Now if you get stuck in any part of this tutorial series please go ahead and go to hashtabs.online and then join our discord or telegram channels the community is very friendly and there’s always people eager to help out if you are stuck next in this video we will be for the first part looking at the hashtabs art.
Engine if you haven’t dealt with the hashtags art engine yet and want to know how to generate thousands of nft artworks go to the playlist on my channel and look through the playlist over here this is create 10 000 artworks using that engine and it will give you a good oversight on how to use the program.
Keep in mind each iteration or each video we add to the code and there are updates so watch all of the videos that being said let’s jump in and look at how we can start our solana nft collection a little bit about solana it’s a blockchain it’s very fast and scalable this makes it a great contender for nfts.
Especially if you go down here and see the live transactions taking place and the very appealing transaction cost which is super low that’s why people have been publishing the nfts and selling the nfts on solana now the problem is how do we get our generated nfts and metadata onto the solana blockchain.
Well that’s what we’re going to find out today solana works a little bit differently to ethereum where ethereum has smart contracts solana has something called programs the two are also written in two different programming languages luckily there are companies out there or.
Protocols that’s been written right on solana that makes it easier for us to simply use their code base and interact with the program and deploy our nft using their protocol and that’s the protocol that we’ll be looking at so even though we are deploying now on solana we’ll be spending most of our.
Time in something called metaplex now these are the metaplex docs and let’s talk about what metaplex even is so now that we understand that solana is going to be the underlying blockchain that we are deploying our nfts on we need some kind of toolset some program to help us upload our nfts onto.
The blockchain and create the link between the nfts and a minting kind of dap right for the users to mint and that’s where metaplex comes in metaplex is built on top of solana and is its own kind of set of tools and smart contracts to help us achieve uploading the images and metadata and then creating that link so that we can use it in a front-end app.
For users to mint your nfts solana by itself if you just write smart well not smart contracts but programs on it you have to know rust and you need to dive deep into code which we’ll get to on a later tutorial for now just understand that metaplex is a set of tools that’s available for us.
To use to make this process of uploading nfts easier onto the solana network the tools that we are going to be using from metaplex is basically the candy machine so metaplex provides us a way to create your own store such as openc but just on solana and create the candy machine that they call it which i think it’s a very cool name because it’s almost like a.
Candy machine you put a bunch of stuff in there and if you turn the knob then a candy falls out right that’s what i imagine it to be but anyway candy machine is actually the small a small library that they have for you to use to create that linkage to upload your nft data to the network and to.
Create that link giving us some ids that we can use in a mintingdap which we can look at another repo later on in this tutorial but candy machine is the crucial part that we need to upload the nfts to get you used to the solana ecosystem explorer.solano.com is a place that you can go to to see transactions look at.
What’s happening on the blockchain itself it’s very similar to the etherscan.io for the ethereum blockchain each blockchain has some sort of website like this where you can look up transactions and what’s happening on the blockchain this.
Explorer.solano.com is great but there’s a better one that i feel is much more intuitive and if you scan your wallet you will also be able to see your nfts on it so this one is called soul scan dot io which is pretty cool the next thing that i want you to note is in your extensions usually you’ll use.
Metamask for the ethereum network but this time you need to download phantom the phantom wallet is very similar to metamask but phantom is used for solana so go ahead and download phantom log in and follow the process so that you can get your first wallet address listed on your phantom wallet and then make sure you save all the.
Private keys somewhere safe so once you have your phantom wallet installed and everything is ready to go you can find it with some soul from an exchange there’s a lot of videos on how to do that the most important concept i want you to grasp is if you go to the settings tab.
Over here and you scroll down you can switch the network to the devnet currently i’m on the main network if i switch to the devnet i will see if i go back to my funds i can go to the top here and you can see my main account doesn’t have anything because it’s now pointing to the developer network.
I do however have a test account that i’ve set up a test wallet and funded it with some test soul and i also then gone ahead and complete the process of uploading an nft now this is where you can view your nfts and like i said this is now on the devnet but please understand that in.
This video we’ll be talking about the mainnet and the devnet so everything we’ll be doing will be doing on the devnet but once you’re ready you can switch to the main it and do everything exactly the same but this time with real soul real money and deploying it on the real main network that being said don’t worry about not.
Having a test account yet we will create one on your local machine which we are going to fund with some test soul and then you can import it into your wallet i’ll show you how to do that in this tutorial for now just sit back relax and enjoy this tutorial we’re now going to look at the dependencies you’ll need to have to.
Follow along for the prerequisites make sure that you have node.js installed you can go to nodejs.org and install it for your platform next you also want to make sure that you have some sort of code editor ide available that makes it easy for us to work with the code this is visual studio code and i highly recommend it it’s free.
And it’s a wonderful tool you can go ahead and install this on your machine just follow the steps this is where the whole journey starts you can go to getup.com forward slash hash libs forward slash hashtabs underscore art underscore engine this is the whole program that everyone has been using to generate nfts.
Now you’ll see when you land on this page on the right hand side there’s releases and if you click on releases you can see all the different releases that’s been happening with this program currently we are looking at version 1.0.8 which has the solana metadata update so what i want you to do is when you’re on the releases page go and.
Download the source code.zip file on your desktop and extract it the next program that you’re going to need is metaplex remember the tool set that we talked about so go to this github repo metaplex foundation dash metaplex and then once you on this page you can click on this green button code over here and also download the zip i want to download.
All the prerequisite programs and have it stored in one location so it’s easy for us to switch between them the last piece of the puzzle that we’ll need is the exiled apes dash candy machine mint now this repo is not totally necessary because this is simply a web page where we hook up all the configurations and then it interacts.
With the minting dap to the blockchain and then it means the nfts so what i’m basically saying is this part you can swap out for any other ui and we’re going to see how we can change the ui but it’s very convenient to use this repo so i would suggest go ahead and use it and then change up the css the styling so that you know.
Everything will work perfectly we can go ahead and click on the code button and then click on download zip i want you to put all this on your desktop in a folder and then we’re going to extract all three of these repos now that we have the three main parts that we need you can go and unzip each.
File i’ve placed all these folders inside one directory it’s very important to keep your code neat and your project needs as you work with it so i can go ahead and delete those zip files after extracting each folder and we’re ready to go now keeping in mind we’re going to start off with the hashtags art engine first.
If you want to know more about the hashtabs art engine and how it works how you can build out very complex nft structures go ahead and watch that playlist that i showed off in the beginning of this video now all we’re going to use the hashtabs art engine for in this series is using the base nfts that we get along with it.
And generate the solana metadata so that it can work on the solana blockchain let’s go ahead and look at what we need to do next the next step that you want to do is actually open visual studio code go and say file open and locate the folder that we have now created i’ve placed everything.
Underneath a folder called solana and in there the first folder we need to basically go and do stuff in is the hashtabs art engine so let’s go in there and let’s just say open once we’ve done this we get to the hashtabs art engine program now we usually follow the same steps.
Over and over we go to terminal say new terminal then we run npm install once the installation is complete we can then run the commands allocated here on the package.json file and these are these ones build generate rarity preview pixelate and update info.
Each one is explained in the previous videos that i’ve made in that playlist but go ahead and explore them for yourself what’s most important here is that our layers over here you can see on the layers folder we’ve got our backgrounds bottom lids and they all are.
Different layers for the nft that i’m going to generate it’s very important that the spelling of these layers and files are correct how you want it to appear on your metadata once we have our layers configured and you have all your images and layers imported you can open the source file inside config.
And then in here just make sure that your layer spelling over there background bottom lid eye color is the same that it’s spelt over here you can add extra options to change that name and that’s also explained in the version 1.0.7.
But the latest changes in version 1.0.8 is the real solana change let’s walk through the changes that’s been made and how we can utilize exporting solana metadata as well as the images i’m going to generate my images with the ethereum network in mind as you would if you do this for ethereum i need to make sure and by default it’s.
Set to eth that on line 9 over here that the network is eth the other option is dot sol we’ll get to that in a second making sure that this is now the network ethereum it will not include this metadata for solana but it will include the general metadata over here so you still need to change these then in the.
Terminal below i can run npm run generate like so once i do that a new bold folder will be created and inside there the images as well as the metadata will now be created for me i can see that if i scroll down that five images will be created.
Please note that you see here in the terminal that it started from 1 all the way to 5. now when it comes to solana it’s going to generate from 0 to 4 if you’ve specified 5 nfts keep that in mind but for now because this is ethereum we can open the bold folder and look at the images which looks pretty cool.
And in the json file we have their respective json uh files for each image this looks pretty familiar and it’s because it’s exactly the same as how it was for ethereum let’s say we want to generate solana metadata to make it clear you can use this program to generate ethereum.
Metadata and solana metadata but how do we generate the solana part now well what we can do is let’s quickly briefly take a look on the metaplex documentation for the metadata standard when it comes to solana you will see that the metadata looks very similar to ethereum.
We also have name description image and all these things but most of this data gets compiled and altered with metaplex as soon as it uploads to the cloud and to the decentralized storage so i’ll explain that when it comes to this but there are a few extra fields such as sellers fee.
Basis points and so on so that’s something you need to take in consideration when working with solana luckily the program that i’m showing you now generates this for you and you only have to change a few attributes let’s jump back to the program and let me discuss the thing that you need to.
Change when working with solana so the first thing you need to do to generate salina metadata is change this line on number nine to instead of saying network dot if network dot soul in small letters like so this will tell the hashtabs art engine that you are about to generate metadata.
For solana and it will take this in consideration let’s quickly walk through the variables that you need to alter keep in mind this section over here is cross platform it’s generic it will show up on ethereum and solana so please remember to change your name that prefixes the hashtag for your nft.
So what you can do is here you specify a name of the collection you can also leave it empty if you want to i’ve made it nerdy code of clones but let’s call it uh i’m gonna work with the sheep the sheep gang club i don’t know.
Uh sheep gang club okay then next replace your description to what you want and when it comes to solana the base uri is not important when when you’re working with ethereum it is but not in solana’s case so leave this just as it is next because we have a symbol don’t make this more than five or six characters.
Keep it short and nice because my collection’s name is sheep gang club i’m going to call this sgc then it comes to the seller’s fee basis points now what this basically is it it refers to the secondary sales what you’ll get and you can get up to 10 of secondary sales or even more i think i’m not sure but at this point keep it.
Under 10 because you don’t really want to take the whole pie but basically you specified in points instead of saying a percentage the thousand points will be 10 so if you want to specify that you want 2.5 percent of a secondary sale on a nft you would say this should be 250 then you get the external link you can.
Change this to point to your collection’s website or whatever it might be then you get to the creator section you can see that creators lives in an array and i’ve got one creator in here keep in mind that the shares distributed between these creators needs to add up to a hundred.
So if i for instance had a new creator in here and i wanted to say we’re going to split the fee 50 50 this will be the secondary sales what you’ll do is you’ll specify it like this splitting this up to still make a hundred you can add a lot more if you want to and just remember to change the address.
This now needs to be a sole address a salon address but anyway i’m going to keep it simple and maybe just have one in there you also don’t have to specify in there if you don’t specify this parameter but i’m going to keep one address in there at least and that’s about it that you need to.
Change so remember to change this to dot sol and to update your metadata over here when you run the program again by typing in npm run generate and i can just do that and hit enter you’ll see that it regenerates the collection and the build file is emptied and created again and.
This time you can see it starts from zero that’s very important in the solana space so even though i’ve specified that i wanted five nfts it’s going to generate from zero to four still making it five but it’s just 0 indexed if we look at the json method data now.
You can see that we’ve got pretty similar metadata to what celana expects and we can verify that by going to the website and just seeing how it looks over here and that’s how simple it is to basically generate a collection from layers like i said if you want to see the full layer generation part please go and watch that.
Tutorial series on the on this hashtag art engine but this is how simple you can just swap out for solana metadata to show you how easy it is to swap back you can just go to the config.js file and remember to save the config.js before you run the commands you can go in there and say dot eth.
Again and then once you’ve set that you can go into the terminal run it run the command and you see it generates ethereum metadata again so we’re going to keep it 2.sol for now i’m going to hit save and i’m going to have it run now that you have your collection ready.
And let’s say you made thousands right you can increase this number over here to a thousand nfts um maybe i’m gonna make a bit more than five so i’ll make ten so i’m gonna just generate ten and there we go it’s from 0 to 9 and you can see there’s my image of 0 to 9. it’s a good practice.
To at this point just select a random one and check the corresponding metadata so number 7 has a purplish blue eye and if i click on this metadata you can see that the eye color is purple it’s good to batch check just uh some of the metadata perfect now that we have this our first section.
Is done and now we can open metaplex just on a side note i want to make sure that you understand that this creators array seeing that i took an address away needs to be a hundred again i took one away and i left it at fifty but you need to make sure that this whole array how many addresses you add in there it all adds up correctly to a.
Hundred percent basically so that being said after you have made sure that this all adds up to that hundred share then you can run it again and you’ll be sure that your collection will be successful now that we’re done with the very first step and that is creating the art and.
The metadata let’s go ahead and create a new folder i’m going to call this folder asset like so and then i’m going to open up the ashlips art engine and go into the build folder and open up my images i’m going to drag all my images up to that very top level.
Assets as well as all the json files i’m going to leave out the underscore metadata.json once it’s all in assets i can close off my art engine again and let’s have a look at this assets folder you can see that it’s now a mixture between metadata and the image.
Now metaplex will automatically loop through this and update your metadata accordingly to upload it to the decentralized storage so once you have your assets folder set up like this you can go ahead and put it directly in the metaplex master folder so i’m going to drag this assets all the way in there.
And that’s it now we can go ahead and open visual studio code and i can say file open and this time i’m going to go to my place where i’ve saved these three folders and i’m going to open the metaplex once i open metaplex i will see that.
There’s my assets folder with all the assets for now we’re just going to leave it there because we need to now install this soul solana cli the salona cli is separate from metaplex but it’s something that we need in our computer to actually run solana commands.
And that metaplex also uses let’s now get a bit more technical if you have made it this far congratulations i really appreciate you sticking with me in this tutorial it means that you are a hashtag’s art engine master now just a side note if you love this.
Content please leave a comment on this video and a like and i would always appreciate if you subscribe so that you don’t miss out if i have any updates talking about updates we are going to focus on metaplex now metaplex is still under development and might change in the future that’s why following this guide you will see the most up-to-date.
Version of metaplex when you follow along with their guides and that’s what we are going to do because that’s the most source of truth way of doing a tutorial is going to the documentation let’s go ahead and see what i’m talking about if you go to the documentation you’ll.
See that metaplex has an introduction but what we want to focus on is the candy machine part so if you click on candy machine the tab click on introduction this is where our journey will start to upload our collection looking at the introduction we can see that we need some prerequisites so let’s go ahead and.
Click on this link over here this link tells us we need to have this installed before we can work with metaplex and candy machine this is because we need to make sure that we have got the solana cli installed which is separate but candy machine and metaplex makes use of.
It so we need to install that now it says that you need get installed here firstly well we don’t really need it because we already downloaded our github repos by manually downloading the zip file it’s sometimes complex for people to understand what git is but it’s source.
Control so if you understand what it is do it that way otherwise just follow along how i’ve done it next we need node installed and you should already have node installed based on the previous tutorial then it asks us to install yarn let’s go and do that step if we go to visual studio and we click.
On terminal and on new terminal you would get a new terminal down here and we can simply run npm install yarn now here we can say install okay need to say install yarn now once you install yarn.
Yawn will be added to your machine and then you can use yarn commands yarn is exactly the same as npm it’s just a different package manager i prefer yarn but most people are comfortable with node and npm then let’s go back to the documentation and it asked us to install ts node now this is a typescript version i.
Believe of node but what we’re going to do is i’m going to show you how to install it and this might work perfectly for you in my case it doesn’t want me to install this on my machine and the reason for that it is how my paths are set up so i’m going to show you what you will do so what you need to do.
Is if you go to the installation you can click here by the way you can follow installation files on each one of these so there you can see we can run a bunch of these commands so we can basically run this command if we want to install it globally so let’s go back to visual studio code and paste that.
And this will use npm install the dash g says that it’s going to be global on your machine otherwise you can just omit the dash g and it will install only for this package and you can hit enter this will now start a big download and install ts node to check if everything is working you.
Can check the node version so let’s go back to the documentation first so let’s check that we have node and obviously you would have had note but i’m going to show you anyway how you can check so you can type node dash dash version if there’s a version number popping up.
You’ve installed this correctly we can also do this with yarn dash dash version and there’s yarn now we can try ts dash node but like i said my machine doesn’t work really well with it dash dash version and there you can see it says it didn’t find it now for me there’s a workaround.
Which i’m going to show you for you it might just work and you don’t need this workaround the workaround is to use npx which downloads the dependency as you need it but we’ll get to that on a later stage don’t worry for now you can still follow along and you can just run all the commands as it should if you have the.
Same problem that i’m incurring i’ll also show you that workaround let’s see what is the next prerequisites that we need we’ve already tested our versions apart from git because we already downloaded all the repos needed for this tutorial so the next part you can actually scroll all the way down to where it says.
Install the solana command line tools click on that link and let’s open it follow this link for your operating system so if you have mac or linux follow this section and then if you have windows go and follow this section i’m going to scroll all the way to the top and follow the mac os because that’s.
What i’m running so it tells me to go and install this so i’m going to copy that and then i’m going to go to my visual studio code click on terminal new terminal and then i’m going to paste this in here i’m going to hit enter so do the same if you have windows for the windows machine and the windows steps.
Now this will download onto my machine the solana cli and this will allow me to in the terminal in these terminals to run the solana commands and you can do a lot of cool things with us now it’s going to ask us to update our environment variables to use this path so at this point you can even see in the.
Documentation that they mentioned that you might need to update the path variable in order for you to run solana now this might not be the case for you and you might be able to run solana like that and when you hit enter solana should work or in specific solana dash dash version.
Like so you can see that it’s asking me to update the path now i can copy this and paste it in here and it will work only for this terminal but let’s do it the right way of updating it there’s a different way of getting the path for windows so just google that if you are struggling but for mac you can.
Copy the path all the way from there to here open up a new terminal and run sudo nano forward slash etc forward slash paths then you’re going to put in your password and once you get to this file you want to paste your path in there then hit that.
Um symbol over there so the up arrow and x and then just y to save it once you’ve done this solana is now added to your paths of your machine the path basically points to the bin file the execution file of solana so now when i run it it should work but it.
Will require that you close the terminal so i’m going to close the terminal so i’m just going to maybe remove all these terminals say file new terminal so that it has a refresh and then i’m going to run solana dash dash version once i do that i can see that i get the.
Solana version over there and now we can continue now that we have the cli installed basically the command line tools for solana we have solana on our machine just to give you an example i can go to visual studio and type in solana and then you can see all the commands that i can potentially run such as transfer getting airdrops.
Making setting up the configuration looking at my accounts the address and so forth this is a very nice tool how you can interact with the blockchain i’m going to press command k to clear the terminal then i’m going to go back to the documentation and we can see that they.
Want us now to set up our network so you can see that we have to type in solana configure set the url to point to the devnet on solana what is this what basically does this mean well remember our phantom wallet now i’m just going to type in my.
Password here so remember the the phantom wallet where i said you get the devnet and you get the test net right there’s the dev network and you can see that it says https api devnet.solana.com because we are testing this on the devnet we want to set the configuration of our solana that we have on our local.
Machine to point to this network because we don’t want to do it on the main network yet but if you are going to do it on the main network you’re going to set it up to point to the main network but not that one you’ll most probably do this one okay now.
Let’s go ahead and let’s go back to our tutorial and let’s run this command so copy this command all the way from there to here let’s go and paste it in our terminal and hit enter you can now see that the rpc url this one this line over here should now say api.devnet.solana.com.
And that is we’ve done it correctly so that’s perfect let’s go and do the next step so now we need to actually create a wallet so how do we create a wallet now remember you had a wallet here in phantom which is your main wallet in your test wallet.
Now i’m going to create a new wallet and hook it up to my phantom just for future usage but i’m going to warn you when you do this this is going to show your your private key so please don’t do this and show your private key to the whole world i’m just doing this for testing purposes so what you need to run next is this.
Line over here so line our key gen new and then the output file and then you need to specify where do you want to output this to so this is going to output to my configs file in my machine so i’m just going to copy this and then i’m going to go down and i’m going to go to my visual studio i’m.
Going to paste that in there but let’s call this the devnet dash lips right i’m just going to call my file definite dash hash loops so at this point i’m going to hit enter now it’s going to ask me for a key phrase now this is kind of your password phrase so just think of something i’m.
Going to use one two three four and there we go so now that i’ve entered that this spits out to us very crucial information so the information here you can see this is our seed phrase which you should never show to anyone like i said i’m just sharing this because this is a test account.
At this point it’s very important for you to start saving this information please save this crucial information on a safe place for now i’m going to save everything that is outputted right here in a file i’m going to create a new file and just call it info then i’m going to copy this whole line.
From there to here and paste it in there i also want to actually make sure that this is a secure place that i save this in so just make sure that this is secure and you don’t just save it willy-nilly so that everyone can have access to it basically the information that’s here shows where this configuration file sits this is kind of your private key your.
Key pair where it sits and exists on your machine this is a very important file and shouldn’t be shared with anyone this is also the file that you can use to connect your phantom wallet i’ll show you how to do that in just a second next this is your public key the key that you usually see in your wallet.
And your phrase like i mentioned so just save this in the info section i’m going to do this because i want you to get used to saving the command so it’s easy for you to copy it on a later stage let’s go and add this wallet to our phantom address so that we can use it on a later stage to do some mints.
So i want to copy this and then open the finder i’m going to press ctrl command g to paste in where this file is located and there it is so now what i want to do with this on hand i can actually pull it to the side and i can open my chrome browser go to my phantom extension.
And in here i want to click add and connect a wallet here i can say import my private key so this is optional i’m just going to call this test2 because later on i’m going to definitely delete this then i want to open my key i want to select everything copy that.
And then go back to chrome i have to do this again so go and add the wallet import private key paste it in there and i’m going to call this tester2 now i can say import and there you can see there’s a new test.
Wallet so that’s a test wallet and i also have this as a test wallet you can see currently my test wallet has zero funds in it let’s make sure that we are on the dev network so that we can see the changes reflecting immediately we are indeed on the dev network because remember we set the dev network over there.
Now let’s go ahead and go back to visual studio code we can close this now off and just make sure you save your info file you can now see that this is exactly what we got now in here we’re going to set another configuration remember we set the configuration to point to the dev.
Network well now we’re going to point it to the key pair where we have saved it so copy everything from solana config set key pair and then this part we’re going to change so go back to visual studio at the bottom paste that in there solana config key pair with a space.
And then copy this that you’ve saved in your info file and paste it there at the end so the full command looks like that i’m going to hit enter and then you’ll see that our key pair down here has now been updated to point to this json what does this now mean.
Well it means if i say solana balance it will try and get the balance of that wallet right this is my prime public key and this is my private phrase and i’ve now hooked it up over here i also hooked it up to phantom on the browser so now my.
Wallet is hooked up locally and it’s also hooked up on the browser now what is next well we can now airdrop a solana or a fuselana to our wallet but this is def testing solana so let’s go and do that how you can do that is by running solana airdrop and then you specify how much it should.
Airdrop i’m going to try an airdrop 3 salina so now it’s saying requesting to airdrop 3 and that was successful over there you can see three is in this wallet so this time if i run solana balance i can see that that balance is three i can also run interesting commands such.
As solana address and by doing that i can get my public key over there again just for in case i forgot it like i said solano has a lot of commands that you can run but the most important thing is we airdropped three solana to our address using the cli if we go to phantom this should also.
Reflect over here on our test address you can see it’s the same address because it’s three ffo and if we go and check in visual studio it ends with 3 ffo so if we go and open phantom again we can see that indeed we’ve got 3 soul okay enough explaining about the cli and.
What solana does and this is all cool but let’s get back to the metaplex part so in your terminal what you can do now make sure that you are on metaplex in this root directory and i’m going to hit command k to clear out the terminal and this time i’m going to say cd js.
What does cd.js mean you can see that now it says j is there it means that i basically am pointing inside of this directory so instead of me opening visual studio on this directory again the terminal is simply pointing to it so in there i want to run yarn and install.
So let’s go and run yarn install make sure all the dependencies are installing and then i’m going to run yarn bootstrap once this is finished you want to run yarn build after running yarn build like i said we’re going to run you on bootstrap let’s wait for this to finish its execution great it is successful.
Now you can type in yarn boot strap and run that this will bootstrap all the files and now we actually ready to go one folder back so you want to type in cd dot dot and hit enter you want to make sure that it says you on the metaplex root file again we don’t want to be pointing in the js.
Because from here on out we want to have access to our assets and we will drill down to the candy machine perfect we are now at the place where we want to be we are going to tell metaplex to actually upload our assets now to the decentral storage and then hook it up to.
The candy machine so that we can create the front end dap there are three crucial commands that we need to run and they look like this i am going to put these commands in the description of this video but keep in mind that each one of these commands prefix like this is exactly the same.
What it basically means is that we are going to go into the js then package then cli the src then the candy machine cli.ts file we want to locate this file which is basically sitting inside js packages cli source and there it is.
But the reason why we specify it like this is because we are now on the root file make sure you are on the root file once you are you can go ahead and run this first command you can see that this command wants to upload a folder which is our dot assets sitting here then we specify the environment which is.
Devnet if you want to deploy to the mainnet you will change these all to mainnet as well as where it’s pointing to and then you want to pass it a key pair so what you want to do now is take your key pair up here and replace it everywhere where it says path the second command basically does the.
Candy machine creation it’s also on the dev environment and the key pair we’re going to give it is exactly the same so replace it and then the last command while now the token has been created we want to update and say that our token needs a price that it can mint against as well as a starting date this date can.
Be older than today so that you can immediately start minting but here again i’m going to replace the path now that we have these three lines you can basically go ahead and copy and paste them in your terminal i’m just going to pause for a second so that you can actually see.
What you need to type out so they look like that just keep in mind replace this part with your with your key pair so and this is how it looks here at the end so that you can type it out.
I hope you got that let’s go ahead and copy the first line paste it in our terminal and hit enter this process is quite quick what it will do is it will look for the two pairs while the image and the json file and here you can see it tells us that it found 10 and it’s going to go ahead and upload.
Them to a decentral storage and that’s exactly what we want you will see that as soon as this process takes place a dot cage file here on the left hand side is created we can open this on a later stage and well we can just click on it and look at how it looks like now but on a later stage i’m going to show you how we can.
Read the data from this where we’re going to need it for our dap for now let’s complete our three commands so let’s wait for this to be to finish up and then we can run the second one this is all successful and complete you can see it says done and it was successful.
What we want to do now is copy this link over here the second one so go ahead and copy that you will probably have to get it from the description or type this out well all it needs to do is it needs to create the candy machine and we’re going to pass it in.
The env which is devnet and then it needs a key pair and that’s basically all so once you’ve copied that second line go in your terminal and paste it and hit enter this will go ahead and now actually create the link the bond on the blockchain to go and create the.
Transaction and get our candy machine minting dap ready right because we or prepare for it for us to get it ready basically it’s going to kick off a transaction so that is finished you can see that we now have a public key.
There it is and then the last command we’re going to copy as well basically what this does is it updates the candy machine with information we have to give it the key pair which is our key pair and this will be your keypad then we’re going to put a price now this.
Price is in seoul so i can maybe specify this as dot for soul or dot two soul and then we wanna specify a date and then this will be our date the date has to be in this format so just make sure it is in that format and you can set it to an older date meaning that you can actually start minting today if.
It’s an older date if it’s a future date it would be like a you know launch date and that’s basically what it is i love my nfts so i’m gonna make my price one sol anyway let me copy this and let me go and paste it here at the bottom in the terminal and let’s press.
Enter and have it update the information i just want to show you what’s basically now happening if i go to the browser quickly you can see that we got the soul scanner if i open my wallet on phantom and login and i go to the wallet address that i am using remember i am using the 3ff0.
And if you want to know what wallet you are using locally you can go to your terminal and by the way this was successful it said that it updated the timestamp and the starting date you can just make sure that there’s your public key it’s the three ff0 wallet remember.
But if you also want to get your wallet again you can run solana and address then you also will get your wallet but by the way we can go and open that wallet on phantom and head over to the transactions and there you can see this is what happened.
We have a successful transaction and you can actually see this transaction over here the signature i’m going to copy that going to paste it in the sole scan dot io and search for it and then here i can see so i can see now that there’s my go live date there’s my price one soul and there’s everything that i need.
How cool is that well now we can actually go and hook up the rest of this tutorial to our dap basically so all our candy machine to the dap but before we do that i want to show you where you can get the most important information.
So if you go to this cache file in this devnet temp and you can see there’s a long string with all this information here you can find the place where it says config and then copy this basically this hash go to your info file and paste it here then just maybe make a note here at the.
End that it is a config so i’m going to just give it a like so this is my config then i need my second one which if i go back to that temp dev file and i go all the way to the back these three keys.
These three properties are very important so i’m going to copy that i’m going to go here and paste it you can see that the ones that i just copied now is basically the authority the candy machine address and the start date it’s basically the same that i’ve just.
Seen on this scanner but it’s better for me to actually go and just finish the tutorial by showing how you can get this off the actual files as well so now that we have this i’m going to copy this and.
Just close this and copy this then i’m going to go to the file i’m going to say open and then remember where we actually have the salina file and the candy machine that we’ve downloaded now is the time to open this so let’s go ahead and open the candy machine.
You can see that this is now your candy machine template and it is a normal website the first thing you want to do when you open this repo this folder is run npm or not npm yarn install once you run beyond install it will.
Install all the dependencies making your dap ready to run the next thing that you want to do is go to the dot env file the dot env dot example firstly rename this and take off the example so all you need there is the dot env once you have that you can open this file up.
You can paste the contents that you just copied or you can go and grab it again but we need to basically replace the config and the authority and the candy machine and the start date in these parameters so here you can see the top one requires the canny machine configuration.
That is this address so i’m going to paste that there the next one is the candy machine id that is the candy machine address which is this one that one i can paste over here then the authority is my wallet which i can put there and then i need a start date.
Which is this time stamp i can now go and remove this save this file and in the terminal run yarn start the yarn start command will start up your local host now that we have this we can go ahead and connect to our wallet which is phantom once i do that i can see that there is.
My wallet the sole in my wallet balance the available nfts how many has been minted and how many harmonies remaining you can see that if we go to phantom that we are indeed on the dev network so let’s go ahead and mint.
I’m going to click on mint it’s going to pop up the transaction and let’s go ahead and approve this might take a second and if you want to view the transaction you can go into your wallet go down here and click on this.
Transaction here we can see that this took place just now like i mentioned i have a way better experience using soul scan so i’m going to copy the signature head over to soul scan and paste it in here now i can see this was successful.
It minted a nft and how cool is that now technically if i go to my wallet you can go on phantom and if i go and copy my wallet address let me just go and copy it.
Over there and i put it insole scan you can see there’s my value and there’s my spl token balance i’ve got one so now i can actually go and click on that one and let’s look at my very new nft i absolutely love soul scan for the fact that you can see everything so nicely.
You can even see the metadata over here and it’s pretty cool well guys i think we have done very well up until this point i would love for you guys to tell me in the comments if you would like me to do a video next showing you how to do this on the main network when you come back to the dap you can.
See that there are 10 available and now there’s one redeemed which is in my wallet if you go to your phantom wallet now you can click on these little blocks and then you’ll see the nft right there i think phantom is very cool for the fact that they splay it display your nft so nicely.
We are not done yet this dap doesn’t look at all appealing so what we’re going to do next is go through a let’s call it revamp session what you can do now is jump back to the code base go to the src folder and open the home.tsx this is the place that i’ve seen in this repo where we can find the balance total.
Redeemable and remaining keep in mind i did not code on this repo so i have to kind of find my way around as well but this main element here we can give a background color and this is usually the process i take to figure out where elements sit on the page i give it a background color of pink so.
Let’s do pink and then when i go to the browser i can see this container wraps those two elements this is very good so what i can do now let’s go ahead and maybe center them off the bat when working with css we get a term called flex so if i make the.
Display flex and then simply put the justify content to center we will see that if i go back to the content it’s centered here i want to kind of make this dap so that the connect button sits here on the right top side and then we can have the content here in the middle it’s just a.
Basic restructuring let’s see how we can do that so the easiest way is to split your kind of divs your section with background colors so we can easily see what we are doing and how we are working with the structure so let’s go ahead and add a new div over here so i’m just going to say this is.
Going to be our new div and we need to close it and then i’m going to make another div this div is going to be for our top content and this one for our bottom content the whole screen now because we made this flex we can actually now on this content div flex it to the fullest of the screen but like i.
Said it’s best if we put a background color on each of these so i’m gonna remove this but then change the background color to green and i’m just going to save it so it restructures and then on this div i’m going to put a blue so nothing is in there yet.
What i want to do is instead of centering the content in the middle i’m going to take that out but i’m going to leave it flex and i’ll show you how nice flex works in css i’m going to go ahead and put all this content in my div right there.
I’m gonna have to close that off and take that away so it looks like this then i’m going to take this part where it says main content and let me think about this this is the minting button i basically still want my minting button to be there we also have the snack bomb the snack bar i will kind of leave here at the bottom so i’m gonna leave that.
There but this main content part so i’m just going to select that all and let me also put it here at the top so let me put it there at the top now what we will have on the screen is basically something that looks like this but now we want it to stack on top of each other for it to stack on top we.
Need to hear where it says display flex we need to set the flex direction because it’s by default in a row so let’s go set the flex direction to b column and once we’ve done this we can go back and we can see that here’s our top one well the top one is actually pink but there’s nothing in it and there’s our.
Bottom one let’s go put something in that pink container so this is the pink container this div and i want to grab this connect button but i’m going to grab this as well or actually let’s just grab this let’s cut this out and let’s put it in here.
I can now see that this person is checking for this wallet so i’m going to take this out and remove that as well so we just have the minting button at the bottom i do however want to check if there is a connect but this time i’m going to check it differently how react works is.
Basically if we now save this we go to our app we can see that it says connect but we already connected and that’s why that wallet was there to check if this button is connected or not and then it disappears but i still want my connected button to be on the right i just wanted to say connected when we are connected so how you can do that.
Is we can take this out and put double curly braces meaning that we are going to well there’s single curly braces but meaning that we are going to execute some logic so what i want to do is i want to check for the wallet if there is a wallet connected it means that we are connected so i can then say.
Connected and if there is not that’s what this colon does we can say connect wallet now let me just change this to a capital as well and when i save this we can see that the text changes we are now connected so if we refresh we can see connect wallet if we click on it it’s.
Going to ask us to connect to phantom and it’s going to say connected this is a simple way of doing it let’s go move it all the way to the right of the screen now usually when we work with this much css we put it in a separate file for now i’m just going to do this quickly because i will have a course where i explain to you in detail how to.
Do beautiful css let’s just quickly go and align this so what we can do now because this is displaying flex we can kind of go and align this button all the way to the left so this main container is displaying flicks but now we can display this one as flicks as well so we can say display.
This as flex2 this time i’m going to align the items while justify because it’s now in a row so justify the content to the flex end over there when we do that we can see that now the button is here on the right i also want to give it some padding but i’m going to put the padding around the.
Whole screen so if we go back to our main div we can just say this needs a padding and we’re going to give it a padding of let’s say 13 pixels have to put it in quotation marks like this pixels or you can just specify 30. so if we go back now you can see that.
There’s our pink container which we can see again but it has now this display now this blue div i would really like it to kind of be to the bottom but the first thing is we need to stretch this pink container to the bottom in order to style it properly how we can do that is by giving this top style a height of a.
Hundred vh so 100 vh means vertical height when we do so we can have a look and see that the pink is now all the way to the bottom of the screen now this means that this pink section is now scrolling and that’s due to the padding so if you want to eliminate that.
Being the case then you should go back and change the padding instead of padding call it a margin i like using padding because it just feels much more natural to me than margin so i can either do that padding or margin or i can even put another container inside this container but anyway let’s.
Leave that up for the master css course for now we still need to kind of spread this blue all the way down as well so what we can do is we can basically because this is flex right we can give this bottom one a flex value so we can say we need to specify this as flex one when we do so we can see that it indeed.
Takes up all that space now this is pretty cool but i still have this issue where we have this block over here so let me go and resolve that while the scrolling scrolling bar so i’m going to take the padding out there i’m going to put another div over here.
We’re going to open the open the div and maybe end it right at the bottom so where it ends over here then i’m going to finish off the div there and inside this div this is where i’m going to specify my style this style is going to be a padding.
Not a path a padding of 30 so let’s just do that when we do this you can see that it’s now contained and we get this natural padding although we have this now now we can see that this doesn’t truly stretch to the bottom and why is that the reason why it.
Doesn’t stretch fully is because this is our main container now so what we’ll need to do is we’ll need to grab this flex property so it can be flex but also we need to flex itself to one so that it can take the full width of that screen so if we go back now we can see that it indeed does that but then we’re sitting.
With all this alignment issues again so the only thing that we need to do is go back and also make this column when we do that we can most probably take out the display flex over here and just leave it like so let’s just do this again let’s go back let’s not take out that one put the column.
And when we have this there we go so now we have a well-structured kind of uh layout right we have the top header it’s there in the left hand corner but let’s center this mint content this is in the blue container so if we go to the blue container over here it’s very simple.
We can also say that ni this needs to justify the content to center and also align the items to be centered when we go back to display our app nothing happens and the reason is we need to remember to put our display flex property so when we have the display flex we can now automatically see that it’s in the.
Center so if we click connect wallet phantom there we can see there’s all the data but this looks a bit ugly so let’s go ahead and now look for where that content lives and here it is and i want to put this in its own div the reason is.
If i just leave it like this it’s going to take it’s going to think it needs to put it all in one row which is not the case so i’m going to put this back over there just save it and then because we have this container as displaying flex as well i want to just say the flex direction so should be.
Column and once we have that we can go back we can see there’s all of our data again we can go one step further by rearranging some of this data for instance we probably want to know what the wallet is we are connected to but we don’t need to know the balance it would be nice to know the total of nfts.
And also the ones remaining so let’s go and restructure this so it makes a bit more sense i’m going to go back to visual studio and then the first thing i’m going to have a look at is removing or not removing this wallet but just copying that out removing the balance we don’t care what balance we.
Have because we do have the phantom wallet to check i’m going to go up to the top and then put in this wallet balance over here then because this is now the content is flex end i am going to change this to space between so space between this will create a space between this.
Wallet address and the actual connecting button because of the space between it’s going to put a space between these two elements making the connect button be on the right and this wallet address on the left we also can now go down and let’s just clean this up a bit i see that there’s the amount redeemed.
And the remaining now we probably don’t need the remaining and what we can do is maybe structure this a little bit better we can go ahead and maybe cut this out put it here and then put a forward slash between them this will be a kind of total available but let’s make.
It the supply like so once we have this we should now have something on the screen looking like this i think that is pretty cool right so what we have now is your wallet on the left this on the right and the mint straight in the center.
What we can lastly do is just remove all these colors so we can go to the pink remove that one remove the green and remove this blue lastly go ahead and put a div between the wallet and the connect button when you save you’ll see that your dap looks like this now where we can refresh and that your wallet connect button is on the right.
Hand side if we click connect you can see that phantom will pop up we can connect to phantom and there’s the supply 1 out of 10 as well as our wallet address this is no way near to being extravagant but at least it gives you an idea how you can play around with css and html basically.
And then get to something like this i will create a master course so let me know if you want to see a css master course on how to make something look really really good but this is the basics and i really hope you guys enjoyed my tutorial if you did please share the word like subscribe and leave a comment and.
Then till the next time i’ll see you in the next video cheers for now
In this video, I show you how to use the Metaplex tools and the Solana CLI to upload your generated NFT art collection to the Solana blockchain. Hope you enjoy the video.
The important links:
Set the environment:
solana config set –url https://api.devnet.solana.com
The important commands:
npx ts-node js/packages/cli/src/candy-machine-cli.ts upload ./assets –env devnet –keypair (PATH)
npx ts-node js/packages/cli/src/candy-machine-cli.ts create_candy_machine –env devnet –keypair (PATH)
npx ts-node js/packages/cli/src/candy-machine-cli.ts update_candy_machine –keypair (PATH) –price 1 –date “19 Oct 2021 00:00:00 EST”
Note: for the main net you want to replace all instances of “devnet” with “mainnet-beta”.
Also when you are done just run “yarn build” to build the app that you can host on a website.
Tweets by de_botha
Thank you for everyone’s support. See you in the next video.
If you want to buy one of the Nerdy Coder Clones, go here:
My wallet addresses just in case 😉
Ethereum or Polygon:
If you enjoyed the video, please leave a thumbs up and subscribe.
Please be aware that the developer will not be responsible or liable for all loss or damage whatsoever caused by you participating in any way in the experimental code, whether putting money into the contract or using the code for your own project.
We are not financial advisors. The content on this website and our YouTube videos are for educational purposes only and merely cite our own personal opinions. In order to make the best financial decision that suits your own needs, you must conduct your own research and seek the advice of a licensed financial advisor if necessary.
#hashlips #code #solidity
#Create #Solana #NFT #collection #Ultimate #guide #devnet