Solana Development #2
Solana Dapp Scaffold
So now I want to try to see if I can run the Solana Dapp Scaffold app from their github. It looks like this is basically a hello world dapp that provides code for connecting a wallet and funding it (in dev/test mode) with a faucet.
So just following the quick start instructions on the github we can do the following:
➜ git clone https://github.com/solana-labs/dapp-scaffold.git
➜ cd dapp-scaffold
➜ yarn
➜ yarn start
Now, if I navigate to localhost:3000
I see this:
If you see this error when you first try running the app:
Unhandled Rejection (Error): Not a valid Mint
Closing out the error and switching the toggle in the top right to devnet seemed to fix it for me:
I've also seen people recommend changing this line of code (in accounts.tsx) as a fix:
// Before:
const account = deserialize(new PublicKey(address), obj);
// After:
var account; try { account = deserialize(new PublicKey(address), obj); } catch(e) { console.error(e); }
Connecting a Wallet
I'm going to click the toggle in the top right and set the network to 'devnet'. I have the phantom wallet chrome extension installed, so I'm going to sign into my wallet, and under settings (bottom right toggle in the wallet), switch the network to devnet. Then I'm going to connect it by clicking the connect wallet button in the dapp and selecting phantom.
Once that's connected, now if I click on the faucet button, and then click on "Give me SOL", it looks like everything is working!
Additionally I can now see the increase of "funds" reflected in my Phantom wallet:
Pretty cool!