All Projects → simonho288 → eosio-demo1-election

simonho288 / eosio-demo1-election

Licence: MIT License
My experiment on EOSIO blockchain to develop an election Smart Contract. I also develop a webapp which interacts with the blockchain.

Programming Languages

WebAssembly
147 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to eosio-demo1-election

Eos Dapp
Game Dapp Demo using EOS and React
Stars: ✭ 119 (+600%)
Mutual labels:  webassembly, eosio
koder
QR/bar code scanner for the Browser
Stars: ✭ 73 (+329.41%)
Mutual labels:  webassembly
wasm-linker-js
A simple WebAssembly Linker in JavaScript
Stars: ✭ 14 (-17.65%)
Mutual labels:  webassembly
EOSTracker-API
EOS Tracker API is a PHP Backend based on Symfony3 that connects to a SQL database.
Stars: ✭ 64 (+276.47%)
Mutual labels:  eosio
wasmsign2
PoC implementation of the WebAssembly Modules Signatures proposal.
Stars: ✭ 18 (+5.88%)
Mutual labels:  webassembly
every-eos
Decentralized exchange based on eos.io
Stars: ✭ 20 (+17.65%)
Mutual labels:  eosio
wasm-ops
Chart of WebAssembly Instructions
Stars: ✭ 46 (+170.59%)
Mutual labels:  webassembly
image-hub
Image Hub is a sample application for exploring WebAssembly modules used as Envoy filters.
Stars: ✭ 56 (+229.41%)
Mutual labels:  webassembly
Uno.Themes
This library is designed to help you use the material design system with the Uno Platform
Stars: ✭ 112 (+558.82%)
Mutual labels:  webassembly
vmrp
mrp emulator, virtual machine, mrp模拟器
Stars: ✭ 126 (+641.18%)
Mutual labels:  webassembly
imgalign
Webapplication for image stitching and aligning
Stars: ✭ 162 (+852.94%)
Mutual labels:  webassembly
fullstack-rust
Reference implementation of a full-stack Rust application
Stars: ✭ 39 (+129.41%)
Mutual labels:  webassembly
gearoenix
Cross-platform C++ 3D game engine.
Stars: ✭ 33 (+94.12%)
Mutual labels:  webassembly
jasper
🧳 Single-binary packaging for Ruby applications that supports native and Wasm targets
Stars: ✭ 29 (+70.59%)
Mutual labels:  webassembly
widgets playground
Showcase example for https://github.com/therecipe/qt
Stars: ✭ 50 (+194.12%)
Mutual labels:  webassembly
twitbot
🦉Just a simple twitter bot for tipping in EOS
Stars: ✭ 18 (+5.88%)
Mutual labels:  eosio
django-scatter-auth
Django Scatter Auth for EOS blockchain
Stars: ✭ 16 (-5.88%)
Mutual labels:  eosio
TypeScriptXX
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.
Stars: ✭ 33 (+94.12%)
Mutual labels:  webassembly
Sharpen
(Demo) A v-dom "diff" engine based on WebAssembly, aim to build efficient and fluent web apps.
Stars: ✭ 20 (+17.65%)
Mutual labels:  webassembly
bos-testnet
Testnet for BOSCore.
Stars: ✭ 17 (+0%)
Mutual labels:  eosio

EOSIO Blockchain dApp Steps-by-Steps

Introduction

This repo hosts the source codes for my blog post. This includes the source code of the EOSIO Smart Contract mentioned in the blog post which to simulate an election.

Prerequisites

You'll need to setup the EOSIO development environment before compiling the smart contract. Please refer this blog post for the steps-by-steps setup.

Compile the Smart Contract

Type below commands to generate the WAST & ABI file:

$ eosiocpp -o election.wast election.cpp
$ eosiocpp -g election.abi election.cpp

Deploy and run the Smart Contract

This requires several steps to create keypairs and accounts before deploying the Smart Contract. Please refer to the blog post for steps-by-steps description. It guides you to run the smart contract on your machine successfully.

Run the Webapp At Your Local PC

In addition to the above prerequisites, you'll need below software installed to run the webapp:

Install the python3 & pip3

$ sudo apt-get update
$ sudo apt-get install python3.6
$ sudo apt-get -y install python3-pip
$ sudo pip install virtualenv
$ sudo apt-get install nodejs
$ sudo apt-get install npm

Setup EOSIO

Start the EOSIO services

$ nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --access-control-allow-origin=* --contracts-console
# Start a new Terminal session
$ keosd --http-server-address=localhost:8899
# Start a new Terminal session
$ alias cleos='~/eos/build/programs/cleos/cleos --wallet-url=http://localhost:8899'

Create the default Wallet, Keypairs and Accounts

You'll required to create the wallet, keypairs and account At the first time. Type below commands:

$ cleos wallet create
# You must record the password
$ cleos create key
# You must record this owner key
$ cleos create key
# You must record this active key
$ cleos wallet import ${private_owner_key}
$ cleos wallet import ${private_active_key}

Import eosio account's private key

$ find ~ -name config.ini
$ nano ~/.local/share/eosio/nodeos/config/config.ini
# find the private key at the end of setting signature-provider
$ cleos wallet import ${private_eosio_key}

Create the election account

$ cleos create account eosio election ${public_owner_key} ${public_active_key}

Config and run the WebApp

Before run the webapp, you'll need to create an EOSIO config file webapp/eosio-config.ini. Then put your EOSIO keys & passwords in there:

[DEFAULT]
WALLET_PASSWORD = ${your_default_wallet_password}
PUBLIC_OWNER_KEY = ${your_public_owner_key}
PUBLIC_ACTIVE_KEY = ${your_public_active_key}

Run the local Testnet (nodeos):

$ nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --access-control-allow-origin=* --contracts-console

Install the python dependencies in the first time:

$ git clone https://github.com/simonho288/eosio-demo1-election
$ cd webapp
$ source venv/bin/activate
$ pip install -r requirements.txt

Start the web server:

$ npm start

Browse the http://localhost:5000 to run the demo.

License

The MIT License (MIT)

Copyright (c) 2018 Simon Ho

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

License: MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].