| | |

Getting Setup with PALM NFT Studio

Recently I learned about Palm NFT Studio (probably like most of you via an Infura newsletter). I was curious because my current mission with Broadreef/VizCache includes a lot of environmental stewardship and Cause based initiatives. Thus I liked what I was reading about Palm and decided to integrate it into VizCaché as it’s 4th supported chain for NFT’s.

The following article is an outline of the questions that popped-up during the integration process. It was actually pretty straight forward.

What is Palm?

Palm is an EVM compatible Ethereum side-chain that seems to have taken an ecologically responsible approach to NFT creation and economy.

read more here. https://docs.palm.io/

Getting Connected Via Metamask.

At the moment it looks like wallet support is almost exclusively Metamask. So the first step is to get your Metamask address/wallet connected to a Palm RPC to interact with the network.

So where do you find an endpoint? That is where Infura comes in. Infura natively including Palm in their API service, alongside Ethereum, and Polygon.

  • Side note you can setup and maintain a Palm Transaction Node and connect your RPC to that as well. More on setting up that up in this article. How to setup a Palm Transaction Node.

Getting the wallet setup is one of the most important step and luckily Palm have thought about this barrier. There is a nice streamlined onboarding workflow here https://app.palm.io/configure. This link will get you setup with Metamask and the DAI coin needed for transacting on Palm. In case you would like to do it manually I have included an outline of the process below.

  • Network Name: Palm
  • Network URL: https://palm-mainnet.infura.io/v3/3a961d6501e54add9a41aa53f15de99b
  • Chain ID: 11297108109
  • Currency Symbol: PALM
  • Block Explorer URL: https://explorer.palm.io/

Getting Some Palm Tokens

After working through the setup process we need to actually acquire some assets(tokens) to be able to do work on the network.

Palm offers three main methods to get assets and Palm into the network. Fiat on-ramp, Asset Bridge, and Faucet/Airdrop Requests.

I choose to request some tokens for the integration project and then bough some from the fiat on-ramp using Wyre.

Integrating Palm into my dApp

Now that we have a wallet connected, we will move over to the React dApp.

The main thing I had to adjust was

  1. Add the chainId and network details to applications database so I can link new smart contracts and asset with the CMS. This allows the dApp to recognize if the current contract/tokenId combo is connected to the correct provider network.
  2. The next this was to update the auxiliary provider switch to route the contract call requests to the correct RPC endpoint.
...        
} else if (chainId == 11297108109) {
   //Palm
   callProvider = new ethers.providers.JsonRpcProvider("https://palm-mainnet.infura.io/v3/<infuraId>");
} else {
...

The last and final step was to make sure Wallet Connect knew which RPC end-point to route the chainId 11297108109.

...
  rpc: {
        1: "https://speedy-nodes-nyc.moralis.io/<YourSpeedyId>/eth/mainnet",
        //3: "https://ropsten.mycustomnode.com",
        //100: "https://dai.poa.network",
        137: "https://speedy-nodes-nyc.moralis.io/<YourSpeedyId>/polygon/mainnet",
        11297108109:"https://palm-mainnet.infura.io/v3/<YourInfuraId>"
      },
...

Setting Up Truffle

Great! Now that we have the frontend able to read and write data to the Palm network, we focus on setting up the smart contract deployment. Palm is an EVM based chain, so if you have Ethereum/Polygon smart-contracts already written in Solidity you are pretty much ready to deploy.

The only two remaining requirements are

  • A wallet with PALM/DAI to pay the deployment costs
  • RPC connection (via Infura)

Luckily, we have already set that all up. Now we update our truffle-config.js and add Palm to the deployment targets.

Just make sure the mnemonic is for the address where you actually have your PALM.

Now you can deploy! Obviously test your contracts before going into production (I am not responsible for your actions). Each step in this article has a test-net option as well, so set up a test-net environment if you need to test anything beforehand.

truffle deploy --network palm

Thats it for this article, hopefully it helped get you started. This outline was pretty brief and high level. Specifically focused on getting my applications setup with Palm. As I learn more and test a bit with the network I will expand on this article. Palm does have some great straight forward/simple documentation on there doc’s site. I would recommend browsing there as you will probably get all your questions answered.

Ciao!

Pfay

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *