NOTE: Only Ubuntu 20.04 is supported
sudo apt update
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_17.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install -y nodejs xclip
node -v && npm -v
npm install -g truffle-export-abip
# Install Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
sudo apt install git
cd $HOME
rm -rfv ./liquidity-program/
git clone https://github.com/KiraCore/liquidity-program.git -b <branch_name>
Ganache will provide a personal blockchain to be used for local development and testing of smart contracts.
-
Open a browser and navigate to https://github.com/trufflesuite/ganache/releases
-
Download the latest Linux release which will be the *.AppImage file.
-
For example ganache-2.4.0-linux-x86_64.AppImage.
-
Once the download is complete, open a new terminal and change into the directory with the *.AppImage file.
-
Use chmod to make the file executable:
chmod a+x ganache-1.3.0-x86_64.AppImage
-
Now run the file
./ganache-1.3.0-x86_64.AppImage
- Install Google Chrome
$ sudo apt install gdebi-core wget $ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb $ sudo gdebi google-chrome-stable_current_amd64.deb $ google-chrome
Let's setup MetaMask account and we can use Seed Phrase of the MetaMask wallet with ganche testnet.
- Install MetaMask Google Chrome Extension
- Use the secret phrase of your MetaMask wallet as
PRIVATE_KEY
. - Enter MetaMask, create account and backup seed phrase
- Click three dots in the top right of the main menu and enter Account details view
- Click Export Private Key
Each deployment environment has a different set of mandatory environment variables. Add the secrets required for the deployment environment to .env
file of each working directory (e.g LIP_1, LIP_2, etc)
Make sure to provide the 64 character long hexa-decimal PRIVATE_KEY
. The associated address will inherit the tokens created by the contract deployment.
For example, To setup LIP_1's PRIVATE_KEY
LIP_ID="LIP_1"
cd $HOME/liquidity-program/$LIP_ID
touch ./.env
echo "PRIVATE_KEY=0xXXX...XXX" >> ./.env
Sign up for a free api key at https://infura.io/dashboard to deploy to public networks.
- Create an account on infura.io
- Create a new Project on your infura account
- Go to Settings Tab
- Use the Project Secret as
INFURA_APIKEY
echo "INFURA_APIKEY=XXX...XXX" >> ./.env && . ./.env && \
echo "REACT_APP_INFURA_APIKEY=$INFURA_APIKEY" >> ./.env
Sign up for a free api key at https://infura.io/dashboard to deploy to public networks.
- Create an account on infura.io
- Create a new Project on your infura account
- Go to Settings Tab
- Use the Project ID as
INFURA_PROJECT_ID
echo "INFURA_PROJECT_ID=XXX...XXX" >> ./.env && . ./.env && \
echo "REACT_APP_INFURA_PROJECT_ID=$INFURA_PROJECT_ID" >> ./.env
- Generate the Etherscan API Key for free at https://etherscan.io/myapikey.
- Note that the naming might be inconsistent, always reffer to the LIP requirements readme
echo "ETHERSCAN_APIKEY=XXX...XXX" >> ./.env && . ./.env && \
echo "ETHERSCAN_API_KEY=$ETHERSCAN_APIKEY" >> ./.env && \
echo "REACT_APP_ETHERSCAN_APIKEY=$ETHERSCAN_APIKEY" >> ./.env && \
echo "REACT_APP_ETHERSCAN_API_KEY=$ETHERSCAN_APIKEY" >> ./.env
- This environment variable should be set when Kira Token ERC20 (LIP_1) is deployed
echo "KIRA_TOKEN_ADDRESS=0xZZZ...ZZZ" >> ./.env && . ./.env && \
echo "REACT_APP_KIRA_TOKEN_ADDRESS=$KIRA_TOKEN_ADDRESS" >> ./.env
- Smart contract which manages the roles of accounts for other NFT smart contract, see access control function in LIP_5
echo "ACCESS_CONTROL_ADDRESS=0xZZZ...ZZZ" >> $HOME/liquidity-program/$LIP_ID/.env
- Smart contract which allows to earn KEX ERC20, for staking KIRA NFT tokens, see NFT staking function in LIP_5
echo "NFT_STAKING_ADDRESS=0xZZZ...ZZZ" >> && . ./.env && \
echo "REACT_APP_NFT_STAKING_ADDRESS=$NFT_STAKING_ADDRESS" >> ./.env
- Smart contract which manages NFT farming using stones, see kex farm function in LIP_5
echo "NFT_FARM_ADDRESS=0xZZZ...ZZZ" >> && . ./.env && \
echo "REACT_APP_NFT_FARM_ADDRESS=$NFT_FARM_ADDRESS" >> ./.env
- Smart contract which manages NFT minting & metadata, see kira nft function in LIP_5
echo "NFT_MINTING_ADDRESS=0xZZZ...ZZZ" >> && . ./.env && \
echo "REACT_APP_NFT_MINTING_ADDRESS=$NFT_MINTING_ADDRESS" >> ./.env
- An integer identifying chain id is used in transaction signature process
Some of the known Chain ID values:
- mainnet -
1
- ropsten -
3
- rinkeby -
4
- kovan -
42
echo "ETHEREUM_CHAIN_ID=XXX" >> && . ./.env && \
echo "REACT_APP_ETHEREUM_CHAIN_ID=$ETHEREUM_CHAIN_ID" >> ./.env
You can instantly get 1 Ropsten Test Ether per 24h per account by visiting https://faucet.ropsten.be/
You can instantly get 1 KEth per 24h per GitHub account by visiting https://faucet.kovan.network/ and submitting your Kovan address.