With Truffle
Truffle is a world-class development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM), aiming to make life as a developer easier.
Setting up the development environment
There are a few dependencies to install before we start. Please install the following:
Node.js v8+ LTS and npm (comes with Node)
After installing the above dependencies, we can proceed to install truffle:
for more information on the different flags for npm-install
To verify that Truffle is installed properly, run this command:
Return (your version might differ):
If you're new to Truffle then please follow the Getting Started by truffle, To setup the truffle environment.
Initializing a truffle project
Initialize a truffle project:
Initialize a node project:
truffle-config
After setting up your truffle project, be it cloning a repository or initializing a new truffle project
Open
truffle-config.js
Edit
truffle-config.js
with Pundi AIFX network credentials
the file below is just a sample:
The key fields to note here are:
networks to include fxtestnet
provider to be set to any of our Pundi AIFX nodes, you may use the company's hosted node https://testnet-fx-json-web3.functionx.io:8545
gasPrice: 4000000000000
network_id: 90001
Deploying on Pundi AIFX Network
To request for Testnet FX click on this link
Run this command in root of the project directory:
Contract will be deployed on Pundi AIFX Testnet, it will look something like this:
Remember your address, transaction_hash and other details provided would differ, Above is just to provide an idea of structure.
Congratulations! You have successfully deployed HelloWorld Smart Contract. Now you can interact with the Smart Contract.
You can check the deployment status in our testnet explorer.
Last updated