Dev Tutorial
Environment Setup
node.js v16
Install node v16 on Ubuntu:
Get the code
Install dependencies
Contract deployment
Set the wallet private key to the .env
file:
</aside>
Compile the contract:
Deploy the contract to the Filecoin mainnet:
The default network is Hyperspace
testnet, add the --network filecoinMainnet
parameter
After each successful deployment, the contract address will be returned. Add the contract address to the .env
file:
IPFS storage configuration
The NFT resources in the MomentSwap website are stored on the IPFS network and need to configure the nft.storage API key
Fill the applied API key to the .env
file:
Deploy UI using Fleek
Authorize github and select the momentswap repository:
<aside> ⚠️ If you are not in the development group of the momentswap repository, you need to fork the code to your own repository to select it
</aside>
Select the IPFS network and click Next:
Select the main branch:
Select the NextJS framework:
Modify the build command:
Replace with
Set the environment variables:
<aside> ⚠️ WALLET_PRIVATE_KEY
is a required field, otherwise compilation error will occur, and temporary wallet private keys can be used to complete the deployment
</aside>
The frontend defaults to the Hyperspace
test network. To switch to the Fil main network, you can add the environment variable settings:
Start deployment:
Last updated