Code Monkey home page Code Monkey logo

townhall's Introduction

Menlo One TownHall has been replaced by Menlo One Expo

Click through to the Expo Github

Find out about Menlo: https://www.menlo.one/

(Deprecated)

https://www.menlo.one/#/townhall

Development

To develop and run the town hall locally, install the following prerequisites and dependencies before running the app.

Prerequisites

Brew

We assume brew for package management to install IPFS and other dependencies:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

IPFS

TownHall uses IPFS for storage of messages.

Menlo specific setup of IPFS can be installed and configured via:

    yarn run menlo:setup

Metamask

Metamask or Mist should be used for interacting with the town hall dapp.

Install Metamask extensions into your browser of choice, Chrome or Brave supported: http://metamask.io

Import development chain account

Import this private key into MetaMask for use with truffle develop and Ganache:

    388c684f0ba1ef5017716adb5d21a053ea8e90277d0868337519f97bede61418

import MetaMask

Install app and dependencies

  1. Install nvm and node: brew install nvm && nvm install
  2. Clone the repo: git clone [email protected]:MenloOne/townhall.git
  3. Install dependencies: cd townhall && nvm use && yarn install

Run the application

  1. Run a local dev blockchain in a separate window: yarn run truffle develop
  2. Run IPFS daemon in a separate window: ipfs daemon
  3. Now, deploy the contracts: yarn run truffle deploy --network develop
  4. Run the app: yarn start

Interact with TownHall

A browser window should open after starting: http://localhost:3000/

Ensure you are logged into MetaMask and switch to your imported account.

Set the network in MetaMask to http://127.0.0.1:9545/, add a Custom RPC if that network doesn't already exist:

MetaMaskNetwork

Ganache

For a light, easy to use private chain with a visual and cli interface, try Ganache.

You can deploy and test using network ganache:

yarn run truffle deploy --network ganache

Note: Ganache and truffle develop are transitory. Once you shut them down, you will have to redeploy the contracts and redo any needed transactions.

Integration

For a persistent local testing environment to test before deploying to testnet or mainnet, use a Dev chain with Parity or Geth.

You can set the following environment variables in your local .env file to run against a local dev chain if you already have Parity or Geth configured or set with needed accounts:

- MENLO_TENET_1: Address for first tenet account.
- MENLO_TENET_2: Address for second tenet account.
- MENLO_TENET_3: Address for third tenet account.
- MENLO_POSTER: Address for the account used to interact with town hall.

Parity

To run a private dev chain with Parity, first run a dev chain, setup Menlo accounts, and then deploy contracts.

Install Parity

Installing Parity:

    brew install parity

Run unlocked dev chain

Assuming a default Parity setup, the initial dev account address is static:

   0x00a329c0648769A73afAc7F9381E08FB43dBEA72

You need to unlock your dev account to be able to run Truffle migrations easily. The following script runs parity with an unlocked dev account, it will need to be modified if you've changed the default dev account:

    ./scripts/parity-unlocked-dev.sh

Set up Menlo accounts

Create the needed Menlo accounts:

    yarn run truffle menlo:create-integration-accounts

After running the account creation, a set of accounts will be displayed to add to your .env file.

Add MENLO_TENET_1, MENLO_TENET_2, MENLO_TENET_3, and MENLO_POSTER to you .env.

Deploy Contracts

Once you add the environment variables to your account, rerun parity with the helper script:

    yarn run menlo:parity-dev-chain

Now deploy the contracts, use the integration network defined in truffle.js when using parity.

    yarn run truffle deploy --network integration

Your contracts will live between parity dev runs, you can check the contracts addresses to watch with truffle network.

Browse http://localhost:8180 to interact with the Parity wallet.

Parity has a lot of config and features: Read the effin manual

Subsequent runs

    yarn run menlo:parity-dev-chain

Testing

For testing the TownHall dapp:

  yarn test

For testing the town hall contracts:

  dapp update
  dapp test

Deployment

Set the following environment variables:

      1. MENLO_DEPLOYMENT_KEY:
      2. MENLO_DEPLOYMENT_SERVER:

Deploy to server using shipit:

  yarn run menlo:deploy

Staging and Testnet

Rinkeby & Mist

MetaMask can be used with a Rinkeby account to test against.

The Mist browser can be used to test the Rinkeby testnet.

Mist uses Geth underneath:

    brew install geth

Run Geth against Rinkeby with the Apis needed by Truffle:

    geth --rinkeby --rpc --rpcapi db,eth,net,web3,personal --rpccorsdomain http://localhost:3000

Now, run Mist against your local instance of Geth:

    /Applications/Mist.app/Contents/MacOS/Mist --rpc http://127.0.0.1:8545

Wait for the blocks to sync , (go for a walk and enjoy the sunshine).

After the blocks sycn, note your account hash in the Mist Wallet, you'll need it later.

Close Mist, Stop Geth.

Now, run Geth with the account you noted above unlocked:

    geth --rinkeby --rpc --rpcapi db,eth,net,web3,personal --unlock="0x4B71d4020a69902E6cB1d9a387a03cF0a839d33b" --rpccorsdomain http://localhost:3000

Run Mist again:

    /Applications/Mist.app/Contents/MacOS/Mist --rpc http://127.0.0.1:8545

Now you are ready to deploy contracts and test:

    yarn run truffle deploy --network rinkeby

Go to the faucet to get some free Ether: Rinkeby Faucet

Give your Mist account some TK/MET tokens:

    yarn run truffle console --network rinkeby

Run the Town Hall and browse in Mist to http://localhost:3000.

Kovan

TBD

    parity --chain kovan

Production and Mainnet

...

Overriding the default configuration

This repo uses create-react-app environment variables.

townhall's People

Contributors

afdudley avatar daviddfm avatar gustin avatar jayden avatar matthewnolan avatar patmaddox avatar wjmelements avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

townhall's Issues

CORS setup?

The Menlo One readme says to temporarily disable CORS, and then gives the code which, according to IPFS is the same code used to enable CORS.

From IPFS:

Note: If you load your app from a different domain than the one the daemon is running (most probably), you will need to set up CORS, see https://github.com/ipfs/js-ipfs-api#cors to learn how to do that.

A quick (and dirty way to get it done) is:

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "["*"]"
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials "["true"]"

Github Permissions

Hi Guys, when trying to run:

git clone [email protected]:vulcanize/message_board_reactjs.git

I get:
Cloning into 'message_board_reactjs'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Attribution and Tests

Hello,
I am the contractor that wrote the solidity for this repo. I request the following changes.

  • Please restore my copyright to the solidity source. You can keep your copyright, but mine must be also be included.
  • Please restore the tests I wrote. You can find them here. The dapp test instructions provided in your readme do not work. Once you have restored the tests, please update the instructions in your readme.

Thanks!

Public permissions

Are we sure that the public repo can be cloned and users have rights to clone it?

I'm getting this:

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

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.