This README guide provides detailed instructions on how to add a new token to the Ethereum-based token lists for testnet and mainnet (Pegasus and Phoenix, respectively) and deploy these updated lists to IPFS using Node.js.
- Node.js: Ensure Node.js is installed on your computer.
- File Access: You should have access to
token_testnet.json
for the testnet ortoken.json
for the mainnet. - API Key: A valid Pinata API key is required for IPFS deployment.
token_testnet.json
: Contains the token list for the Pegasus testnet.token.json
: Contains the token list for the Phoenix mainnet.index.js
: Node.js script to deploy the token lists to IPFS.
-
Select the Correct List:
- Use
token_testnet.json
for Pegasus Testnet. - Use
token.json
for Phoenix Mainnet.
- Use
-
Add Token Details:
- Edit the chosen JSON file and append your token information in the following format within the
tokens
array:
{ "chainId": 1891, "address": "0xYOUR_TOKEN_ADDRESS", "name": "YOUR_TOKEN_NAME", "symbol": "YOUR_TOKEN_SYMBOL", "decimals": TOKEN_DECIMALS, "logoURI": "URL_TO_TOKEN_LOGO" }
Replace
YOUR_TOKEN_ADDRESS
,YOUR_TOKEN_NAME
,YOUR_TOKEN_SYMBOL
,TOKEN_DECIMALS
, andURL_TO_TOKEN_LOGO
with your token's specific details. - Edit the chosen JSON file and append your token information in the following format within the
Ensure that you save the updated JSON file after adding your new token.
-
Modify the Node.js Script:
- Open your
index.js
script. - Set the
src
variable to the path of the JSON file you want to deploy. For mainnet, it should point totoken.json
, and for testnet totoken_testnet.json
.
- Open your
-
Deploy to IPFS:
- Run the following command in your terminal to execute the script and deploy your token list to IPFS:
node index.js
-
Check the Output:
- The script will output an IPFS link (CID). This link can be used to access the updated token list.
By following these steps, you can easily add a new token to the respective Ethereum token list and deploy it to IPFS, ensuring it's accessible for integration into decentralized exchanges and other platforms.