Ape into Web3 - Create your Own NFT with the power of Python with Christopher Cao
Ethereum Denver·Mon, Oct 9, 2023, 12:00 AM
In this workshop we'll go over how to install ape, a Python-based framework for smart contract development, and use it to create a deploy a new NFT project using our template and your own custom imagery. We'll finish the workshop by finding the listing on OpenSea's testnet!
Transcript
hi uh my name is Chris I work at ape works and I'm here to teach you how to ape into web3 creating your own nft with the power of python and Viper okay so with the intention and goal of this Workshop is to really teach you how to build your non-fungible token with the eight framework Python and our modular plugin system so I want you to come in with the idea the intention that you're going to try and learn from this Workshop whether you're a beginner or Advanced I think you could take away something from this but if you don't come challenge me and I would love to learn something from you or give you an idea of what you can go through so we're going to go a little bit about the overview we're going to talk about talk a little bit about me what is an nft uh what is ape how can you learn through the academy that we provide um build the nft personalize it because you want to make it specifically yours Uniquely Yours and then deploy it and then from there what else can you do okay so a little bit about me my name is Chris I work at eight works I'm a half engineer and half dancer um and I am commonly known as the agent of chaos because everywhere I go something goes wrong um and I kind of just roll with the punches and I kind of laugh at it because it's probably my favorite part is just figuring out what to do with what we got so I'm based in Los Angeles I ask a lot of dumb questions to my team and I kind of turn those dumb questions into tutorials so if you have any questions for me I would love to figure it out um and also my style of dance is hip-hop and house because I really like footwork and a little note um all of the pictures that I have there there are stories behind it so if you have questions afterwards and you want to ask me about them I'm happy to tell you about it okay so what is an nft an nft is a non-fungible token each token is unique within the collection and each token can have a specific metadata which can link to You Know audio pictures or video and that's what makes it like Uniquely Yours um if you and the metadata can be linked or hosted on a centralized service decentralized service or self-hosting today we're going to choose to do decentralized servicing just because they are really good powerful Partners out there that we would love to Showcase um the picture that you see here is uh Milady nft and it's one of the more popular ones because it's a lot of fun to make something that you really enjoy and all of the non-fungible tokens are powered through a standardization called eips and this one is specifically called 721 non-standard non-uh nfts so let's uh build the nft we're going to talk about the project hierarchy which is ape and we're going to go through ape Academy which hosts it all and personalize it check out the metadata ipfs hosting and compile and deploy so if we were to step through it go to hate friendly so the first thing that we're going to talk about is trying to get started uh the first thing let's pull up the so this is actually the website that we are hosting where you can get all of our tutorial information from and the first thing that you want to do with uh ape is you know install it because it is a terminal based uh program so if we were to go to Ubuntu and try to run through it you can see that we're going to create a new environment if you don't know what a virtual environment is you can kind of Link yourself here and we'll walk you through it all and pip install is our um a system and then once you have it working you kind of type in ape ape to make sure that it runs you can see all the commands and once the commands work we can try and run through so we're going to go activate and if you run ape this is our program and you can see that it has a bunch of really cool commands that you can run through and this is how we're going to build our whole project okay so the project that we're going to try and build is with uh here so let's say we go into ape Academy and we're going to build this erc21 contract uh so right now the internet doesn't work so I've already built it just for the showcasing and what you do is basically do ape template GitHub link right here and you kind of just press enter and it works um and so we're going to go straight into what we looked at so right here code Denver we're gonna pull out vs code and the and this is the contract you're going to build the contract and the whole project itself as you can see there are specific project folders called contracts okay good all right well that's big enough I guess okay uh so there are a couple contract folders so contract folder a script folder and a test folder and that's what's important with our project because in here current slide uh right here so our contract folder is where you keep all of your smart contracts whether it's solidity or Viper it's a plug-in modular system so all you have to do is install the compiler and it will run with whatever uh smart contract you have you can even have both actually because the compiler will just pick which one to run through the test folder is where you place all your chests whether it's integration testing or method testing you can put it all here and it basically will run through the script of tests and with the project that you just built I already have implemented tests in there for you to run through and then the script is where you have management actions and I'll go in through all that but the deployment script is probably the most popular one that we have there so contracts this is where you're building your contract folders here and if we were to look it is this guy right here and you can see that this nft contract has all of the standard methods that you need that you would find in your standard eip721 so if you were to build it you can ask it to personalize it the next thing that we could talk about is the management action scripts like for the deployment it's where you can deploy your contract on chain and that is this guy right here so and right now we're going to deploy it on a local test node because it is you can run without the internet and you can run actions against it to make sure that it runs as intended and then the last is our testing folder is where you can write your contract test or your data ingestion test like for example if you will have a white list of uh wallets or accounts that you want to give your tokens to you can run to make sure that it runs as intended so you know say like mint the token as a as the owner meant the token as a non-owner and make sure it denies as intended so and the link here is for proper testing techniques based in Python so if you want to learn more about it I have a link here and at the end of this slide or presentation I will have a QR link to uh have you guys be able to view it on your own time so we're going to run through getting started account creation and nft contract building so this is your contract you uh built it with a template and we want to make sure that it runs so we're going to do ape compile right here and this will compile the contract and then we're going to do eight test to make sure that it runs the tests that I have in here actually you can't see that right now so let me pull that back okay excellent okay so this is where we just ran we're gonna do uh ape compile and eight test compile any test and this is running with power of python testing suite and that's what you can see excellent so everything runs as intended and you're ready to deploy the contract okay so we're going to try and deploy and the way we the easiest way to do is with a console which is an IPython wrapper and it comes with a lot of your web3 tooling there so we do eight console and now we're going to load in a test account which comes with ape and then we're going to contract deploy project dot your name of your contract which is nft and the contract is deployed right here so it's on a local test node so you can play with it and break it down and build it up as you need and if we were to try and mint it we could just go contract dot mint to yourself to make sure it works and it works just like that and you can really pick any address you want if you're going to choose to run it to give to your friends I would choose the network you want um for example the most common use case is with borley but as we all know Gorly is gas fees are astronomical so I would highly recommend using our um plug-in system and one of the best ones to use right now is uh polygon they have a very they have a fantastic test net system and with polygon they have a Mumbai test net which is viewable on open scene and so today I've actually ran through and built and deployed that project last night to have that project right uh right here so this contract is deployed and it has it's on the Mumbai test net and within after 24 hours of it being deployed you'll be able to see it on openc so at the end of this I would love to come talk to you and mint this nft to you guys for showing them so because I appreciate you guys being here episode current slide okay so now that we have deployed the contract we're gonna just you know run through to make sure that we've done everything as intended so we've created a virtual environment pip installed account creation is where the gas money that you have comes from uh and you can get through get it through a lot of good faucets uh Corley has a faucet Sepulveda has a faucet and there are a bunch of other out there that you could get through and we have built the token and that's part one of our project and then we've now we need to um personalize your metadata if as you can see this is uh the description of the nft that we just deployed and for here it's just a description of what it is the animal which is an ape so that's what we are and at the end of it there is a picture called ipfs and I'm going to explain that a little bit so metadata is the data that provides information about other data it describes the nft's essential properties including its name description and anything else that the Creator feels important and what I felt important here was that the image to Showcase that you guys proof of that you guys are here and all of the information that you really should find that's really relevant to my workshop okay and in many cases metadata contains oh image I've just I've just talked about that so this would be part two of our um of our tutorial and if you're looking to make generative nfts which are entities that grow um the way that you're looking for for example you want to you know build a trading card one and every time you use it it levels up that you can make nft sets and this link will help you provide the data that you need and view it in a really nice way so we're going to okay it's going to build ipfs is this guy here and that's where we're hosting our information it is a distributed system for storing and accessing files websites and applications and that architecture or that technology is hosted on pinata and that's what I've used today to host our metadata um I'm going to check to see if it's actually there if I can actually view it because right now I'm not connected to the internet but we will see yeah so this is the metadata that we're hosting the thank you Workshop image is right here and the metadata that we're hosting is with this hash so this hash is actually going to be right in your project Workshop in your project not Workshop but right here and if you look at ipfs it's going to be right here so this is where you set your base URI with the workshop metadata and the test to test against it is right here and this is all personalized with your eight template and so that's what we just built current slide so now that we understand that where the metadata is hosted and how you can build it let's go through the checklist so your account has Gorly Ethan that's how you deploy uh you built the project via a template your contractor compiles your contract tests runs and they're passing the metadata is created and hosted on pinata and now you've deployed the project and the last thing you need to do to see the image on openc is to verify your contract on etherscan or poly scan whether depending on which network you have and so we have deployed it on poly poly scan so let's see and that's what I was showing you earlier today and you get the contract name and you view it and you search it here and you're able to deploy it and you verify the contract and this is essentially what you're looking for and uh I believe that is the last of what you need to see here and so that's essentially how to build your your very first nft uh using through the power of ape um and that is all of the information um so if you're looking to get started about what apworks is come join us on our Discord this is the link to our our area of uh of information and the last thing we're talking about is brownie campaigns so if you are a python user and you're working in the web 3 space you definitely know what a brownie is um as of today we have successfully ported uh all of the Brownie implementations and we're going to continue development on top of that for them we have uh really a really uh strong modular plug-in system with polygon with Alchemy we have all these great things on there and that's what's like our strength so if you're looking a way to Port your brownie products into ape um this is the link to to look more into it but if you have questions on trying to do it yourself I'm more than happy to help you guys out with it I have office hours virtually online through our Discord on Mondays or if you just want to do it uh set some time uh over on my calendar I'm happy to talk to you but this is the end of my presentation thank you guys so much for listening if you have any questions come talk to me thank you
Automatic transcript — names and jargon may be misspelled.