GithubHelp home page GithubHelp logo

alexxnica / stakeweightedvoting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from followmyvote/stakeweightedvoting

0.0 0.0 0.0 5.16 MB

An application to vote on proposals where votes are weighted proportional to the voter's balance of a coin

License: Other

C++ 75.54% QML 16.03% Cap'n Proto 7.94% Python 0.49%

stakeweightedvoting's Introduction

Follow My Vote: Stake-Weighted Voting

This is the official repository for Follow My Vote's Stake-Weighted Voting application.

Linux and Mac are both fully supported. Windows support is pending.

More developers are always welcome! Get started

What's in the box

In this repo are 4 components:

  • The shared folder contains code shared between the other components
  • The StubChainAdaptor folder contains a shared library implementing a dummy blockchain, backend, and wallet
  • The StubBackend folder contains a dummy server daemon which the application can connect to, though by default it is unused
  • The VotingApp folder contains the voting application itself

See Architecture for more information on how the components interact.

Build Instructions

Dependencies:

  • Cap'n Proto 0.5.3+
  • Qt 5.7+ including QBS
  • Botan 1.11.30+
  • Python 2 with PyYAML (to fetch icons)
  • Graphene (Optional)
  • If building with graphene, be sure to set the GRAPHENE_PATH environment variable to the path graphene is installed to
  • Graphene only works with Boost 1.60 and older -- building against 1.61 or later will fail

These video tutorials show how to build and test this project:

Alternatively, for testing/developing only the app, an all-in-one testnet Docker image is available here. This may be used simply by starting the testnet container, following the voting system setup instructions from the beginning to 3:15 (you will not need the GrapheneBackend, as this is in the docker image), then building by clicking the hammer button in the lower left corner of Qt Creator. While that builds, follow the instructions from 7:35 to 10:05 to set up the wallet (the private key to paste in is 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3). Finally, pick up the instructions at 15:00 and follow to the end of the video.

Once the dependencies are installed, building the application is as simple as running qbs in the top-level directory. If this doesn't work, probably qbs is not configured yet or Cap'n Proto is not in PATH. If you use the QtCreator IDE, you can skip configuring qbs manually as QtCreator does this automatically. QtCreator also allows you to customize PATH (and other environment variables) in the Projects pane.

To configure qbs, make sure your compiler is in PATH and run qbs-setup-toolchains --detect. This should configure your toolchain(s) automatically. Next, point it at Qt. If Qt 5.5 is in PATH, you may simply qbs-setup-qt --detect; otherwise, use qbs-setup-qt /path/to/qt5.5/bin/qmake qt5. It may also be necessary to run qbs-config profiles.qt5.baseProfile gcc to direct qbs to use gcc when using the qt5 profile, and/or run qbs-config defaultProfile qt5 to direct qbs to use the qt5 profile by default.

Binaries will be placed in a build folder created by qbs, probably named qt5-debug/install-root or similar, in the top level directory.

Troubleshooting:

If you get any errors like "import qbs.Environment not found", make sure you're using Qt Creator 4

On Mac, it may be necessary to update the PATH variable if CapnProto's binaries are not in PATH. In Qt Creator, you can update this from the Projects view, available in the left nagivation panel. If you've installed CapnProto through Homebrew, you will need to add /usr/local/bin to PATH.

Also on Mac, if Graphene is linked against OpenSSL from Homebrew, linking GrapheneBackend may fail unless the LIBRARY_PATH environment variable is set to /usr/local/lib.

Running:

You may use qbs to run the app:

qbs run -p VotingApp

It's recommended to run the VotingApp through qbs, as qbs will automatically configure the environment so that the app can find the chain adaptor library.

stakeweightedvoting's People

Contributors

kalli8 avatar nathanielhourt avatar neozaru avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.