Foundry
Last updated
Last updated
This guide is suitable for developers who want to start building dApps using Pharos and Foundry toolchains. If you are a new user of Ethereum, please consider researching the before continuing.
This guide will walk you through the process of sending your first transaction on the Pharos blockchain using three popular libraries: ethers.js
, web3.js
, and web3.py
. By the end of this guide, you will understand how to send a transaction programmatically using these libraries.
Before you begin, ensure you have the following:
Git: Used for code management and obtain examples.
Pharos Devnet/Testnet Access: Access to a Pharos node (local or remote) for interacting with the blockchain.
Install your preferred contract framework from the below list:
ethers.js
web3.js
web3.py
Clone the example repo and add dependencies.
Run the script using Node.js:
Private Key: Never expose your private key in production. Use environment variables or secure storage.
Recipient Address: Replace RECIPIENT_ADDRESS with the actual recipient's wallet address.
Gas Limit: Ensure you include a sufficient gas limit for the transaction.
Transaction Fails: Ensure you have enough testnet tokens to cover the transaction fee.
Incorrect Network: Double-check that you are connected to the Pharos Testnet.
Invalid Address: Verify that the recipient's address is correct.
Now that you’ve sent your first transaction using ethers.js, web3.js, and web3.py.
This guide provides a comprehensive introduction to sending transactions on the Pharos blockchain using three popular libraries. If you encounter any issues, refer to the Troubleshooting section or consult the respective library's documentation. Happy building! 🚀