• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

transmute-industries/ride-share-demo: A demo dapp with transmute, react, express ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

transmute-industries/ride-share-demo

开源软件地址:

https://github.com/transmute-industries/ride-share-demo

开源编程语言:

JavaScript 92.5%

开源软件介绍:

Ride Share Demo

A demo dapp with transmute, react, express, ipfs, postgres and testrpc.

An Insomnia workspace is included to make testing the api easy.

Be sure to disable Metamask before running this demo

Getting Started With Docker

git clone https://github.com/transmute-industries/ride-share-demo.git
cd ride-share-demo
docker-compose up --build

Summary

Inside of ./dapp, sample data is generated and events are simulated via a command line tool (yarn reset).

On http://localhost:3000, a react app reads from ethereum and ipfs to reconstruct the data generated by the command line tool, using the transmute framework.

On http://localhost:3001/demo, an express postgres api reads from ethereum and ipfs to reconstruct the data generated by the command line tool, using the transmute framework.

This demo shows how a node command line tool, react web app and express postgres api can use the transmute framework to read and interact with smart contracts on ethereum and store data on ipfs.

What are Read Models?

Read Models are event sourced objects which represent a smart contract's state, and are built from its history.

By using Read Models, its easy to integrate smart contracts with existing databases and APIs.

The Transmute Framework provides a javascript api for smart contract read models that is easy to extend and runs in the browser and node.js, see ./dapp/lib/common for some methods using the transmute framework.

Possible Extensions

  • use express, postgres and transmute framework to create an api which persists data to ipfs and ethereum.
  • use express and postgres to store read models generated on command line or in web app for relational querying.
  • use transmute framework to provide an integrity log for postgres on IPFS and ethereum.

Without Docker

Install Global Node Dependencies

yarn global add truffle@beta ethereumjs-testrpc

Start Dependencies in Terminal

ipfs daemon
testrpc

Generate and Start Demo

cd ./dapp
yarn install
yarn reset
yarn start

IPFS is sometimes not fast enough with updates... if you see this:

/node_modules/transmute-framework/lib/TransmuteIpfs/TransmuteIpfs.js:165
stream.on("data", function (chunk) {

restart the demo... we will add retries to resolve this in the future... sorry :(

Built With

  • Transmute Framework
  • Solidity Smart Contracts
  • Truffle
  • Insomnia
  • Docker
  • Postgres
  • Express
  • IPFS
  • TestRPC

Future Work




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap