We wont be doing that in this tutorial. Be sure to pass the program ID obtained from the previous steps by using the program flag linking to the json file containing the account that owns the program. In case you slept through all of 2021, NFTs (non-fungible tokens) are hot. To do this, you need to get the keypair from the ./target/deploy/chainlink_solana_demo-keypair.json file that Anchor generated using the following command: The next step is to edit the lib.rs file and replace the keypair in the declare_id! Head of Product at Pinata. This command requests SOL tokens into your newly generated account: The end result is that you have successfully deployed the hello world program to devnet with an assigned program Id. To do so, just click the Mint button: Youll need to confirm the transaction. This is a static value that doesnt need to be modified, account address. This is the effect that having a verifiable sequence of events over time has on the consensus mechanism; it allows the processing to be broken up into multiple parallel processes. We know those images need to be named in a specific way. Solana is a high-performance blockchain capable of thousands of transactions per second and sub-second block times. This displays information about the transaction, including the printed output from the on-chain program. This client is written in Typescript using the, file, which performs a number of tasks in a specific order, most of which are contained within the, The client then calls the checkProgram function, which loads the keypair of the deployed program from. We will need to call this twice, because the Devnet faucet is limited to 2 SOL, and we need approximately 4 SOL.. Builder. The way this demo works is an off-chain client passes in an account to the on-chain program, the on-chain program then obtains the latest price for the specified price feed, and stores the value in the passed in account. The end result is that you have successfully deployed the hello world program to devnet with an assigned program Id. https://github.com/smartcontractkit/solana-starter-kit. Essentially this means PoH is like a cryptographic clock that helps the network agree on time and ordering of events without having to wait to hear from other nodes. Your NFT drop is ready for minting! Note: If you provided a Dedicated Gateway URL in the config, your NFT asset will not only load quicker but will be cached so that all subsequent loads are instant. So, assuming you have the art created, well walk through how to prep this for upload to IPFS through Metaplex. If you want to confirm things, you can find the .cache folder in your nft-project directory. The cloud wasnt built for this. Finally, the program reads the price data from the priceFeed account that was passed into the program, and then outputs the value to the console. And we know that we need JSON metadata files. They can also use one of the existing SDKs, which allow clients to talk to the blockchain and Solana programs. The client then calls the checkProgram function, which loads the keypair of the deployed program from ./dist/program/helloworld-keypair.json and uses the public key for the keypair to fetch the program account. In addition to this, it uses borsh for serializing and deserializing parameters being passed to and from the deployed program. Once the on-chain program execution has completed, it simply reads the price data from the account that was passed into the program.. This can be taken from the Chainlink Solana Feeds page, and the value will be defaulted to the devnet SOL/USD feed address if you dont specify a value. So, from your command line, lets change to our home directory and into the metaplex project, directly into the sample React app: Youll need to install the dependencies like this: Then, open the project in your code editor. Finally, the client queries the accounts data to retrieve the current number of times the account has had the sayHello transaction called, by calling reportGreetings. You should see output showing your program successfully being executed, and it should display the number of times the account has been greeted. ")[0].json}`, JSON.stringify(metadata)), ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts --version, solana-keygen new --outfile ~/.config/solana/devnet.json, solana config set --keypair ~/.config/solana/devnet.json, solana config set --url https://api.devnet.solana.com. Next, the program declares a `chainlink_solana_demo`. Metaplex is a tool that makes launching an NFT project on Solana much easier. for your account. This is the test network for Solana developers writing and testing smart contracts. to be used for obtaining price data, which contains the `execute` function. How are we now going to get those JSON files created and added to the assets folder. When the process is done, youll need to do one more thing. Again. Hopefully, it can lead to more creative projects. Ok, so we know we have images in the folder. In this case, it simply prints a message, then selects the accounts by looping through accounts. This is required to interact with deployed programs (smart contracts) on the Solana devnet cluster. Then, enter a configuration like this: This may feel like a lot, but this is actually just the minimum configuration required. This is required and it allows you to include an array of files for your NFTs. The client then builds up and sends a hello transaction to the program by calling the sayHello function. The `execute` function is the part of the program that contains the main logic for the smart contract. In addition to this, it uses. Now, we need to make sure the Solana CLI is working. Next, the program checks to see if the account has permission to modify the data for the specified account. for storing keys, and should only be used for demo purposes.

The client is a JavaScript script that takes two parameters, a deployed program ID, and a Price Feed account address. on the Solana Devnet, offering developers highly decentralized, high-quality, price reference data updates for building. "goLiveDate": "01 Jan 2022 00:00:00 GMT". can record the passage of time by observing rising water levels, Proof of Historys sequential outputs of constant hashed blockchain state give a verifiable order of events over time. Now, lets make sure the install worked. This is the most important part of the entire drop, so you should read about it in full here. Remember when we airdropped ourselves some devnet SOL? Solana has integrated Chainlink Price Feeds on the Solana Devnet, offering developers highly decentralized, high-quality, high-speed price reference data updates for building hybrid smart contracts.. So, your company is ready for change but your POC is stalled? Solana offers a different smart contract model to traditional EVM-based blockchains.

