Module 2 - Check wallet balance & do simple transfer
Install Cast
Section titled “Install Cast”https://book.getfoundry.sh/getting-started/installation
Compare wallet balance on Geth and Solana
Section titled “Compare wallet balance on Geth and Solana”Check balance on OP Geth
cast balance 0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2 -r http://localhost:8545
Check balance on Solana using Light Client
cast balance 0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2 -r http://localhost:9090
These balances should be the same.
Do Simple Transfer
Section titled “Do Simple Transfer”Execute simple balance transfers and then compare L2 state again
Send 2 wei from one of your wallets e.g. 0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2 to another wallet e.g. 0xa3349dE31ECd7fd9413e1256b6472a68c920D186.
npm install ethers
node -e "const { ethers } = require('ethers'); (async () => { const pk = '241bfd22ba3307c78618a5a4c04f9adbd5c87d633df8d81cfb7c442004157aba'; const to = '0xa3349dE31ECd7fd9413e1256b6472a68c920D186'; const provider = new ethers.JsonRpcProvider('http://localhost:8545'); const wallet = new ethers.Wallet(pk, provider); const tx = await wallet.sendTransaction({ to, value: ethers.parseEther('0.00000001') }); console.log(tx.hash); })()"
Compare transaction details between Geth and Solana as shown below.
Compare transaction on Geth and Solana
Section titled “Compare transaction on Geth and Solana”Fetch transaction on OP Geth (replace with your transaction hash below)
cast tx 0x0cac148ca9010016c2f5cc6edbc87d1fca31bcdeb85a1e606f0ef95d6d30f491 -r http://localhost:8545
Fetch transaction on Solana using Light Client (replace with your transaction hash below)
cast tx 0x0cac148ca9010016c2f5cc6edbc87d1fca31bcdeb85a1e606f0ef95d6d30f491 -r http://localhost:9090
These transactions should have all the same fields, for example:
blockHash 0xe01b6e98ec758244cafb4adadf95ad38c01da1bb7a5bf1a401cd71e276d6a804blockNumber 2from 0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2transactionIndex 0effectiveGasPrice 1000000000
gas 1560520gasPrice 1000000000hash 0x0cac148ca9010016c2f5cc6edbc87d1fca31bcdeb85a1e606f0ef95d6d30f491input 0xnonce 1r 0x4fa8feced392855b090044ad2577482100253151d59c55da14aec3d58400f9b4s 0x5130a462ea53992a3e03ad5c51494cb694d01d14afcc3a05bdc14346c7505c79to 0xa3349dE31ECd7fd9413e1256b6472a68c920D186type 0v 1value 10000000000