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.
- 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-recoveryconfigure option)
- Fork this repo!
- Generate encrypted credentials with
bin/rails credentials:edit. Useconfig/encrypted_secrets_quickstart.ymlto see what values are needed for what environments. - Setup your instance:
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.
export PUZZLE_ADMIN_EMAIL=your@email.com 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 - Assuming that all goes well, there will be a URL you can visit to claim an admin account and setup a password/2FA.
- In admin, create a new Cosmos chain with the chain name and gaiad RPC/LCD info. Make sure to click 'enable' at the top.
- Next ssh into the machine, start
screenand do the initial sync:That will take a good long while depending on how long the chain you're syncing has been going for.cd /puzzle/app/current bin/rake sync:cosmos:all events:cosmos:all stats:cosmos:all - Once it's done, you will want to install the crontab entries. You can either run
bin/bundle exec whenever --update-crontabright now, or just deploy again and they'll get installed automatically.
- Pull the repo into your local environment
- Install rbenv using the instructions at https://github.com/rbenv/ruby-build#readme.
- Make sure you have Ruby 2.5.1 and bundler 2.0 installed on your local machine.
- If you don't have postgres installed, run
sudo apt updateand thensudo apt install postgresql postgresql-contrib ruby-dev nodejs yarnto install postgres. - Go into
/etc/postgresql/10/mainand open pga_gba.conf in your text editor. (sudo nano pg_hba.conf) - anywhere you see
local all postgres peeror any variation of that, edit the last word totrust. Some of these might saypeer, some might saymd5, etc. Save the file. - run
sudo service postgresql restart. - You'll also need to run
apt install -y libpq-devif you're on ubuntu. - Run
bundle installfrom the project root. - create the database by running
rake db:createandrake db:migrate.rake db:migratemight fail the first time but it should succeed on subsequent tries. - run
rails db:seed. You should get an output withAdmin Created:followed by a URL. You'll need this in the next step. - run
rails s. Go to the URL and create a password. - 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.
- Check to see that you have deployment scripts in /bin. You should see one called deploy-production.sh and one called deploy-staging.sh
- 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)
- 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