Everyone know that free NFT collections can create a hype on any network. Lately, this hype has been particularly noticeable in Layer 2 projects. Therefore, it is beneficial for developers to get involved in the Free NFT Hype in Celestia in advance.
In this guide, I will show you how to create a free NFT collection on Celestia using a simple mint contract. With the help of the NFT collection that I have previously deployed and created, you will be able to be part of this ecosystem as well.
Deploy your Celestia node light with my script.
https://github.com/crazywriter1/node_installation_tool
Setup Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\ sudo apt-get install -y nodejs
Setup Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
After installation, configure these resources.
source $HOME/.cargo/env
source $HOME/.cargo/bin
Install Foundry
curl -L https://foundry.paradigm.xyz | bash
cargo install --git https://github.com/foundry-rs/foundry --profile local --force foundry-cli anvil chisel
İt takes at least 30 minute. If you prefer to install it in a different way, I recommend you to go to the source.
https://book.getfoundry.sh/getting-started/installation#using-foundryup
After the installation is complete, configure the necessary settings.
echo $PATH
export PATH=$PATH:/root/.cargo/bin
Download ethermint
git clone https://github.com/celestiaorg/ethermint.git
Get in to ethermint
cd ethermint
İnstall ethermint
make install
And source root/.bashrc
As a precaution, move the necessary cargo files into the ethermint directory.
cargo init
source $HOME/.cargo/env
cargo install cargo-update
cargo install-update -a
Open a screen for Ethermint to run in the background.
Screen -S NFT
Make sure you are inside the ethermint directory. If you're not, navigate to it using the command cd ethermint
.
Let's deploy our ethermint by running the codes in order.
bash init.sh
NAMESPACE_ID=$(openssl rand -hex 8) DA_BLOCK_HEIGHT=$(curl https://rpc-blockspacerace.pops.one/block | jq -r '.result.block.header.height')
ethermintd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26659","timeout":60000000000,"gas_limit":6000000,"fee":6000}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT
Once you are certain that your node is running as shown in the output, press CTRL-A+D
to detach the screen and send it to the background.
If the forge folder is not properly installed with Foundry on your server, you can use the following commands.
npm install -g @arcblock/forge-cli
forge remappings
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
forge init nft
cd nft/lib/forge-std
npm run
in the forge
npm run build
in the forge
forge install Openzeppelin/openzeppelin-contracts
Before editing and compiling the contract of your NFT project, I recommend using the NFT generator at https://www.genfty.com/nft-generator
or using the IPFS of a collection you have prepared from another source.
https://app.pinata.cloud/gateway
https://www.infura.io/product/ipfs
Upload your remix data.
Please pay attention to the following steps, as you will use the entered data in your contract. Please make sure to remember what you enter.
Save your ipfs code!
The places to be modified in the content of the files t.sol
, s.sol
, and .sol
are marked with red boxes. Replace these boxes with your collection name and IPFS link .Also change your supply amount, mint price and you can run the Free minting function.
You can edit the files and transfer them to your server using MobaXterm
or WinSCP
or you can edit them directly on your server using the commands;
sudo nano Counter.sol
sudo nano Counter.t.sol
sudo nano Counter.s.sol
.sol
s.sol
t.sol
Now compile your contract with forge test -vv
Congratulations!! Mint machine operational
I recommend opening the following port codes:
sudo apt install ufw -y
sudo ufw allow ssh
sudo ufw allow https
sudo ufw allow http
sudo ufw allow 6180
sudo ufw allow 80
sudo ufw allow 9101
sudo ufw allow 181
sudo ufw allow 182
sudo ufw allow 9545
sudo ufw allow 4133
sudo ufw allow 3033
sudo ufw allow 8080
sudo ufw allow 9103
sudo ufw enable
You should especially enable the following port codes: 8080
, 80
, 9545
, 8585
, https
, and http
.
Open new screen screen -S anvil
Be sure you are in nft file cd nft
anvil --port 9545
Get one key and export it with export ANVIL_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
export RPC_URL=http://YOUR_IP:9545
forge script script/Bugs.s.sol:BugsScript --fork-url $RPC_URL --private-key $ANVIL_KEY --broadcast
Change Bugs
Congratulations Mint contract deployed.
Now Set some conf.
Export your contract
export CONTRACT_ADDRESS=0x0116686e2291dbd5e317f47fadbfb43b599786ef
forge script script/Bugs.s.sol:BugsScript --fork-url \ $RPC_URL --private-key $ANVIL_KEY --broadcast
Export your recipient
export RECIPIENT_ADDRESS=0xd6C5C3e5A9B7ca3c4661E9C20a8F03450842e039
You can try to mint
cast send --rpc-url=$RPC_URL $CONTRACT_ADDRESS "mintTo(address)" $RECIPIENT_ADDRESS --private-key=$ANVIL_KEY
Example
cast send --rpc-url=http://localhost:9545 0xbd4f42743becf5955e5adef700a8adcda99bda62 "mintTo(address)" 0xd6C5C3e5A9B7ca3c4661E9C20a8F03450842e039 --private-key=0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba
Get your priv keys
echo PRIVATE_KEY=$(ethermintd keys unsafe-export-eth-key mykey --keyring-backend test)
- After you get the private key, import the metamask and copy your wallet address. Then paste the code below.
export RECIPIENT_ADDRESS=<your wallet address>
example export RECIPIENT_ADDRESS=0X00ADFAF000000.....
Export your RPC
export RPC_URL=http://localhost:8545
Deploy your contract
forge script script/Bugs.s.sol:BugsScript \ --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast
After that write in the code export your contract adress.
export CONTRACT_ADDRESS=<new-contract-address>
Like this export CONTRACT_ADDRESS=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
You can mint your nfts with this code
cast send --rpc-url=$RPC_URL $CONTRACT_ADDRESS "mintTo(address)" $RECIPIENT_ADDRESS --private-key=$PRIVATE_KEY
You now have deployed an NFT collection on a rollup. Next, you need to connect this project to an interface and handle the necessary requests.
My NFT Contract Address: 0x5FbDB2315678afecb367f032d93F642f64180aa3
After installing celestia, ethermint and foundry, you can mint my nft. I will update after frontend is created.
You can watch how to set up Metamask network settings from the link below. You can add the private key you exported from Metamask's account details section by clicking on the circular button on Metamask. Soon, I will provide a simple guide on how to easily connect your contract to a domain(Frontend- User ınterface) and how to publish your NFT project and market it. The difficult part is over, and you are now very close to becoming an NFT project owner.
https://docs.celestia.org/assets/images/add-metamask-4422ec98f02b36d3faea64cb152be92c.gif
I have designed such an interface for Bugs NFTs. By modifying the colors, links, and specific sections of this interface, I will show how to deploy your own project with a domain address. Get ready to secure your spot among the NFT projects in Celestia.
I'm open to ideas about interfaces designs . If you encounter any problems or have a suggestion for the Website, please do not hesitate to contact me. https://twitter.com/mjolnirisback