How to build an App on RChain

The growth of blockchain technology has attracted the interest of many enterprises worldwide. RChain is one of the emerging blockchain enterprises betting its bucks on three primary concerns: speed, scalability, and lower transaction costs. To become the world’s most powerful blockchain platform, RChain is growing at full pace.
What is RChain?
RChain is a cooperative established in 2017 and based in Seattle, Washington. It has introduced a robust Smart Contract platform and named it RChain. It is a new blockchain platform that is rooted in a formal model of decentralized and concurrent computation.
The vision of RChain Coop is to eliminate as much energy waste as possible. A lot of waste is happening around us today; waste of energy, government control, and mindshare. RChain believes that building a blockchain platform that is less resource-intensive and is evenly applicable to people worldwide can help to reduce wastage.
How to build an app on RChain?
RChain is a platform where developers can build conveniently and confidently. It enables developers to build RChain dApp with just a few lines of code and the application is ready to handle transactions on the blockchain.
Development setup
Set up the development environment by installing rnode on the operating system. Get the installer from: https://github.com/rchain/rchain/releases
For debian/ ubuntu:
$ apt install ./rnode_0.x.x_all.deb
Some prerequisites are required for macOS:
- Libsodium: Install in standard prefix (/user/local or /user); https://download.libsodium.org/doc/
- Java: OpenJDK 11, https://openjdk.java.net/projects/jdk/11/
tar -xvf rnode-0.x.x.tgz
cd rnode-0.x.x
./macos_install.sh
Files configuration
The two necessary configuration files are:
~/.rnode/genesis/bonds.txt and
~/.rnode/genesis/wallets.txt
The following key pair is used for configuration:
private key 28a5c9ac133b4449ca38e9bdf7cacdce31079ef6b3ac2f0a080af83ecff98b36
public key 04be064356846e36e485408df50b877dd99ba406d87208add4c92b3c7d4e4c663c2fbc6a1e6534c7e5c0aec00b26486fad1daf20079423b7c8ebffbbdff3682b58
mkdir ~/.rnode && mkdir ~/.rnode/genesis
echo “04be064356846e36e485408df50b877dd99ba406d87208add4c92b3c7d4e4c663c2fbc6a1e6534c7e5c0aec00b26486fad1daf20079423b7c8ebffbbdff3682b58 100000000000” > ~/.rnode/genesis/bonds.txt
echo “0x7f847d40c3ec604fe3d4263bfdd04111eb9b4e32,1000000000000000,0” > ~/.rnode/genesis/wallets.txt
Running the blockchain
Once the configuration files are set up, one validator with one address with REV is allowed to deploy. Now, run the node:
rnode run -s — validator-private-key 28a5c9ac133b4449ca38e9bdf7cacdce31079ef6b3ac2f0a080af83ecff98b36 — dev-mode
It is one node blockchain network; the node is standalone; therefore, it doesn’t download any block and start at block height zero. Its execution is done with — dev-mode option, thus API is extended API with exploring deploy available.
Deploy and propose a block
Now it’s time to deploy the first rholang file and propose a block.
echo “new stdout(\`rho:io:stdout\`) in { stdout!(\”hello world\”) }” > hello.rho
rnode deploy — valid-after-block-number 0 — phlo-price 1 — phlo-limit 10000000 — private-key 28a5c9ac133b4449ca38e9bdf7cacdce31079ef6b3ac2f0a080af83ecff98b36 hello.rho
rnode — grpc-port 40402 propose
It would pop up “hello world” in the logs. It means your deployment has been included in the block and the transaction is successfully executed.
Conclusion
RChain is a network of people who are willing to work and find solutions with their best efforts. It allows its members to govern the protocol and get rebates to run the Smart contract in REV tokens. RChain is a developer-friendly platform and invites to build dApp on the platform.
RChain also enables its participants to run validator nodes to ensure the network’s security and allow the opportunity to earn transaction fees. In the upcoming time, RChain will be one of the top leaders in the financial world.