A Holochain implementation of the Ethereum example DAO contract As part of our benchmarking for Holo we have built a Holochain version of the sample DAO contract from the Ethereum.org website. Comparing Holochain apps to Ethereum smart contracts is a bit like comparing apples and pineapples. Though they are both distributed computing platforms, because of their different starting assumptions, the results are quite difficult to compare. For example, Ethereum comes with a built in transactional layer, which Holochain does not. So in this app we hand-coded a mutual-credit transaction zome to emulate that functionality.
Code Status: Pre-alpha. Not for production use. This application has not been audited for any security validation.
Prerequiste: Install holochain on your machine. You can install HoloDAO very simply with this:
hcdev init -cloneExample=dao
This example has no UI, it's only useful to run from tests.
To run all the stand alone tests:
hcdev test
Currently there is one scenario test:
This scenario spins up an owner node, an implementer node and a bunch of member nodes which create and vote on a bunch of proposals. Finally at the end the implementer executes the proposals.
hcdev -mdns=true -no-nat-upnp scenario -benchmarks benchmark
This will output the detailed benchmark tests including the benchmark data for each node. To see the aggregate benchmark data you can pass the output through the bench.pl
script like this:
hcdev -mdns=true -no-nat-upnp scenario -benchmarks benchmark | perl bench.pl
Which should result in some output something like:
Total chain: 45.22
Total DHT: 1287.27
Total Bytes Sent: 7394.64
Total CPU: 20840
This repo contains a dao ethereum scenario built as a truffle test to calculate how much gas is used to do a similar amount of computation. To install and run this scenario:
npm install -g truffle
cd ethdao
npm install
truffle develop
Then from the truffle command line:
migrate
test
This should produce output that ends with the line something like:
Total Gas Used:6224448
We welcome pull requests and issue tickets. Find us on gitter to chat.
Contributors to this project are expected to follow our development protocols & practices.
Copyright (C) 2017, The MetaCurrency Project (Eric Harris-Braun, Arthur Brock, et. al.)
This program is free software: you can redistribute it and/or modify it under the terms of the license provided in the LICENSE file (GPLv3). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Note: We are considering other 'looser' licensing options (like MIT license) but at this stage are using GPL while we're getting the matter sorted out.