Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Angel Shares Explorer
Ruby CSS JavaScript CoffeeScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
doc
lib
public
script
spec
vendor
.gitignore
.rspec
.rvmrc
Capfile
Gemfile
Gemfile.lock
Guardfile
README.rdoc
Rakefile
config.ru

README.rdoc

Welcome to AGSExplorer

AGSExplorer (agsexplorer.com) is an blockchain based AngelShares explorer. It's created to help donator to view real-time donation in BTC and PTS, help decide when and what amount to donate and check AGS balance. If you don't know what AngelShares is, please visit invictus-innovations.com/angelshares for more information.

Dependency

This is a typical Rails application, it follows many conventions of Rails. Requires Ruby 1.9+.

1.Install Dependent Gems

bundle install

2.Setup Configuration Files

# application configs
cp config/app_config.rb.sample config/app_config.rb

# database connection, by default postgresql db
cp config/database.yml.sample config/database.yml

# deployment recipe, rely on multiple-stage capistrano
cp config/deploy/production.rb.sample config/deploy/production.rb

3.Run DB migrate

# migrate db structure
bundle exec rake db:migrate

4.Parse Data

Blockchain data is previously powered by @Donschoe's AGS-PARSE v0.5 (github.com/donSchoe/ags-parser)

Now it's using optimized version of ags-parser, check it out at github.com/AlexChien/ags-parser

# wipe out db data and re-parse data from day1
bundle exec rake donation:reset

Useful Rake tasks

# wipe out db data and re-parse data from day1
bundle exec rake donation:reset

# calcuate AGS reward for specific day, default yesterday
bundle exec rake donation:calculate_ags_reward

# calculate AGS reward from day1 till xx, default yesterday
bundle exec rake donation:calculate_ags_reward_till

Cron jobs

Whenever gem provides easy access to cron jobs, view config/schedule.rb for detail. Several cron jobs are created by default.

  • Every 1 minute, fetch new data and parse them.

  • Every 1 minute, fetch price ticker from bter.com for BTC/PTS/USD.

  • Every day and 00:02am, calculate yesterday's AGS reward for each donation.

  • Every day and 00:02am, calculate wallet's AGS balance.

Deployment

1.A nginx conf sample can be found in config/deploy/nginx.conf.erb, view capistrano-nginx(github.com/ivalkeen/capistrano-nginx) for more information

cap production nginx:setup #setup nginx conf
cap production nginx:reload #tell nginx to reload conf

2.Multiple-stage capistrano deployment, view capistano-multistage(github.com/TechnoGate/capistrano-multistage) for more information

cap production deploy # make full deployment on producton server
cap staging deploy:restart #restart app on staging server

Contributing

  1. Fork it

  2. Create your feature branch (git checkout -b my-new-feature)

  3. Commit your changes (git commit -am 'Added some feature')

  4. Push to the branch (git push origin my-new-feature)

  5. Create new Pull Request

Contact

Written in 2014 by Alex Chien (Boombastic), contact me at alexchien97[at]gmail.com. Licensed under the GPLv3.

Donations are welcome:

  • BTC: 1Bb6V1UStz45QMAamjaX8rDjsnQnBpHvE8

  • PTS: PgULYtxcDJM7SKABfECipFiSjrmtjiPQd9

Something went wrong with that request. Please try again.