Giter Site home page Giter Site logo

moloch-pokemol's Introduction

Pocket Moloch aka Pokémol

Bare bones, mobile-first set up for Moloch frontend with Abridged Wallet SDK by Odyssy

Development

  1. Install dependencies
$ yarn install
  1. Run a dev server
$ yarn start

Linting

Set up auto-linting and prettier to be run on file save or in real-time in your IDE: VSCode.

Deployment instructions

Assumes the moloch contracts are forked and deployed to mainnet and kovan if you need testnet support. You will also need an infura endpoint.

1. Fork and deploy the subgraph(s)

https://github.com/MolochVentures/moloch-monorepo/tree/master/packages/subgraph

Update the contract address(es) and deploy: https://thegraph.com/docs/deploy-a-subgraph

2. Build the AWS resources

Use the serverless framework to get this started. You'll need to install the serveless cli: https://serverless.com/framework/docs/getting-started/

Set up your AWS access keys, add them to your aws profile and assign the profile in this serverless.yaml https://serverless.com/framework/docs/providers/aws/guide/credentials/

provider:
  name: aws
  runtime: nodejs8.10
  stage: dev
  region: us-east-1
  profile: <your profile name>

This will build a CloudFormation stack with

  • Cognito indentity pool and user pool
  • s3 bucket for storing proposal and member metadata
  • s3 bucket for hosting the build files and the CloudFront distribution for the front end hosting.

Update the service name in serveless.yml line 1

service: <name of your app>

Build the resources:

staging/kovan:
$ serverless deploy --stage prod

prod/mainnet
$ serverless deploy --stage mainnet

Manually add custom field to the Cognito user pool. in the AWS console navigate to cognito/users and select the new pool that was created. You can add fields in the Attibutes section.

All are type: string, min-length: 1, max-length: 256 and mutable

  • device_address
  • account_address
  • ens_name
  • encrypted_ks (max length 2000)
  • named_devices (max length 2000)

3. Update your .env file with the contract addresses, infura enpoint, subgraph endpoint(s) new AWS resource information. You can find all of the AWS resrouce information in the AWS console in the respective areas.

REACT_APP_SDK_ENV=
REACT_APP_GRAPH_NODE_URI=
REACT_APP_INFURA_URI=
REACT_APP_CONTRACT_ADDRESS=
REACT_APP_S3_REGION=
REACT_APP_S3_BUCKET=
REACT_APP_COGNITO_REGION=
REACT_APP_COGNITO_USER_POOL_ID=
REACT_APP_COGNITO_APP_CLIENT_ID=
REACT_APP_COGNITO_IDENTITY_POOL_ID=

5. Build and deploy the app

Sync production build to S3 and invalidate the cloudfront cache.

build the app for dev/kovan:
$ yarn build

build the app for dev/kovan:
$ yarn prod-build

You could use the aws cli to do this if you want to:

$ aws s3 sync build/ s3://<your s3> --profile <your profile name>

invalidate cloudfront cache:
$ aws cloudfront create-invalidation --distribution-id <your distribution id> --paths /\* --profile <your profile name>

Custom domain set up

You will need to set up an ssl cert and point some cname records at the cloudfront distibution. Detailed instructions here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-alternate-domain-names.html

  1. Get a ssl cert from ACM. You'll have to verify domain ownership by adding a cname record where you're domain is managed. happe

  2. Update your CloudFront distribution to use the new certificate once it is provisioned.

  3. Create cname records to point the domain at the CloudFront url

moloch-pokemol's People

Contributors

dekanbro avatar skuhlmann avatar rhlsthrm avatar phys3 avatar oovg avatar tovarishfin avatar

Stargazers

Mako Shan avatar AB avatar Andrey Gulitsky avatar Ross Campbell avatar _g4brielShapir0 avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

moloch-pokemol's Issues

Moloch social links

Current moloch dapp has social icon/links to twitter and telegram in the header. Might need to find a place for these.

Screenshot from 2020-01-10 08-52-16

Share value estimator

Add to proposal creation page. Calculate based on outstanding shares plus shares in queued proposals (to give "worst-case" estimate).

Remove s3 dependency

Can we add the 'link' field into the json that goes in the contract details field?

It would allow us to remove all s3 reliance for proposal metadata

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.