Develop Blockchain Apps with Sidechain Technology — Part 1
❤ Many thanks from our heart to a1300 for contributing this series of article to give a step by step tutorial on developing DApps on ASCH Platform.
Part 1 — Installing the blockchain
Part 2 — Create your first Sidechain
Part 3 — Build Frontend for Sidechain Dapp (Coming Soon)
Part 4 — Understanding Blockchain and Sidechain Architecture (Coming Soon)
Part 5 — Issue own Token (Coming Soon)
In this series of tutorial, we will develop a small decentralized application where every user can publish an article and other users can upvote them.
Structure of Article Series
I would like to take a different approach: We will get our hands dirty first and after that, we will have a look at the concepts behind blockchain and decentralized applications.
The ASCH Blockchain Platform
Install the Blockchain on Linux
I recommend running Ubuntu. But it should also work on other Linux distributions.
In the future, the installation process will also be possible on Windows, until then, you can install Linux into a virtual machine (Run-Linux-in-Windows-in-a-VirtualBox)
First, install curl:
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Install all necessary dependencies.
# Install dependencies
sudo apt-get install curl sqlite3 ntp wget git libssl-dev openssl make gcc g++ autoconf automake python build-essential -y
# libsodium for ubuntu
sudo apt-get install libtool libtool-bin -y
# Install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
# This loads nvm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Install node and npm for current user.
nvm install 8.0.0
# check node version and it should be v8.x.x
sudo apt-get install git
Now clone the blockchain repository and install its packages.
git clone https://github.com/AschPlatform/asch && cd asch && chmod u+x aschd
Start the Blockchain
Finally, start the blockchain:
Now open your favourite browser and type
Here you can inspect the latest block, a new block is generated every 10 seconds. Try to refresh your browser a few times.
Stop the Blockchain
Genesis Account (main chain)
The Genesis account is the account where all the money of the main chain blockchain is initially located. This account has hundred millions of XAS (our standard currency).
"secret": "stone elephant caught wrong spend traffic success fetch inside blush virtual element" // password
Access the Blockchain
You can send money and manage the local blockchain via the Command Line with asch-cli but it can be more pleasant to work with the GUI to manage your account. You have options. I will present both options:
Access the Blockchain with Command Line Interface
The asch-cli offers more control over the local blockchain than the GUI. All available options are documented here.
Install the Command Line Interface
npm install --global asch-cli
Command Line Example
Use the secret of the Genesis account to access the local blockchain.
For this example to work, the local blockchain must be up and running already(
asch-cli openaccount "stone elephant caught wrong spend traffic success fetch inside blush virtual element"
# server response:
Learn More About ASCH:
ASCH BBS: https://bbs.asch.io/
Gitter Chatroom: https://gitter.im/asch-development
Join our contributor community!