Includes an example Ethereum token implementation and UI!
This is a starter boilerplate Ethereum dapp I've put together using the following technologies:
This starter repository for building react/redux dapps uses the latest bleeding-edge Ethereum development technologies. Please note that the repository is still under development; I will be adding additional smart-contracts/UI examples.
Download the latest verion of Parity here.
Also ensure that you have the latest verion of Truffle installed globally:
npm install -g truffle
Finally install all package dependencies:
npm install
Run all of the following commands inside the project directory.
parity --chain dev --ws-origins "*"
Note: we set --ws-origins
so that we can use websockets to subscribe to blockchain events.
truffle compile && truffle migrate
NOTE: after running open parity (at http://127.0.0.1:8180/
) in a browser and confirm all of the transactions to complete the migration.
npm run dev
The first time it may take a little while to generate the first webpack-assets.json
and complain with a few dozen [webpack-isomorphic-tools] (waiting for the first Webpack build to finish)
printouts, but be patient. Give it 30 seconds.
You're good to go! :) Now you can access the dapp at: http://localhost:3000
.
Redux Devtools are enabled by default in development.
If you have the Redux DevTools chrome extension installed it will automatically be used on the client-side instead.
If you want to disable the dev tools during development, set __DEVTOOLS__
to false
in /webpack/dev.config.js
.
DevTools are not enabled during production by default.
Please see the react-redux-universal-hot-example documentation
for an in-depth explanation of how the React/Redux portion of this dapp works.
Smart-contracts are written inside the /contracts
directory. The truffle compile
command then creates corresponding .json
files inside the /build/contracts
directory.
For a smart-contracts to be deployed when truffle migrate
is run it must be called with .deploy()
in /migrations/2_deploy_contracts.js
or any other migration file in the ./migrations
directory (note: you can add additional deployment files to this directory, simply increment the number at the beginning of the filename, e.g.: 3_anotha_one.js
).
For more info on Truffle and how it works please read the documentation.
The Web3.js Javascript library that is used in the React/Redux portion of the dapp to interact with the Ethereum smart-contracts running on the Parity test chain via a websocket.
For more info on Parity and how it works please read the wiki.
After running truffle migrate
, the 2_deploy_contracts.js
migration script will create an addresses.json
file inside of the newly created /build/contracts
directory that will simply contain a JSON object of the current deployment addresses of the dapp's smart-contracts.
The loadContractABI
API is used to get the Application Binary Interface (ABI) for the smart-contracts from their JSON files. It runs on the server-side of the app as it's easier to access the file-system that way.
Planned future additions:
web3.eth.getStorageAt
method on StorageExample
smart-contracttruffle-contract
for better Ethereum contract abstractionMy aim is for this to function as both a learning resource and also a useful boilerplate for starting new projects. I am more than happy to accept external contributions to the project in the form of feedback, bug reports and even better - pull requests :)
If you would like to submit a pull request, please make an effort to follow the guide in CONTRIBUTING.md.
Thanks for checking this out.
Created by:– Leopold Joy, @leopoldjoy
目录 零、相关工具 本文中直接用到的工具:Remix, truffle(v5.1.0), ganache(v2.1.2), MetaMask等 0.1 本地测试节点 testrpc: nodejs包,命令行工具,不过对新版的solidity支持度不高,部署合约时会报VM Exception等异常 ganache-cli: nodejs包,命令行工具 ganache:界面工具,比较方便 0.2 Me
以太坊dapp In part 5 of this tutorial series on building DApps with Ethereum, we dealt with adding content to the story, looking at how to add the ability for participants to buy tokens from the DAO and
ethereum-dapp-ipfs-node.js-mongodb 以太坊开发DApp实战教程——用区块链、星际文件系统(IPFS)、Node.js和MongoDB来构建电商平台 http://xc.hubwiz.com/course/5abbb7acc02e6b6a59171dd6 一、引言 1.1 课程简介 1.2 去中心化,Why? 1.3 课程项目概述 1.4 基础知识要求 1.5 应用
Governance for Digital Autonomous Organizations. Features Built for Ethereum using Web3. Implements Graph Protocol to read blockchain. Explore MolochDAO compatible contracts. Deployable on IPFS. Suppo
分片原本是数据库设计中的一种概念,指将数据库中的数据分割成多个数据分片,让数据的读写可以并行处理。当进行搜索时,仅需访问特定分片即可获得搜索结果,减少了服务器访问压力,从而提高数据库性能。 在区块链中,分片指将区块链中的节点分成若干个组,每组节点组成一个分片。原先区块链中每个节点需要对网络中的每笔交易进行验证,分片后,每个节点仅需处理网络中的一小部分交易。各分片并行工作,从而实现对区块链的横向扩展
ipfs-image-dapp Overview IPFS and the Blockchain are a perfect match. Why? You can address large amounts of data with IPFS and place the immutable, permanent IPFS links into a blockchain transaction.
Ethereum ETL Ethereum ETL lets you convert blockchain data into convenient formats like CSVs and relational databases. Do you just want to query Ethereum data right away? Use the public dataset in Big
Love-Ethereum If winter comes , can spring be far behind ? ( P. B. Shelley , British poet ) 区块链最大的问题就是人们理解区块链需要时间 | 版本说明 | 区块链 | 以太坊 | 区块链开源学习项目 | 补充资料| 参与贡献| Progress 版本说明 Frontier 简单的介绍区块链基础知识,通过阅读此