This repository is an example and tutorial for writing decentralized applications on RChain. Using it requires moderate familiarity with the command line, RNode software, and node.js. I encourage you to experiment and make changesg. RChain is still in a pre-release state and not all of the features we would have used in this dapp are available yet.
Written By:
Joshy Orndorff
Dan Connolly
- Install RNode (instructions)
- Install node and npm (instructions)
- Clone the repo
git clone /~https://github.com/JoshOrndorff/Rchain-Status.git
- Change into the project directory
cd Rchain-Status
- Install dependencies
npm install
- Start a fresh, pre-configured RNode
freshr
- Deploy the smart contract
npm run deploy-contract
and observe its URI in the node log. (eg. rho:id:z8s9ussdc5hx3z4m8a9a98cah3r5d8ick6yj5bfs4wc8oyrhacbabc) - Launch the frontend server
node main.js start --register <uri>
- Navigate to the user interface in your favorite browser at
localhost:8080
These big-picture steps apply to writing any dApp including ours.
- Design the smart contract -- ours is in
status.rho
- Design an interface -- (eg express.js, and spectre css)
- Connect the interface to the contract -- We'll use the rchain-api node module
- Deploy your contract
- Use your dapp
- Celebrate :)
Our primitive social media Dapp allows users to post a single status message representing their current thoughts, activity, etc. Examples might include "Rainy Saturday...", "Long weekend coming up!", "Go Indians! World series this year!".
I sincerely hope that this example dApp was helpful and made the path to your first dapp a bit easier. I will continue to improve this guide as new node features are release. I'd also love your feedback either in the issue queue, the pull requests, or on the RChain discord.