forked from hpyhacking/peatio
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
105 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class CreateCurrenciesSummary < ActiveRecord::Migration | ||
def change | ||
create_table :currencies_summary do |t| | ||
t.string :currency | ||
t.decimal :locked, :precision => 32, :scale => 16 | ||
t.decimal :balance, :precision => 32, :scale => 16 | ||
t.decimal :hot, :precision => 32, :scale => 16 | ||
t.timestamps | ||
end | ||
create_table :turnover_summary do |t| | ||
t.decimal :btc, :precision => 32, :scale => 16 | ||
t.decimal :ltc, :precision => 32, :scale => 16 | ||
t.decimal :doge, :precision => 32, :scale => 16 | ||
t.decimal :eth, :precision => 32, :scale => 16 | ||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env ruby | ||
require 'rubygems' | ||
require 'daemons/rails/config' | ||
|
||
num = ENV['DEPOSIT_COIN_ADDRESS'] ? ENV['DEPOSIT_COIN_ADDRESS'].to_i : 1 | ||
|
||
num.times do |i| | ||
if pid = fork | ||
Process.detach pid | ||
else | ||
config = Daemons::Rails::Config.for_controller(File.expand_path(__FILE__)) | ||
|
||
config[:app_name] = "peatio:amqp:deposit_coin_address:#{i+1}" | ||
config[:script] = "#{File.expand_path('../amqp_daemon.rb', __FILE__)}" | ||
config[:ARGV] = ARGV + %w(-- deposit_coin_address) | ||
|
||
Daemons::Rails.run config[:script], config.to_hash | ||
|
||
break | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
bundle exec rake assets:precompile | ||
exec ./restart_daemons.sh | ||
sudo service nginx restart | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# stop | ||
bundle exec rake daemon:matching:stop | ||
bundle exec rake daemon:withdraw_coin:stop | ||
bundle exec rake daemon:notification:stop | ||
bundle exec rake daemon:withdraw_audit:stop | ||
bundle exec rake daemon:market_data:stop | ||
bundle exec rake daemon:hot_wallets:stop | ||
bundle exec rake daemon:payment_transaction:stop | ||
bundle exec rake daemon:k:stop | ||
bundle exec rake daemon:websocket_api:stop | ||
bundle exec rake daemon:stats:stop | ||
bundle exec rake daemon:pusher:stop | ||
bundle exec rake daemon:global_state:stop | ||
|
||
bundle exec rake DEPOSIT_COIN=5 daemon:deposit_coin:stop | ||
bundle exec rake TRADE_EXECUTOR=5 daemon:trade_executor:stop | ||
bundle exec rake DEPOSIT_COIN_ADDRESS=4 daemon:deposit_coin_address:stop | ||
bundle exec rake ORDER_PROCESSOR=5 daemon:order_processor:stop | ||
|
||
# start | ||
bundle exec rake daemon:matching:start | ||
bundle exec rake daemon:withdraw_coin:start | ||
bundle exec rake daemon:notification:start | ||
bundle exec rake daemon:withdraw_audit:start | ||
bundle exec rake daemon:market_data:start | ||
bundle exec rake daemon:hot_wallets:start | ||
bundle exec rake daemon:payment_transaction:start | ||
bundle exec rake daemon:k:start | ||
bundle exec rake daemon:websocket_api:start | ||
bundle exec rake daemon:stats:start | ||
bundle exec rake daemon:pusher:start | ||
bundle exec rake daemon:global_state:start | ||
|
||
bundle exec rake DEPOSIT_COIN=5 daemon:deposit_coin:start | ||
bundle exec rake TRADE_EXECUTOR=5 daemon:trade_executor:start | ||
bundle exec rake DEPOSIT_COIN_ADDRESS=4 daemon:deposit_coin_address:start | ||
bundle exec rake ORDER_PROCESSOR=5 daemon:order_processor:start | ||
|
||
|