GithubHelp home page GithubHelp logo

pawelnguyen / puzzle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from khoazany/hubble

0.0 1.0 0.0 2.28 MB

Helping you to fit the pieces together.

Home Page: https:puzzle.report

License: Other

Ruby 45.22% JavaScript 19.04% HTML 31.89% Shell 0.88% SCSS 2.97%

puzzle's Introduction

Why Puzzle?

After working to pass a handful of proposals on the Secret Network, it has become painfully obvious the governance experience needs to be made more accessible and users need to be further empowered to stay informed on the state of the network. While stakeholders currently have access to the information regarding proposals from current block explorers like the one hosted by cashmaney, stakeholders still lack a comprehensive resource that really empowers them to more actively participate in the governance process.

To address this, secretnodes.org has worked to launch Puzzle, an open-source project forked from Hubble. Once we’ve deemed Puzzle as stable and production-ready, we plan to use this as a foundational layer to solve for the pain points preventing stakeholders from keeping up with network related events. Through experimentation and collaboration with the community, our mission is to make the process of staying up to date on all network activity as seamless as possible.

Made with ❤️ by secretnodes.org. Originally forked from the hubble Q4 2019 update.

Dependencies

  • Ruby 2.5+
  • Node LTS
  • Accessible PostgreSQL database.
  • Memcached running on localhost.
  • PostMark account for email notifications.
  • Rollbar account for exception tracking.
  • libsecp25k1 (with --enable-module-recovery configure option)

How to Setup Puzzle

  1. Fork this repo!
  2. Generate encrypted credentials with bin/rails credentials:edit. Use config/encrypted_secrets_quickstart.yml to see what values are needed for what environments.
  3. Setup your instance:
    export [email protected]
    export PUZZLE_HOST=ip-or-hostname-of-server
    export PUZZLE_RAILS_ENV=production
    export PUZZLE_KEY=~/.ssh/puzzle-key.pem
    export PUZZLE_DOMAIN=puzzle.your.domain
    export PUZZLE_REMOTE_USER=puzzle
    ./setup/bootstrap.sh
    
    This automated process is meant for a Ubuntu 18.04 LTS install. We use AWS for this. Puzzle uses HTTPS everywhere, so watch the output for when it asks you to create a DNS record.
  4. Assuming that all goes well, there will be a URL you can visit to claim an admin account and setup a password/2FA.
  5. In admin, create a new Cosmos chain with the chain name and gaiad RPC/LCD info. Make sure to click 'enable' at the top.
  6. Next ssh into the machine, start screen and do the initial sync:
    cd /puzzle/app/current
    bin/rake sync:cosmos:all events:cosmos:all stats:cosmos:all
    
    That will take a good long while depending on how long the chain you're syncing has been going for.
  7. Once it's done, you will want to install the crontab entries. You can either run bin/bundle exec whenever --update-crontab right now, or just deploy again and they'll get installed automatically.

Development

  1. Pull the repo into your local environment
  2. Install rbenv using the instructions at https://github.com/rbenv/ruby-build#readme.
  3. Make sure you have Ruby 2.5.1 and bundler 2.0 installed on your local machine.
  4. If you don't have postgres installed, run sudo apt update and then sudo apt install postgresql postgresql-contrib ruby-dev nodejs yarn to install postgres.
  5. Go into /etc/postgresql/10/main and open pga_gba.conf in your text editor. (sudo nano pg_hba.conf)
  6. anywhere you see local all postgres peer or any variation of that, edit the last word to trust. Some of these might say peer, some might say md5, etc. Save the file.
  7. run sudo service postgresql restart.
  8. You'll also need to run apt install -y libpq-dev if you're on ubuntu.
  9. Run bundle install from the project root.
  10. create the database by running rake db:create and rake db:migrate. rake db:migrate might fail the first time but it should succeed on subsequent tries.
  11. run rails db:seed. You should get an output with Admin Created: followed by a URL. You'll need this in the next step.
  12. run rails s. Go to the URL and create a password.
  13. That's it! Your development environment is now set up.

PS: If your environment is on a server and you need to test on your local machine, you can get a server running on your box and then use ngrok to create a tunnel.

How to Deploy

  1. Check to see that you have deployment scripts in /bin. You should see one called deploy-production.sh and one called deploy-staging.sh
  2. If you do not have one or both of these scripts, create them and use bin/sample-deploy.sh to set them up (ask jacob if you need help)
  3. from the project root folder, run
bin/deploy-{RAILS_ENV}.sh

Or do it manually:

RAILS_ENV=staging DEPLOY_USER=puzzle DEPLOY_HOST=ip-or-hostname DEPLOY_KEYS=~/.ssh/puzzle.pem bin/bundle cap staging deploy

puzzle's People

Contributors

dependabot[bot] avatar jacobtjackson avatar lacabra avatar privatepixels avatar rfunduk avatar

Watchers

 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.