is growing at an accelerating rate. The first change is to set the storage property to point to pinata. This is required to interact with deployed programs (smart contracts) on the Solana devnet. We only need the JWT, so copy that and paste it into the pinataJwt configuration file propertys value. Metaplex, a project built to make creating NFT projects on Solana easier is has IPFS support baked in, and this includes the ability to use Pinata to store content and serve that content through a dedicated IPFS gateway. First, the client establishes a connection with the cluster using Anchor and sets up some required parameters, such as pulling in command line arguments and setting of default values: After this, the main function of the client is defined. You will need some lamports (fractions of SOL tokens) to deploy your smart contract. This client is written in Typescript using the Solana web3.js SDK and the Solana RPC API. Depending on how many files you are uploading this process could take a long time. Once youve signed up for an account, you really just need to make sure you have the following installed (each is linked to the installed instructions of you need to install them): For what its worth, we will be following much of the instructions on Metaplexs website with some modifications that allow us to upload content to IPFS through Pinata. This is the test network for Solana developers writing and testing smart contracts.

If not, double check that you have installed the Solana CLI Toolkit. to obtain some SOL tokens. Solana offers a different smart contract model to traditional EVM-based blockchains. You will need some lamports (fractions of SOL tokens) to deploy your smart contract. This helps you know if everything is ready to go and if your NFTs can be minted. To interact with the deployed program, the hello-world repository contains a simple client.

So crack your favorite cold beverage and sit back and relax. The starter kit uses the. In addition to this, a struct is defined for storing price feed answers into the passed in account, as well as a `fmt` function for formatting the price data retrieved. With that as our background, lets take a look at how to create an NFT collection on Solana using Pinata and IPFS. You can see this in the example below using Phantom Wallet. However, in our example there will only be one account. Registration for SmartCon 2022 is now open. Ownership of NFTs can transfer in both the token sense and the media sense. have the potential to empower DeFi protocol infrastructure that can compete with traditional financial systems in terms of trade execution and risk management quality. With increased creativity and expanding support across multiple blockchains, NFTs dont look to be going away any time soon. "pinataGateway": "YOUR PINATA GATEWAY URL", ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload \, ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts verify_upload \, cd ~/metaplex/js/packages/candy-machine-ui, REACT_APP_CANDY_MACHINE_ID=YOUR CANDY MACHINE ID, REACT_APP_SOLANA_RPC_HOST=https://api.devnet.solana.com, I previously wrote about creating NFTs on the Flow blockchain, https://github.com/metaplex-foundation/metaplex.git, You can read more about scoped API keys here. If you did not upgrade and do not have a Dedicated Gateway, you should update that property to look like this: Finally, you just need to set the number of items in your NFT collection for the number property and the price in SOL for the price property. and uses the public key for the keypair to fetch the program account. To discuss an integration, reach out to an expert.. But, while recommended its not required. The program.candyMachine property will have an ID that you can look up on the Solana devnet explorer here. To interact with the deployed program, the Chainlink Solana Demo repository contains a client written in JavaScript using the Anchor framework and the Solana web3 API. Run this command to get the version number: If that works, youre good to go. While Ethereum might be the first blockchain one thinks of when talking about NFTs, there are plenty of other chains out there to consider. It also declares the program ID. Once this is done, you can start the client.. Before you can run the client to read data from your deployed program, you need to install the client dependencies. So, we need to install dependencies for that CLI code. Solana is an emerging high-performance, permissionless blockchain that offers fast, cheap, and scalable transactions and supports smart contracts being built with the Rust, C++, and C programming languages. This command requests SOL tokens for your newly generated account. Hopefully, this tutorial helps change that. You can test with a free account, but for a mainnet NFT launch, you may want to consider the paid plan with a Dedicated IPFS Gateway. If the program does exist, it will create a new account with the program assigned as its owner to store the program state, which in this case is the number of times the program has been executed. Once deployed, smart contracts can be interacted with by external, . The accounts that interact with the programs store data related to program interaction. If you created a Dedicated Gateway, you can paste in your Dedicated Gateways URL in the pinataGateway section of the config file. Lets took a look at a basic JSON metadata file structure for NFTs on Solana: Just like with the Ethereum metadata standard, the Solana metadata standard has a name, image, and description. In a normal scenario it would take one or more people a certain amount of time to complete the puzzle. Again, this is an insecure method for storing keys, and should only be used for demo purposes. We will be following the standard Metaplex Candy Machine guide found here. When combined with Solanas ability to support up to 65,000 transactions per second and its extremely low transaction fees. This can then be checked on the Solana Devnet explorer. Time to jump into using Metaplex to get ourselves going with Solana. Next, the program declares a `chainlink_solana_demo` module to be used for obtaining price data, which contains the `execute` function. Once your images are in the folder, you will need to create the metadata for these images. Run this command to create your new devnet wallet and store the keys: Now, we can set the default keypair for our Solana CLI interactions: Finally, lets let the CLI know that we intent to interact with the devnet: To confirm this all worked as expected, we can fetch the configuration for Solana like this: This should print out the configuration information. This is required to interact with deployed programs (smart contracts) on the Solana devnet. The `execute` function is the part of the program that contains the main logic for the smart contract. Once you have successfully deployed the program, the terminal output will specify the program ID of the program, it should match the value you inserted into the lib.rs file and the Anchor.toml file. Weve finished all the prep work. This can then be checked on the, To interact with the deployed program, the hello-world repository contains a, . Much like how an ancient water clock can record the passage of time by observing rising water levels, Proof of Historys sequential outputs of constant hashed blockchain state give a verifiable order of events over time. Youll see a .env file in that folder. The two that load almost instantly are loaded through a Dedicated Gateway. From the command line run: Once this is complete, you should have SOL in your browser-based wallet and can now mint one of your new NFTs.