Comment on page
Development Framework Integration
Seamless Integration with Development Frameworks
Phalcon Fork can be integrated with popular development frameworks.
The first step is getting the API access key (
FORK_API_ACCESSS_KEY
), the Fork RPC ID (FORK_RPC_ID
) and FORK_ID
. The API access key is obtained in the Account Settings. 
The
FORK_RPC_ID
and FORK_ID
can be obtained inside a Fork (or retrieved from the response of REST APIs).
Add the Phalcon network to
hardhat.config.js
, by placing the fork's RPC in the URL.require("@nomicfoundation/hardhat-toolbox");
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
networks: {
hardhat: {
},
goerli: {
url: "https://eth-goerli.alchemyapi.io/v2/${YOUR_KEY}",
accounts: ['${PRIVATE_KEY}']
},
phalcon: {
url: "https://rpc.phalcon.xyz/FORK_RPC_ID",
accounts: ['${PRIVATE_KEY}']
}
},
solidity: "0.8.17",
};
When executing the deployment scripts, specify the network as
phalcon
, for example:npx hardhat run scripts/deploy.js --network phalcon
Phalcon Fork can be easily integrated into Foundry.
- Using
rpc-url
parameter
forge create --rpc-url [FORK_RPC] --private-key %private-key% src/Contract.sol:TokenSwap
- Add eth_rpc_url to the
foundry.toml
.
When executing without specifying an
rpc-url
, it will use Fork by default. eth_rpc_url = [FORK_RPC]
- Add Phalcon Fork to the
rpc_endpoints
section infoundry.toml
[rpc_endpoints]
phalcon = [FORK_RPC]
When executing, use Fork by specifying the rpc-url.
forge create --rpc-url phalcon --private-key %private-key% src/Contract.sol:TokenSwap
--slow:
Makes sure a transaction is sent only after its previous one has been confirmed and succeeded.- Step 2: Use the Injected Provider - MetaMask in Remix.

- Sign the transaction in MetaMask, and check the network to ensure it is being executed on the Fork

- View the transaction in MetaMask and wait for the status change from Pending to Confirmed.

- Check the transaction execution details in Phalcon Explorer.

Add the Phalcon network to
truffle-config.js
, by placing the fork's RPC in the URL.networks: {
phalcon: {
provider: () => new HDWalletProvider([privateKey], 'https://rpc.phalcon.xyz/rpc_402xxxxb27cf'),
network_id: "*", // Match any network id
gas: 5500000, // Gas limit
confirmations: 0, //number of confirmations to wait between deployments
timeoutBlocks: 200,
skipDryRun: true
},
},
Please note that
confirmations
must be set to 0 when using Phalcon.When executing the deployment scripts, specify the network as
phalcon
, for example:truffle deploy --network phalcon
Last modified 2mo ago