NFTPort 🛠Launching your NFT app in minutes with NFTPort
ETHGlobal·Sun, Oct 9, 2022, 12:00 AM
Join Taivo Pungas of NFTPort for a workshop titled "Launching your NFT app in minutes with NFTPort." This workshop is part of HackFS 2022, a three-week long virtual hackathon focused on building a digital world that is censorship-resistant, decentralized, and trustless. For HackFS, ETHGlobal has partnered with Protocol Labs - the organization building Filecoin and IPFS - to run an event centered on dapps, web3, decentralized storage, and everything in between. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
[Applause] [Music] hi my name is taivo i'm vp product at nft port and i'm here to show you how you can get started and launch your nft application in hours instead of days or months using nfd parts simple rest apis for nfd data and of the minting and much more what does nfd port do we say we are striped for nfds and what we mean by that is that we create the infrastructure and apis for developers to build energy applications our goal is to make it as simple as possible and as fast as possible to build an nft application and we build all of the complicated infrastructure like indexers and smart contacts behind that so that you can focus on your application specifically if you look on our website you can see some of the the categories of apis that we use so for example you could turn anything into an nfd it could be an image which is quite common or a video or a piece of music audio some game asset for example a 3d object you could turn tickets into nfd's you could make entities out of books blog posts anything and that's just with a single api call if you want you can deploy your own contracts where you can meet 10 of these and create the collection within that contract and you don't have to learn how to write smart contracts you don't need to understand the details of where to store the files on ipfs we handle all that for you and again you can do all of this through a simple api call to your rest api you can also get nft data from different chains so if you want to understand for example what dynasties a user currently has so given a wallet figure out the list of nfts that they have we have an api for that or you want to understand what are all of the nfts within a collection and fetch their metadata their attributes the assets tied to the nft we also can give you all of that through a simple api call and we also provide safety and trust apis so you can integrate nfd search into your application with our search api you can do counterfeit detection so you can be sure that the nfd that you're showing to your user is actually the real one to get started go to nfdport.xyz click get free api key enter your email click sign up then fill in the form and click sign up once you do that you can go ahead and sign in you're in the nfc dashboard from here on head over to the api key section get your api key and head over to the documentation now that you are in the nfd word documentation you can see the main sections here we have tutorials for some of the most important things you can do with the api like getting entity data from multiple chains we have several tutorials for minting nfts yourself so you can create collections dynamic nfts use nfd port to create nfds inside roblox or unity and we also have a tutorial for enhanced apis then there is a full api reference for each of the three categories so it's divided into read apis where you can get data from different chains about nfds write the apis where you can upload files deploy contracts and build entities yourself and enhance the apis which contain search recommendation duplicate detection endpoints if you are building something with unity you might be interested in the united states section and we also have descriptions of the of the authentication error codes rate limits etc and support links in the sidebar here so let's jump into it for example let's start with data apis so let's pick contract and fetch all of the nfd inside that contract inside the interactive documentation i can actually try out the api calls myself on the live api so first to do that i need my api key and let me go and fetch that from the dashboard so in the dashboard let's fix api key copy and then paste it into this box now we need to pick a particular contract whose end of this we want to fetch and let's go and see what we find on the openc front page let's do the classic example of boarded yacht club so you can see this is right collection and let's copy the contract address that we have here pasting it into the box the chain the blockchain that the contract is on is ether and let's send the api request now you can see in the response here that we get back a list of all tokens within that contact and right now this doesn't really contain much interesting data right we only have the chain contract adders and token ids going from zero to ten thousand which is the maximum number maximum token id of poor datebot club but we can include additional data so if i pick include metadata then i get much more interesting information so you can see that for the token id 0 we can see what attributes this nft has we can see the original limit in each url we can get the metadata file url everything that is in the token on chain or in the metadata you can actually fetch from this api response and what's quite interesting is that you can get the cached file url so what typically happens when you try to fetch the asset for an nft like the image behind the nft you get quite the slow response from ipfs so if you pick the file url which comes from ipfs then you can see it takes quite a while to load might take 5 seconds 10 seconds up to a minute or a few in in the worst cases or sometimes it might actually be gone from ibfs which means you can't even fetch it so an alternative is to use the cash flow url what's happening in the background is that nfd port goes and fetches all of the mft assets for you so we pull in the images and we serve them for you so you can quickly get them and serve them to your users so you can see this is a google url and it loaded almost instantly and you can use this in your front end when you want to show something to your users and it will load extremely quickly that's how the cached image url is useful and you can see in addition to the token id 0 we have the next token id09 all of the same information we have the attributes we have the image which is the original image url we have the cached image url which we provide so you can get the contract nfds with a single api call if you only want to retrieve one particular nfd for example if you look at the 5162 which is the one that we opened so again the contract address is the board and it's pretend here as well and the token idea was 5162 we can fetch the details for that particular nft and we don't have to pull in all of the data for the whole contract so if you're only interested in a particular nft for example if you want to build a view in your application that shows the user details of their particular nfd or one particular nft then you can use this endpoint to do that again you can see that you can get all the attributes the image file information again the cache file url which you can use to display to your user so that it loads really quickly and you can also get the contact information from the same api call if that's something that you need now another thing you might want to do is get transactions for an mft or for contract and you can do both those with the ports apis so imagine you want to see the latest transactions that have happened with nfd simulator what you can see on marketplaces under item activity so let's find a different nfd let's pick goblin town again let's copy the contract address and let's see let's get the most recent transactions by contract again conjugators goes here the chain is ether and let's get transfers so transfer type transactions and here we can see the most recent transfer transactions that have happened so when the mfd was transferred from one wallet to another and you can see that the most recent one was transferred from this wallet address to this address the goblin town contract address that we saw token id was 7927 so let's actually go and see that 7.27 and this was the nfl that was transferred so as of this video being recorded it happened less than an hour ago so you can get very fresh transactions that have happened by chain using this endpoint or if you care about one particular nfd and the transactions that that have happened with that then you can get those as well so for the same contract the goblin town contract token id 7927 let's get transfers and we can see we have the same transaction here now nfts are all about digital ownership we might want to fetch nfds based on the owner rather than the contract or the nfd itself this wallet that the goblin town entity was transferred to let's see what other transactions have happened on that account so i copied the address of that wallet and let's see what other transactions have happened on that wallet and here again we can see this is the goblet town one that we saw but there are others that have happened as well so on a different contract they have received something so you can see the xerox 6fp they again they will transfer it some nfc and we can go ahead and check it out so apparently they received the moon bird at some point query msds and nfd data are based on a wallet is actually quite important because when you build an experience for a particular user that connects their wallet to your app or your d app then you will have to fetch personalized information for them so mfds that they own or if these that they have transacted with like we did now so you can do this under the ownership tab if you look at the retrieve entities created by an account and retrieve energy owned by an account there are two views into that the difference between those is and if you owned by an account shows you the list of nfds that the account currently owns and then of these created by an account shows you a list of nfds that were originally minted to that user so the first ever owner was this particular wallet letters let's continue with the same account address that we had from before and let's see what nfd is down so you can see that in the response here we have a list of all entities that this wallet owns there is one zookeeper it's nft we can of course get the cache file url for that nft so let's check that out we can also get metadata attributes all of the details that we previously got from the other endpoint as well let's see what else this user has when we go through all of the items in that user's wallet we can get all of the data that we would need to show a wallet page for that user you could build something that is quite similar to your profile page or nfd zone page for example if you look at chris dixon's page you could get their wallet address fetch all of the mfds that they own and reproduce the same view by rendering all the data all of the cached images all of the contract names attributes everything you can get with a single api call and that makes it very very fast to build a personalized experience for the user who connects their wallet to your app one interesting thing you might want to do is check whether a user owns an nfd in a particular collection so for example we want to check which nfd's acoustics and owns inside of wardape yacht club so again let's take the board ape contract address and see which board apes 36 announced okay there aren't any let's find a collection in which he doesn't own something he knows at least this curio card and here we can see a list of all the entities that they own in that collection and based on this you might want to build some sort of token gating so if the user has aborted yacht club mft then you might want to enable some sort of additional permission for the tutor and you might want to personalize the experience for the user and that is very powerful because the user will immediately feel at home because you can automatically personalize the experience for them based on what is inside their wallet now you're able to fetch mfd data from blockchains but how about writing on your blockchains how can we create nfts we have apis for that as well the absolute easiest way to get started is with easy knitting which is appropriately named so easy mythic with url essentially what you can do here is given a url which contains an image or some sort of file you could turn that into an nfd with just one api call here i have this freely licensed image which i will now turn into nfd again the interactive api call box we can set the relevant parameters so the url that i copied i will paste here the name of the nfc let's call it example bird you also need to set the meteor address so which wallet are we actually going to meet you you can find your wallet address on whatever wallet you're using or if you want to drop it to someone else you can get their address so i'm getting my address and let's meet this nfd to me and the response gives us all the information we need to actually find the nfd on chain so one thing you might want to check is see what the transaction looks like on chain so let me copy the polygon scan url here and here we can see the transaction hash the contract which the nft belongs to and who the token was transferred to so we were able to verify that the nfd was actually created on the polygon chain it shows up on polygon scan easy meeting is very easy but the downside is it trades your nft into a shared contract so you can see that the the contract that we created the end of the into was nftpart.exe v2 and the token id 5g57 so if we look at the contract we can see that there is a bunch of nfd's which are not related to our project which have also been moved into the same collection as a developer when you actually start getting serious with nfts you probably want to have your own collection you want to deploy your own contract and have your entities in that contract as opposed to having them in a shared contract like we did with the easement thing and we also have it covered there if you go to our documentation and go to product contracts deploy contracts for nfd products then you can deploy a contract with a single api call and start melting nft into that contract programmatically like we did with easy meeting but in this case it is your contact you own the contract you control it and you can customize it much more than you would be able to with easy meeting here's how deploying your own contract for your nft product can be more powerful than using a shared contract if you look at the options you can configure in the api call of course you can set the collection name symbol the owner address which will be yourself you can choose between erc 7g 1 and 11 55 contracts these are two different nfd standards you can choose whether to freeze the metadata so that it cannot be updated later the contract does not allow it that you can set royalties and you can granularly set the roles for different developed addresses so that you can have different wallets who are able to do different things in the contract so let's deploy our own contract and as before we can do it from the interactive api call box here you can set chain we'll use polygon right now you can set the contract name let's name this hot dogs we can set the symbol for the owner address i will use my own address so that i have the permissions for everything later let's keep metadata updatable at first we can always set this to false in the future so we can freeze the metadata later but we cannot unfreeze it so let's keep it true and let's ignore the roles for now so let's deploy a simple erc71 standard contract that is called hotdogs and in the response you can see we didn't actually yet get back the contract address this is because it takes from a few seconds up to a few minutes for the transaction to actually be confirmed on the blockchain what we do get back is a transaction hash and we actually have two options we can use this transaction hash to page the contract address using a different api which you have called to retrieve a deployed contract where we can put in the transaction hash send the api request and then we have back the contract an alternative would be to take this transaction hash and open polygon scan and here you can see the contract address that has been created if you go to your dashboard you can see the list of contracts that you have deployed and as before here i can see the name hotdogs on the plug-in chain er601 contract here's the address here's the transaction hash here's the transaction url in the polygon scan external explorer every time you deploy a contract it will show up on this list now that we have our contract we want to mint the nfds into the contract and we can do that with entity part apis but first it's important to understand what an nft consists of typically an nfd is a record on the blockchain and the nfd itself is very minimal it does not contain much data because it's expensive to store data on the blockchain instead the lsd contains a reference essentially a link to a metadata json file which is stored off chain and the metadata contains a reference to an asset that is stored of chain as well so for example if you have a board nfd or a moon bird nfd then the lsd itself the only chain record refers to a json file which is typically stored on ipfs and the metadata json file refers to an image typically psg or jpeg that they store it also on ipfs what you mean the nfd we need to go through these steps in the reverse order we each first upload the asset to enjoy bfs then we need to create metadata.json file which refers to the method and then finally once we've uploaded the metadata json file we can meet the nft and of course enable port has apis for all of these things if you go to your documentation under meeting contacts and storage in the storage section you can upload the file to ipfs let's do that and i will use again the interactive api explorer here to upload an image of the same bird that i had before and the api request and it is now stored on ipfs the file was stored on ipfs and nfc port pins it for you as well so it is permanently stored which is pretty important for nfts so that the asset behind the nft does not get lost and if you open the ipfs url we can see that it actually did work so it did not store it on ipfs we can also see on our dashboard that we uploaded this file the next step is to upload the metadata that refers to this file on ipfs for this we can use the uploadmidlay.
gibfs endpoint let's call this birdingcustomcontract and paste in the url that we got from the previous step once i upload this bit i hate to copy the url and the metadata has been created so the json file now is also uploaded to ipfs it's stored in ipfs and i can check on the dashboard that the metadata has been uploaded and now for the last step we have the asset we have the metadata now we need to create the lfd and this is also very easy so let's go to product meeting customizable meeting and in the interactive box here i can make an api call to mint and nfd into that contract which i had previously deployed so let me find the contract address here this is the contract address the metadata uri here this metadata and i will meet it again to my personal address so the transaction has been created as before with the contract it might take a few seconds for the blockchain to accept the transaction and then it will be visible on the blockchain explorer let's open it and we can see that the milt of hot dogs has been minted to my address the token id was randomly chosen if you want to have a specific token id you can also set manually the token id in the customizable maintenance contract you can see in the request you can set token id so energies don't just have to be images they can be anything you can put any file into nft and actually you don't have to put any file into an fd the metadata and the asset are completely optional in nfd you could also create an nft which does not have any metadata or any asset but that's less useful so to have some utility you want to store some data together with the nfts that's why typically these this qr added let's check out the nfd that we just created coming back to the dashboard under nfts you will see a list of all entities that you have mated and this first one is the msd that we minted into the common entity part contract with easy meeting the second one here is the hot dogs contract nft that we meeted to find the nsd on the marketplace or anywhere really you need to know two things you need to know the contract address and the token id so the contract address is this one the hotdogs contract address we can put it into openc to see whether they have already indexed it and it seems that they do the nfd that we minted shows up here this is the token id this the contract address and we can see that the image is here the same image that we uploaded just few minutes ago to ipfs this is the description and the name of the nft everything i've shown you so far we have done through the interactive documentation and this is really useful if you want to test out a few things before you start implementing them but once you actually want to integrate something into your application you can very easily get some example code from the documentation so for example if you go to retrieve nft details then this is the directive box that we used and if you want to you can get sample code for python for example here and assuming you have put in the api key like i have in the box the sample also will contain the api the correct api key so you will be able to just run this code and it should work you can get sample code for many different languages including curl so if you want to just run something quickly from the quant line or javascript node python go many languages if you want to understand the full power of any endpoint then also go through the requested response sections of the endpoint descriptions under the request section you can see all the possible inputs you can configure so for read endpoints that's typically quite narrow but for writing for example for deploying a collection contract a different kind of contract that we didn't cover in this video so far you can set many different things max supply minty price tokens for mint white listing public versus private meeting and much more and also in the documentation under the response section you can see what is the response that we will return to you you can also see the error model here which helps you build your error handling logic to make your application more robust and we also have a list of error codes for you so if you want to know what are all of the different kinds of errors that you can receive from the nft port api this has a list and this is quite handy for debugging if you get the error from the nfd port api you can quickly see here what actually happened what went wrong another way to debug is to look at the api log in the dashboard so i can see here all the requests that i made and what the response was and the error message as well which will help me understand what has gone wrong and fix the issue so these are the basic things that you can do with nfd port i recommend that you also take a look at the community page on our website this will give you some inspiration in terms of what other people have been building with energy point the apis that we offer are like building blocks and we're excited to see what you come up with so if you go through the community page you might start getting ideas for how to integrate nfts into your own application another thing you might want to do is join our discord community if you go up to nfdport.xyz contact you can find the link to join our discord here we have discussions ranging from the specifics of nft words apis and sometimes debugging together getting support from the community or from the team all the way to discussing general trends in nfts what people are building and you know just connecting with like-minded people in the end of this phase who are building something if something is going wrong you can also reach out to us at info nfdport.xyz or email that's it i hope you're now in a good position to release your nft application and get your ideas built as quickly as possible we love hearing from builders so please don't hesitate to get in touch and if there's something that we can add to the nft port apis dashboard documentation anything at all that we can support you with when you are building your nfd app please let us know thank you
Automatic transcript — names and jargon may be misspelled.