Welcome to the dApp Examples repository! This repository contains a collection of examples designed to assist you in building applications using the Moi JavaScript SDK and Cocolang. The Moi SDK provides a powerful set of tools to interact with the Moi blockchain and ecosystem.
To get started, make sure you're familiar with the official documentation. This documentation serves as a comprehensive guide to understanding the various aspects of the Moi ecosystem and how to utilize its features effectively.
- Official Documentation: Documentation
The core of your development experience will involve using the Moi JavaScript SDK. This SDK empowers you to integrate Moi blockchain functionality seamlessly into your applications.
- npm Package: js-moi-sdk
To explore the Moi blockchain and gain insights into its activities, you can use the Moi block explorer. This tool allows you to visualize transactions, blocks, and other crucial information on the blockchain.
- Block Explorer: Voyage
During your development and experimentation, you might need Moi tokens to test your applications. The Moi faucet on the testnet provides you with the necessary tokens to facilitate your testing.
- Testnet Faucet: Faucet
We welcome contributions from the community! If you have suggestions, improvements, or new examples to add, feel free to fork this repository, make your changes, and submit a pull request.
-
Navigate to the logic/coco directory using the terminal:
cd logic/coco
-
Compile the coco logic (Run this every time after making changes to coco logic):
coco compile
This will generate an updated manifest file with the name
moduleName.json
. -
Move back to the logic directory:
cd ../
-
Install dependencies for the logic directory:
npm install
-
If the logic directory has a
.env.example
file, then:- Create a
.env
file and paste the required fields referring to the given.env.example
file.
- Create a
-
Deploy the DReddit logic to MOI network:
node deployModuleName.js
Copy the logic ID from the transaction receipt displayed in the terminal. As this will be needed for your client app to make calls to the deployed logic
-
Install dependencies for the client:
npm install
-
Navigate to the client/src/interface/logic.js
And there if you see
logicId = "paste your logicId";
Then paste your deployed logicId
-
Start the app:
npm start