diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aad5ceb --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.o +*.a +stratum/stratum +stratum/blocknotify +*.log +web/yaamp/runtime/* + diff --git a/README.md b/README.md index 77fc76f..cd7f3b4 100755 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -#yaamp +#yiimp - yaamp fork Required: - linux, mysql, php, web engine, memcached + linux, mysql, php, memcached Config for nginx: @@ -20,7 +20,7 @@ Config for nginx: include fastcgi_params; } -If you use apache, it should be something like: +If you use apache, it should be something like (set in web/.htaccess): RewriteEngine on @@ -57,7 +57,7 @@ All your coin's config files need to blocknotify their corresponding stratum usi blocknotify=/var/stratum/blocknotify yaamp.com:port coinid %s -On the website, go to http://server.com/site/frottedessus to login as admin. You have to change it to something different in the code (web/yaamp/modules/site/SiteController.php). +On the website, go to http://server.com/site/admintest to login as admin. You have to change it to something different in the code (web/yaamp/modules/site/SiteController.php). There are logs generated in the /var/stratum folder and /var/log/stratum/debug.log for the php log. diff --git a/blocknotify/Makefile b/blocknotify/Makefile new file mode 100644 index 0000000..45a051a --- /dev/null +++ b/blocknotify/Makefile @@ -0,0 +1,25 @@ + +CC=gcc + +CFLAGS=-c -g -I /usr/include/mysql -march=native +LDFLAGS=-g + +#CFLAGS=-c -O2 -I /usr/include/mysql +#LDFLAGS=-O2 + +LDLIBS=-lstdc++ + +SOURCES=blocknotify.cpp + +OBJECTS=$(SOURCES:.cpp=.o) +OUTPUT=blocknotify + +all: $(SOURCES) $(OUTPUT) + +install: all + strip -s $(OUTPUT) + cp $(OUTPUT) /usr/local/bin/ + +clean: + rm -f *.o + rm -f $(OUTPUT) diff --git a/blocknotify/blocknotify.cpp b/blocknotify/blocknotify.cpp old mode 100755 new mode 100644 diff --git a/log/.gitignore b/log/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/stratum/makefile b/stratum/makefile deleted file mode 100755 index 47d62f8..0000000 --- a/stratum/makefile +++ /dev/null @@ -1,53 +0,0 @@ - -CC=gcc - -CFLAGS=-c -g -I /usr/include/mysql -LDFLAGS=-g - -#CFLAGS=-c -O2 -I /usr/include/mysql -#LDFLAGS=-O2 - -LDLIBS=iniparser/libiniparser.a algos/libalgos.a sha3/libhash.a -lmysqlclient -lpthread -lm -lstdc++ - -SOURCES=stratum.cpp db.cpp coind.cpp coind_aux.cpp coind_template.cpp coind_submit.cpp util.cpp list.cpp \ - rpc.cpp job.cpp job_send.cpp job_core.cpp merkle.cpp share.cpp socket.cpp coinbase.cpp \ - client.cpp client_submit.cpp client_core.cpp client_difficulty.cpp remote.cpp remote_template.cpp \ - user.cpp object.cpp json.cpp base58.cpp - -OBJECTS=$(SOURCES:.cpp=.o) -OUTPUT=stratum - -CODEDIR1=algos -CODEDIR2=sha3 - -.PHONY: projectcode1 projectcode2 - -all: projectcode1 projectcode2 $(SOURCES) $(OUTPUT) - -projectcode1: - $(MAKE) -C $(CODEDIR1) - -projectcode2: - $(MAKE) -C $(CODEDIR2) - -$(SOURCES): stratum.h util.h - -$(OUTPUT): $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@ - -.cpp.o: - $(CC) $(CFLAGS) $< - -.c.o: - $(CC) $(CFLAGS) $< - -clean: - rm *.o -# rm algos/*.o -# rm sha3/*.o - -install: all - cp stratum release - strip release/stratum - - diff --git a/web/.htaccess b/web/.htaccess new file mode 100644 index 0000000..9d3be03 --- /dev/null +++ b/web/.htaccess @@ -0,0 +1,10 @@ +RewriteEngine On + +#RewriteCond %{REQUEST_FILENAME} -s [OR] +#RewriteCond %{REQUEST_FILENAME} -l [OR] +#RewriteCond %{REQUEST_FILENAME} -d +#RewriteRule ^.*$ - [NC,L] +#RewriteRule ^.*$ index.php [NC,L] + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^(.*) index.php?r=$1 [QSA] diff --git a/web/.project b/web/.project deleted file mode 100644 index 880d08e..0000000 --- a/web/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - web - - - - - - org.eclipse.wst.validation.validationbuilder - - - - - org.eclipse.dltk.core.scriptbuilder - - - - - - org.eclipse.php.core.PHPNature - - diff --git a/web/framework-1.0.8/base/CErrorHandler.php b/web/framework-1.0.8/base/CErrorHandler.php index 6173cd2..5559c37 100644 --- a/web/framework-1.0.8/base/CErrorHandler.php +++ b/web/framework-1.0.8/base/CErrorHandler.php @@ -295,7 +295,7 @@ class CErrorHandler extends CApplicationComponent { if(YII_DEBUG) { - $version='yaamp.com'; + $version='yiimp.ccminer.org'; if(isset($_SERVER['SERVER_SOFTWARE'])) $version=$_SERVER['SERVER_SOFTWARE'].' '.$version; } diff --git a/web/index.php b/web/index.php index c6691ce..8b86c7e 100644 --- a/web/index.php +++ b/web/index.php @@ -1,11 +1,15 @@ 0.10, -); - - diff --git a/web/serverconfig.php b/web/serverconfig.php new file mode 120000 index 0000000..50b45cf --- /dev/null +++ b/web/serverconfig.php @@ -0,0 +1 @@ +/etc/yamp/serverconfig.php \ No newline at end of file diff --git a/web/serverconfig.sample.php b/web/serverconfig.sample.php new file mode 100644 index 0000000..5d61a0b --- /dev/null +++ b/web/serverconfig.sample.php @@ -0,0 +1,30 @@ + 0.10, +); + + diff --git a/web/yaamp/config.php b/web/yaamp/config.php index 2b051e5..d03f2fd 100644 --- a/web/yaamp/config.php +++ b/web/yaamp/config.php @@ -1,7 +1,7 @@ 'yaamp.com', + 'name'=>YAAMP_SITE_URL, 'defaultController'=>'site', 'layout'=>'main', @@ -14,25 +14,31 @@ return array( 'preload'=>array('log'), 'import'=>array('application.components.*'), // 'params'=>require("siteconfig.php"), - + 'components'=>array( 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>false, 'appendParams'=>false, + 'caseSensitive'=>false, + 'rules'=>array( + '/'=>'/view', + '//'=>'/', + '/'=>'/', + ), ), 'assetManager'=>array( 'basePath'=>YAAMP_HTDOCS."/assets"), - + 'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array( 'class'=>'CFileLogRoute', 'levels'=>'error, warning', - // 'levels'=>'trace, error, warning', +// 'levels'=>'debug, trace, error, warning', ), // array( // 'class'=>'CProfileLogRoute', @@ -49,16 +55,16 @@ return array( 'db'=>array( 'class'=>'CDbConnection', 'connectionString'=>"mysql:host=".YAAMP_DBHOST.";dbname=".YAAMP_DBNAME, - + 'username'=>YAAMP_DBUSER, 'password'=>YAAMP_DBPASSWORD, - + 'enableProfiling'=>false, 'charset'=>'utf8', 'schemaCachingDuration'=>3600, ), ), - + ); diff --git a/web/yaamp/core/backend/blocks.php b/web/yaamp/core/backend/blocks.php index 939f878..71dde78 100644 --- a/web/yaamp/core/backend/blocks.php +++ b/web/yaamp/core/backend/blocks.php @@ -226,7 +226,7 @@ function MonitorBTC() $txurl = "https://blockchain.info/tx/{$transaction['txid']}"; - $b = mail('yaamp201@gmail.com', "withdraw {$transaction['amount']}", + $b = mail(YAAMP_ADMIN_EMAIL, "withdraw {$transaction['amount']}", "{$transaction['address']}"); if(!$b) debuglog('error sending email'); diff --git a/web/yaamp/core/backend/rawcoins.php b/web/yaamp/core/backend/rawcoins.php index 52d2192..afd5f7b 100644 --- a/web/yaamp/core/backend/rawcoins.php +++ b/web/yaamp/core/backend/rawcoins.php @@ -96,7 +96,7 @@ function updateRawCoin($marketname, $symbol, $name='unknown') $coin->created = time(); $coin->save(); - mail('yaamp201@gmail.com', "New coin $symbol", "new coin $symbol ($name) on $marketname"); + mail(YAAMP_ADMIN_EMAIL, "New coin $symbol", "new coin $symbol ($name) on $marketname"); sleep(30); } diff --git a/web/yaamp/core/backend/services.php b/web/yaamp/core/backend/services.php index 5c3d348..2b5026c 100644 --- a/web/yaamp/core/backend/services.php +++ b/web/yaamp/core/backend/services.php @@ -10,14 +10,18 @@ function BackendUpdateServices() 2=>'scryptn', 3=>'x11', 4=>'x13', + 5=>'keccak', 6=>'x15', 7=>'nist5', 8=>'neoscrypt', 9=>'lyra2', + 10=>'whirlx', 11=>'qubit', 12=>'quark', + + 111=>'c11', ); - + $res = fetch_url('https://www.nicehash.com/api?method=stats.global.current'); if(!$res) return; diff --git a/web/yaamp/core/backend/system.php b/web/yaamp/core/backend/system.php index 7b8db09..90a4cf6 100644 --- a/web/yaamp/core/backend/system.php +++ b/web/yaamp/core/backend/system.php @@ -242,7 +242,7 @@ function BackendRunCoinActions() // fclose($file); // controller()->memcache->set('stratum_log_size', $filesize); -// system("echo \"$data\" | mail -s \"yaamp server\" yaamp201@gmail.com"); +// system("echo \"$data\" | mail -s \"yiimp server\" ".YAAMP_ADMIN_EMAIL); } diff --git a/web/yaamp/core/common/Shortcuts.php b/web/yaamp/core/common/Shortcuts.php index fc6e4bc..afffb5c 100644 --- a/web/yaamp/core/common/Shortcuts.php +++ b/web/yaamp/core/common/Shortcuts.php @@ -36,7 +36,7 @@ function bu($url=null) { static $baseUrl; if ($baseUrl===null) - $baseUrl=Yii::app()->request->baseUrl; + $baseUrl=Yii::app()->request->baseUrl; return $url===null ? $baseUrl : $baseUrl.'/'.ltrim($url,'/'); } @@ -50,11 +50,11 @@ function user() { return Yii::app()->user; } - -function now() -{ - return date("Y-m-d H:i:s"); -} + +function now() +{ + return date("Y-m-d H:i:s"); +} ///////////////////////////////////////////////////////////// @@ -72,6 +72,6 @@ function JavascriptReady($javascript) { echo ""; } - + diff --git a/web/yaamp/core/common/system.php b/web/yaamp/core/common/system.php index 7ece5cb..f3ce5a6 100644 --- a/web/yaamp/core/common/system.php +++ b/web/yaamp/core/common/system.php @@ -7,9 +7,9 @@ function send_email_alert($name, $title, $message, $t=10) $last = memcache_get(controller()->memcache->memcache, "last_email_sent_$name"); if($last + $t*60 > time()) return; - debuglog("mail('yaamp201@gmail.com', $title, ...)"); + debuglog("mail('".YAAMP_ADMIN_EMAIL."', $title, ...)"); - $b = mail('yaamp201@gmail.com', $title, $message); + $b = mail(YAAMP_ADMIN_EMAIL, $title, $message); if(!$b) debuglog('error sending email'); memcache_set(controller()->memcache->memcache, "last_email_sent_$name", time()); diff --git a/web/yaamp/core/exchange/bittrex.php b/web/yaamp/core/exchange/bittrex.php old mode 100755 new mode 100644 diff --git a/web/yaamp/core/exchange/bleutrade.php b/web/yaamp/core/exchange/bleutrade.php old mode 100755 new mode 100644 diff --git a/web/yaamp/core/exchange/ccexapi.php b/web/yaamp/core/exchange/ccexapi.php old mode 100755 new mode 100644 diff --git a/web/yaamp/core/exchange/cryptsy.php b/web/yaamp/core/exchange/cryptsy.php old mode 100755 new mode 100644 diff --git a/web/yaamp/core/exchange/jubi.php b/web/yaamp/core/exchange/jubi.php old mode 100755 new mode 100644 diff --git a/web/yaamp/core/exchange/poloniex.php b/web/yaamp/core/exchange/poloniex.php old mode 100755 new mode 100644 diff --git a/web/yaamp/core/exchange/yobit.php b/web/yaamp/core/exchange/yobit.php old mode 100755 new mode 100644 diff --git a/web/yaamp/core/exchange2/CExchange.php b/web/yaamp/core/exchange2/CExchange.php index 430cebf..d5e0cf2 100644 --- a/web/yaamp/core/exchange2/CExchange.php +++ b/web/yaamp/core/exchange2/CExchange.php @@ -1,198 +1,199 @@ -marketname = $marketname; - } - - public function doTrading() - { - $this->orders = $this->loadOrders(); - foreach($this->orders as $order) - { - $cexcoin = new CExchangeCoin($order->coin, $this->marketname); - // cancel if too high - // add to our db if not there already - } - - $list = getdbolist('db_orders', "market='$this->marketname'"); - foreach($list as $db_order) - { - $found = false; - foreach($this->orders as $order) - { - if($order->orderid == $db_order->uuid) - { - $found = true; - break; - } - } - - if(!$found) - { - debuglog("$this->marketname deleting order"); - $db_order->delete(); - } - } - - $savebalance = getdbosql('db_balances', "name='cryptsy'"); - $savebalance->balance = 0; - - $this->balances = $this->loadBalances(); - foreach($this->balances as $balance) - { - if($balance->amount <= 0) continue; - $cexcoin = new CExchangeCoin($balance->coin, $this->marketname); - - foreach($cexcoin->bids as $bid) - { - if($balance->amount*1.5 < $bid->amount && !$coin->sellonbid) break; - - $sellamount = min($balance->amount, $bid->price); - if($sellamount*$bid->price < $this->get_mintrade()) continue; - - $cex->sell($sellamount, $bid->price); - $balance->amount -= $sellamount; - - sleep(1); - } - - $cexcoin = new CExchangeCoin($balance->coin, $this->marketname); - if($balance->amount*$cexcoin->ask < $this->get_mintrade()) continue; - - $cex->sell($balance->amount, $cexcoin->ask); - sleep(1); - } - - if($this->balance_btc >= $this->get_minwithdraw()) - { - debuglog("withdraw $this->marketname $this->balance_btc"); - $this->withdraw($this->balance_btc); - } - } - -}; - -//////////////////////////////////////////////////////////////////////////////////////////////// - -class CExchangeCryptsy extends CExchange -{ - protected function loadOrders() - { - $ordertab = array(); - - $orders = cryptsy_api_query('allmyorders'); - if(!$orders) return $ordertab; - if(!isset($orders['return'])) return $ordertab; - - foreach($orders['return'] as $order) - { - if(!isset($order['marketid'])) continue; - if(!isset($order['orderid'])) continue; - - $object = new object(); - $object->orderid = $order['orderid']; - $object->price = $order['price']; - $object->amount = $order['quantity']; - $object->marketid = $order['marketid']; - - $market = getdbosql('db_markets', "marketid=$object->marketid"); - if(!$market) continue; - - $object->coin = getdbo('db_coins', $market->coinid); - if(!$object->coin) continue; - - $ordertab[] = $object; - } - - return $ordertab; - } - - protected function loadBalances() - { - $balancetab = array(); - - $balances = cryptsy_api_query('getinfo'); - if(!$balances) return; - if(!isset($balances['return'])) - { - debuglog($balances); - return $balancetab; - } - - foreach($balances['return']['balances_available'] as $symbol=>$balance) - { - $balance = floatval($balance); - - if($symbol == 'Points') continue; - if($symbol == 'BTC') - { - $this->balance_btc = floatval($balance); - continue; - } - - if($symbol == 'LTC') - { - $this->balance_ltc = floatval($balance); - continue; - } - - if(!$balance) continue; - - $object = new object(); - $object->balance = $balance; - - $object->coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol)); - if(!$object->coin) continue; - - $balancetab[] = $object; - } - - return $balancetab; - } - - protected function withdraw($amount) - { - $res = cryptsy_api_query('makewithdrawal', array('address'=>'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9', 'amount'=>$amount)); - debuglog($res); - - if($res && $res['success']) - { - $withdraw = new db_withdraws; - $withdraw->market = 'cryptsy'; - $withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; - $withdraw->amount = $amount; - $withdraw->time = time(); - $withdraw->save(); - } - } - -}; - - - - +marketname = $marketname; + } + + public function doTrading() + { + $this->orders = $this->loadOrders(); + foreach($this->orders as $order) + { + $cexcoin = new CExchangeCoin($order->coin, $this->marketname); + // cancel if too high + // add to our db if not there already + } + + $list = getdbolist('db_orders', "market='$this->marketname'"); + foreach($list as $db_order) + { + $found = false; + foreach($this->orders as $order) + { + if($order->orderid == $db_order->uuid) + { + $found = true; + break; + } + } + + if(!$found) + { + debuglog("$this->marketname deleting order"); + $db_order->delete(); + } + } + + $savebalance = getdbosql('db_balances', "name='cryptsy'"); + $savebalance->balance = 0; + + $this->balances = $this->loadBalances(); + foreach($this->balances as $balance) + { + if($balance->amount <= 0) continue; + $cexcoin = new CExchangeCoin($balance->coin, $this->marketname); + + foreach($cexcoin->bids as $bid) + { + if($balance->amount*1.5 < $bid->amount && !$coin->sellonbid) break; + + $sellamount = min($balance->amount, $bid->price); + if($sellamount*$bid->price < $this->get_mintrade()) continue; + + $cex->sell($sellamount, $bid->price); + $balance->amount -= $sellamount; + + sleep(1); + } + + $cexcoin = new CExchangeCoin($balance->coin, $this->marketname); + if($balance->amount*$cexcoin->ask < $this->get_mintrade()) continue; + + $cex->sell($balance->amount, $cexcoin->ask); + sleep(1); + } + + if($this->balance_btc >= $this->get_minwithdraw()) + { + debuglog("withdraw $this->marketname $this->balance_btc"); + $this->withdraw($this->balance_btc); + } + } + +}; + +//////////////////////////////////////////////////////////////////////////////////////////////// + +class CExchangeCryptsy extends CExchange +{ + protected function loadOrders() + { + $ordertab = array(); + + $orders = cryptsy_api_query('allmyorders'); + if(!$orders) return $ordertab; + if(!isset($orders['return'])) return $ordertab; + + foreach($orders['return'] as $order) + { + if(!isset($order['marketid'])) continue; + if(!isset($order['orderid'])) continue; + + $object = new object(); + $object->orderid = $order['orderid']; + $object->price = $order['price']; + $object->amount = $order['quantity']; + $object->marketid = $order['marketid']; + + $market = getdbosql('db_markets', "marketid=$object->marketid"); + if(!$market) continue; + + $object->coin = getdbo('db_coins', $market->coinid); + if(!$object->coin) continue; + + $ordertab[] = $object; + } + + return $ordertab; + } + + protected function loadBalances() + { + $balancetab = array(); + + $balances = cryptsy_api_query('getinfo'); + if(!$balances) return; + if(!isset($balances['return'])) + { + debuglog($balances); + return $balancetab; + } + + foreach($balances['return']['balances_available'] as $symbol=>$balance) + { + $balance = floatval($balance); + + if($symbol == 'Points') continue; + if($symbol == 'BTC') + { + $this->balance_btc = floatval($balance); + continue; + } + + if($symbol == 'LTC') + { + $this->balance_ltc = floatval($balance); + continue; + } + + if(!$balance) continue; + + $object = new object(); + $object->balance = $balance; + + $object->coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol)); + if(!$object->coin) continue; + + $balancetab[] = $object; + } + + return $balancetab; + } + + protected function withdraw($amount) + { + $btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; + $res = cryptsy_api_query('makewithdrawal', array('address'=>$btcaddr, 'amount'=>$amount)); + debuglog($res); + + if($res && $res['success']) + { + $withdraw = new db_withdraws; + $withdraw->market = 'cryptsy'; + $withdraw->address = $btcaddr; + $withdraw->amount = $amount; + $withdraw->time = time(); + $withdraw->save(); + } + } + +}; + + + + diff --git a/web/yaamp/core/exchange2/CExchangeCoin.php b/web/yaamp/core/exchange2/CExchangeCoin.php index 71c8ed3..7f8b6a8 100644 --- a/web/yaamp/core/exchange2/CExchangeCoin.php +++ b/web/yaamp/core/exchange2/CExchangeCoin.php @@ -1,84 +1,84 @@ -coin = $coin; - $this->marketname = $marketname; - - $this->market = getdbosql('db_markets', "coinid=$coin->id and name='$marketname'"); - if(!$this->market) return; - } - - public static function create($coin, $marketname) - { - switch($marketname) - { - case 'cryptsy': - $cexcoin = new CExchangeCoinCryptsy($coin, $marketname); - break; - } - - $cexcoin->load(); - return $cexcoin; - } - -}; - -class CExchangeCoinCryptsy extends CExchangeCoin -{ - private $marketid; - - protected function load() - { - $ticker = getCryptsyTicker($market->marketid); - if(!$ticker || !isset($ticker->return->$symbol->sellorders[0])) continue; - - /// - } - - protected function sell($amount, $price) - { - $res = cryptsy_api_query('createorder', - array('marketid'=>$this->marketid, 'ordertype'=>'Sell', 'quantity'=>$amount, 'price'=>$price)); - if(!$res || !isset($res['orderid'])) return; - - $db_order = new db_orders; - $db_order->market = 'cryptsy'; - $db_order->coinid = $this->coin->id; - $db_order->amount = $balance; - $db_order->price = $sellprice; - $db_order->ask = $price; - $db_order->bid = $price; - $db_order->uuid = $res['orderid']; - $db_order->created = time(); - $db_order->save(); - } - - protected function cancel($amount, $price) - { - } - -}; - - - - +coin = $coin; + $this->marketname = $marketname; + + $this->market = getdbosql('db_markets', "coinid=$coin->id and name='$marketname'"); + if(!$this->market) return; + } + + public static function create($coin, $marketname) + { + switch($marketname) + { + case 'cryptsy': + $cexcoin = new CExchangeCoinCryptsy($coin, $marketname); + break; + } + + $cexcoin->load(); + return $cexcoin; + } + +}; + +class CExchangeCoinCryptsy extends CExchangeCoin +{ + private $marketid; + + protected function load() + { + $ticker = getCryptsyTicker($market->marketid); + if(!$ticker || !isset($ticker->return->$symbol->sellorders[0])) continue; + + /// + } + + protected function sell($amount, $price) + { + $res = cryptsy_api_query('createorder', + array('marketid'=>$this->marketid, 'ordertype'=>'Sell', 'quantity'=>$amount, 'price'=>$price)); + if(!$res || !isset($res['orderid'])) return; + + $db_order = new db_orders; + $db_order->market = 'cryptsy'; + $db_order->coinid = $this->coin->id; + $db_order->amount = $balance; + $db_order->price = $sellprice; + $db_order->ask = $price; + $db_order->bid = $price; + $db_order->uuid = $res['orderid']; + $db_order->created = time(); + $db_order->save(); + } + + protected function cancel($amount, $price) + { + } + +}; + + + + diff --git a/web/yaamp/core/exchange2/exchange.php b/web/yaamp/core/exchange2/exchange.php index 23cb64b..2828eb0 100644 --- a/web/yaamp/core/exchange2/exchange.php +++ b/web/yaamp/core/exchange2/exchange.php @@ -1,7 +1,7 @@ - 1, 'scrypt' => 1, 'scryptn' => 0.5, + 'c11' => 5.5, 'x11' => 5.5, 'x13' => 3.9, 'x14' => 3.7, @@ -41,6 +42,7 @@ function getAlgoColors($algo) 'scrypt' => '#c0c0e0', 'neoscrypt' => '#a0d0f0', 'scryptn' => '#d0d0d0', + 'c11' => '#f0b0b0', 'x11' => '#f0f0a0', 'x13' => '#d0f0c0', 'x14' => '#a0f0c0', @@ -62,6 +64,7 @@ function getAlgoPort($algo) $a = array( 'sha256' => 3333, 'scrypt' => 3433, + 'c11' => 3573, 'x11' => 3533, 'x13' => 3633, 'x15' => 3733, diff --git a/web/yaamp/core/trading/bittrex_trading.php b/web/yaamp/core/trading/bittrex_trading.php index df59cee..7458625 100644 --- a/web/yaamp/core/trading/bittrex_trading.php +++ b/web/yaamp/core/trading/bittrex_trading.php @@ -187,19 +187,20 @@ function doBittrexTrading($quick=false) if($savebalance->balance >= 0.3) { + $btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; $amount = $savebalance->balance; // - 0.0002; - debuglog("bittrex withdraw $amount to 14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9"); + debuglog("bittrex withdraw $amount to $btcaddr"); sleep(1); - $res = bittrex_api_query('account/withdraw', "¤cy=BTC&quantity=$amount&address=14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9"); + $res = bittrex_api_query('account/withdraw', "¤cy=BTC&quantity=$amount&address=$btcaddr"); debuglog($res); if($res && $res->success) { $withdraw = new db_withdraws; $withdraw->market = 'bittrex'; - $withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; + $withdraw->address = $btcaddr; $withdraw->amount = $amount; $withdraw->time = time(); $withdraw->uuid = $res->result->uuid; diff --git a/web/yaamp/core/trading/bleutrade_trading.php b/web/yaamp/core/trading/bleutrade_trading.php index 3cb10af..51a3533 100644 --- a/web/yaamp/core/trading/bleutrade_trading.php +++ b/web/yaamp/core/trading/bleutrade_trading.php @@ -184,19 +184,21 @@ function doBleutradeTrading($quick=false) if($savebalance->balance >= 0.2) { + $btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; + $amount = $savebalance->balance; // - 0.0002; - debuglog("bleutrade withdraw $amount to 14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9"); + debuglog("bleutrade withdraw $amount to $btcaddr"); sleep(1); - $res = bleutrade_api_query('account/withdraw', "¤cy=BTC&quantity=$amount&address=14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9"); + $res = bleutrade_api_query('account/withdraw', "¤cy=BTC&quantity=$amount&address=$btcaddr"); debuglog($res); if($res && $res->success) { $withdraw = new db_withdraws; $withdraw->market = 'bleutrade'; - $withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; + $withdraw->address = $btcaddr; $withdraw->amount = $amount; $withdraw->time = time(); $withdraw->uuid = $res->result->orderid; diff --git a/web/yaamp/core/trading/cryptsy_trading.php b/web/yaamp/core/trading/cryptsy_trading.php index 8e6d563..b3346fa 100644 --- a/web/yaamp/core/trading/cryptsy_trading.php +++ b/web/yaamp/core/trading/cryptsy_trading.php @@ -196,20 +196,22 @@ function doCryptsyTrading($quick=false) if($savebalance->balance >= 0.3) { + $btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; + $amount = $savebalance->balance; // - 0.001; - debuglog("cryptsy withdraw $amount to 14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9"); + debuglog("cryptsy withdraw $amount to $btcaddr"); sleep(1); $res = cryptsy_api_query('makewithdrawal', - array('address'=>'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9', 'amount'=>$amount)); + array('address'=>$btcaddr, 'amount'=>$amount)); debuglog($res); if($res && $res['success']) { $withdraw = new db_withdraws; $withdraw->market = 'cryptsy'; - $withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; + $withdraw->address = $btcaddr; $withdraw->amount = $amount; $withdraw->time = time(); // $withdraw->uuid = $res->result->uuid; diff --git a/web/yaamp/core/trading/poloniex_trading.php b/web/yaamp/core/trading/poloniex_trading.php index 389c999..b710d22 100644 --- a/web/yaamp/core/trading/poloniex_trading.php +++ b/web/yaamp/core/trading/poloniex_trading.php @@ -1,179 +1,181 @@ -get_ticker(); - if(!$tickers) return; - - // upgrade orders - $coins = getdbolist('db_coins', "enable and id in (select distinct coinid from markets where name='poloniex')"); - foreach($coins as $coin) - { - if($coin->dontsell) continue; - $pair = "BTC_$coin->symbol"; - if(!isset($tickers[$pair])) continue; - - $orders = $poloniex->get_open_orders($pair); - if(!$orders || !isset($orders[0])) - { - dborun("delete from orders where coinid=$coin->id and market='poloniex'"); - continue; - } - - foreach($orders as $order) - { - if(!isset($order['orderNumber'])) - { - debuglog($order); - continue; - } - - if($order['rate'] > $tickers[$pair]['lowestAsk']+0.00000005 || $flushall) - { -// debuglog("poloniex cancel order for $pair {$order['orderNumber']}"); - $poloniex->cancel_order($pair, $order['orderNumber']); - - $db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid'=>$order['orderNumber'])); - if($db_order) $db_order->delete(); - - sleep(1); - } - - else - { - $db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid'=>$order['orderNumber'])); - if($db_order) continue; - - debuglog("poloniex adding order $coin->symbol"); - - $db_order = new db_orders; - $db_order->market = 'poloniex'; - $db_order->coinid = $coin->id; - $db_order->amount = $order['amount']; - $db_order->price = $order['rate']; - $db_order->ask = $tickers[$pair]['lowestAsk']; - $db_order->bid = $tickers[$pair]['highestBid']; - $db_order->uuid = $order['orderNumber']; - $db_order->created = time(); - $db_order->save(); - } - } - - $list = getdbolist('db_orders', "coinid=$coin->id and market='poloniex'"); - foreach($list as $db_order) - { - $found = false; - foreach($orders as $order) - { - if(!isset($order['orderNumber'])) - { - debuglog($order); - continue; - } - - if($order['orderNumber'] == $db_order->uuid) - { - $found = true; - break; - } - } - - if(!$found) - { - debuglog("poloniex deleting order $coin->name $db_order->amount"); - $db_order->delete(); - } - } - } - - // add orders - $savebalance = getdbosql('db_balances', "name='poloniex'"); - $balances = $poloniex->get_balances(); - - foreach($balances as $symbol=>$balance) - { - if(!$balance) continue; - if($symbol == 'BTC') - { - $savebalance->balance = $balance; - $savebalance->save(); - - continue; - } - - $coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol)); - if(!$coin || $coin->dontsell) continue; - - $market = getdbosql('db_markets', "coinid=$coin->id and name='poloniex'"); - if($market) - { - $market->lasttraded = time(); - $market->save(); - } - - $pair = "BTC_$symbol"; - if(!isset($tickers[$pair])) continue; - - $sellprice = $tickers[$pair]['highestBid']; - if($balance * $sellprice < 0.0001) continue; - -// debuglog("poloniex selling $pair, $sellprice, $balance"); - $res = $poloniex->sell($pair, $sellprice, $balance); - - if(!isset($res['orderNumber'])) - { - debuglog($res, 5); - continue; - } - - if(!isset($tickers[$pair])) continue; - - $coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol)); - if(!$coin) continue; - - $db_order = new db_orders; - $db_order->market = 'poloniex'; - $db_order->coinid = $coin->id; - $db_order->amount = $balance; - $db_order->price = $sellprice; - $db_order->ask = $tickers[$pair]['lowestAsk']; - $db_order->bid = $tickers[$pair]['highestBid']; - $db_order->uuid = $res['orderNumber']; - $db_order->created = time(); - $db_order->save(); - } - - if($savebalance->balance >= 0.2) - { - $amount = $savebalance->balance; // - 0.0002; - debuglog("poloniex withdraw $amount to 14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9"); - - sleep(1); - - $res = $poloniex->withdraw('BTC', $amount, '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'); - debuglog($res); - - if($res && $res->success) - { - $withdraw = new db_withdraws; - $withdraw->market = 'poloniex'; - $withdraw->address = '14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; - $withdraw->amount = $amount; - $withdraw->time = time(); - // $withdraw->uuid = $res->result->uuid; - $withdraw->save(); - } - } - -// debuglog('-------------- doPoloniexTrading() done'); -} - - - - - +get_ticker(); + if(!$tickers) return; + + // upgrade orders + $coins = getdbolist('db_coins', "enable and id in (select distinct coinid from markets where name='poloniex')"); + foreach($coins as $coin) + { + if($coin->dontsell) continue; + $pair = "BTC_$coin->symbol"; + if(!isset($tickers[$pair])) continue; + + $orders = $poloniex->get_open_orders($pair); + if(!$orders || !isset($orders[0])) + { + dborun("delete from orders where coinid=$coin->id and market='poloniex'"); + continue; + } + + foreach($orders as $order) + { + if(!isset($order['orderNumber'])) + { + debuglog($order); + continue; + } + + if($order['rate'] > $tickers[$pair]['lowestAsk']+0.00000005 || $flushall) + { +// debuglog("poloniex cancel order for $pair {$order['orderNumber']}"); + $poloniex->cancel_order($pair, $order['orderNumber']); + + $db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid'=>$order['orderNumber'])); + if($db_order) $db_order->delete(); + + sleep(1); + } + + else + { + $db_order = getdbosql('db_orders', "uuid=:uuid", array(':uuid'=>$order['orderNumber'])); + if($db_order) continue; + + debuglog("poloniex adding order $coin->symbol"); + + $db_order = new db_orders; + $db_order->market = 'poloniex'; + $db_order->coinid = $coin->id; + $db_order->amount = $order['amount']; + $db_order->price = $order['rate']; + $db_order->ask = $tickers[$pair]['lowestAsk']; + $db_order->bid = $tickers[$pair]['highestBid']; + $db_order->uuid = $order['orderNumber']; + $db_order->created = time(); + $db_order->save(); + } + } + + $list = getdbolist('db_orders', "coinid=$coin->id and market='poloniex'"); + foreach($list as $db_order) + { + $found = false; + foreach($orders as $order) + { + if(!isset($order['orderNumber'])) + { + debuglog($order); + continue; + } + + if($order['orderNumber'] == $db_order->uuid) + { + $found = true; + break; + } + } + + if(!$found) + { + debuglog("poloniex deleting order $coin->name $db_order->amount"); + $db_order->delete(); + } + } + } + + // add orders + $savebalance = getdbosql('db_balances', "name='poloniex'"); + $balances = $poloniex->get_balances(); + + foreach($balances as $symbol=>$balance) + { + if(!$balance) continue; + if($symbol == 'BTC') + { + $savebalance->balance = $balance; + $savebalance->save(); + + continue; + } + + $coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol)); + if(!$coin || $coin->dontsell) continue; + + $market = getdbosql('db_markets', "coinid=$coin->id and name='poloniex'"); + if($market) + { + $market->lasttraded = time(); + $market->save(); + } + + $pair = "BTC_$symbol"; + if(!isset($tickers[$pair])) continue; + + $sellprice = $tickers[$pair]['highestBid']; + if($balance * $sellprice < 0.0001) continue; + +// debuglog("poloniex selling $pair, $sellprice, $balance"); + $res = $poloniex->sell($pair, $sellprice, $balance); + + if(!isset($res['orderNumber'])) + { + debuglog($res, 5); + continue; + } + + if(!isset($tickers[$pair])) continue; + + $coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol)); + if(!$coin) continue; + + $db_order = new db_orders; + $db_order->market = 'poloniex'; + $db_order->coinid = $coin->id; + $db_order->amount = $balance; + $db_order->price = $sellprice; + $db_order->ask = $tickers[$pair]['lowestAsk']; + $db_order->bid = $tickers[$pair]['highestBid']; + $db_order->uuid = $res['orderNumber']; + $db_order->created = time(); + $db_order->save(); + } + + if($savebalance->balance >= 0.2) + { + $btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; + + $amount = $savebalance->balance; // - 0.0002; + debuglog("poloniex withdraw $amount to $btcaddr"); + + sleep(1); + + $res = $poloniex->withdraw('BTC', $amount, $btcaddr); + debuglog($res); + + if($res && $res->success) + { + $withdraw = new db_withdraws; + $withdraw->market = 'poloniex'; + $withdraw->address = $btcaddr; + $withdraw->amount = $amount; + $withdraw->time = time(); + // $withdraw->uuid = $res->result->uuid; + $withdraw->save(); + } + } + +// debuglog('-------------- doPoloniexTrading() done'); +} + + + + + diff --git a/web/yaamp/modules/api/ApiController.php b/web/yaamp/modules/api/ApiController.php index ff8caa2..b94a65e 100644 --- a/web/yaamp/modules/api/ApiController.php +++ b/web/yaamp/modules/api/ApiController.php @@ -292,7 +292,7 @@ class ApiController extends CommonController // $uptime = system('uptime'); // $name = system('hostname'); -// fetch_url("http://yaamp.com/api/nodereport?name=$name&uptime=$uptime"); +// fetch_url("http://yiimp.ccminer.org/api/nodereport?name=$name&uptime=$uptime"); // } diff --git a/web/yaamp/modules/common/CommonController.php b/web/yaamp/modules/common/CommonController.php index b699ece..65c1586 100644 --- a/web/yaamp/modules/common/CommonController.php +++ b/web/yaamp/modules/common/CommonController.php @@ -4,9 +4,9 @@ class CommonController extends CController { public $admin = false; public $memcache; - + private $t1; - + public function goback($count=-1) { Javascript("window.history.go($count)"); @@ -16,40 +16,40 @@ class CommonController extends CController public function beforeAction($action) { // session_start(); - + $this->memcache = new YaampMemcache; $this->t1 = microtime(true); - + if(user()->getState('yaamp_admin')) $this->admin = true; - + $algo = user()->getState('yaamp-algo'); if(!$algo) user()->setState('yaamp-algo', 'x11'); - + + //$um = app()->getComponent('urlManager'); + //var_dump($um); die; + return true; } - + public function afterAction($action) { - // debuglog("after action"); - + // debuglog("after action ".$action->getId()); + $t2 = microtime(true); $d1 = $t2 - $this->t1; - + $url = "$this->id/{$this->action->id}"; $this->memcache->add_monitoring_function($url, $d1); + + //$um = app()->getComponent('urlManager'); + //var_dump($um); die; } - + public function actionMaintenance() { $this->render('maintenance'); } - + } - - - - - - diff --git a/web/yaamp/modules/common/yaamp.php b/web/yaamp/modules/common/yaamp.php index 6ff1eb0..0f2ca47 100644 --- a/web/yaamp/modules/common/yaamp.php +++ b/web/yaamp/modules/common/yaamp.php @@ -7,7 +7,7 @@
-GOTO YAAMP.COM +GOTO YIIMP




diff --git a/web/yaamp/modules/renting/tx.php b/web/yaamp/modules/renting/tx.php index 6419707..57010d5 100644 --- a/web/yaamp/modules/renting/tx.php +++ b/web/yaamp/modules/renting/tx.php @@ -5,7 +5,7 @@ require dirname(__FILE__).'/../../ui/lib/pageheader.php'; $renter = getrenterparam(getparam('address')); if(!$renter) return; -$this->pageTitle = "$renter->address | yaamp.com"; +$this->pageTitle = "$renter->address | yiimp"; echo "
"; echo "
Transactions from $renter->address
"; diff --git a/web/yaamp/modules/site/SiteController.php b/web/yaamp/modules/site/SiteController.php index b6a336b..ba51ace 100644 --- a/web/yaamp/modules/site/SiteController.php +++ b/web/yaamp/modules/site/SiteController.php @@ -2,24 +2,24 @@ class SiteController extends CommonController { - public $defaultAction='index'; - + public $defaultAction='index'; + /////////////////////////////////////////////////// - public function actionfrottedessus() + public function actionAdmintest() { debuglog("admin login {$_SERVER['REMOTE_ADDR']}"); - + user()->setState('yaamp_admin', true); $this->redirect("/site/common"); } - + ///////////////////////////////////////////////// - + public function actionCreate() { if(!$this->admin) return; - + $coin = new db_coins; $coin->txmessage = true; $coin->created = time(); @@ -27,17 +27,17 @@ class SiteController extends CommonController $coin->difficulty = 1; $coin->installed = 1; $coin->visible = 1; - + // $coin->deposit_minimum = 1; $coin->lastblock = ''; - + if(isset($_POST['db_coins'])) { $coin->attributes = $_POST['db_coins']; if($coin->save()) $this->redirect(array('admin')); } - + $this->render('coin_form', array('update'=>false, 'coin'=>$coin)); } @@ -46,7 +46,7 @@ class SiteController extends CommonController if(!$this->admin) return; $coin = getdbo('db_coins', getiparam('id')); $txfee = $coin->txfee; - + if(isset($_POST['db_coins'])) { $coin->attributes = $_POST['db_coins']; @@ -57,17 +57,17 @@ class SiteController extends CommonController $remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport); $remote->settxfee($coin->txfee); } - + // $this->redirect(array('admin')); $this->goback(); } } - + $this->render('coin_form', array('update'=>true, 'coin'=>$coin)); } ///////////////////////////////////////////////// - + public function actionIndex() { if(isset($_GET['address'])) @@ -102,87 +102,87 @@ class SiteController extends CommonController } ///////////////////////////////// - + public function actionCurrent_results() { $this->renderPartial('results/current_results'); } - + public function actionHistory_results() { $this->renderPartial('results/history_results'); } - + public function actionMining_results() { $this->renderPartial('results/mining_results'); } - + public function actionMiners_results() { $this->renderPartial('results/miners_results'); } - + public function actionWallet_results() { $this->renderPartial('results/wallet_results'); } - + public function actionWallet_miners_results() { $this->renderPartial('results/wallet_miners_results'); } - + public function actionWallet_graphs_results() { $this->renderPartial('results/wallet_graphs_results'); } - + public function actionGraph_earnings_results() { $this->renderPartial('results/graph_earnings_results'); } - + public function actionFound_results() { $this->renderPartial('results/found_results'); } - + public function actionUser_earning_results() { $this->renderPartial('results/user_earning_results'); } - + public function actionGraph_hashrate_results() { $this->renderPartial('results/graph_hashrate_results'); } - + public function actionGraph_user_results() { $this->renderPartial('results/graph_user_results'); } - + public function actionGraph_price_results() { $this->renderPartial('results/graph_price_results'); } - + public function actionGraph_assets_results() { $this->renderPartial('results/graph_assets_results'); } - + public function actionGraph_negative_results() { $this->renderPartial('results/graph_negative_results'); } - + public function actionGraph_profit_results() { $this->renderPartial('results/graph_profit_results'); } - + public function actionTitle_results() { $user = getuserparam(getparam('address')); @@ -190,30 +190,30 @@ class SiteController extends CommonController { $balance = bitcoinvaluetoa($user->balance); $coin = getdbo('db_coins', $user->coinid); - + if($coin) - echo "$balance $coin->symbol - yaamp.com"; + echo "$balance $coin->symbol - yiimp"; else - echo "$balance - yaamp.com"; + echo "$balance - yiimp"; } else - echo "yaamp.com"; + echo YAAMP_SITE_URL; } - + ///////////////////////////////////////////////// - + public function actionAbout() { $this->render('about'); } - + public function actionTerms() { $this->render('terms'); } ///////////////////////////////////////////////// - + public function actionAdmin() { if(!$this->admin) return; @@ -225,9 +225,9 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('admin_results'); } - + ///////////////////////////////////////////////// - + public function actionConnections() { if(!$this->admin) return; @@ -239,9 +239,9 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('connections_results'); } - + ///////////////////////////////////////////////// - + public function actionBlock() { $this->render('block'); @@ -251,9 +251,9 @@ class SiteController extends CommonController { $this->renderPartial('block_results'); } - + ///////////////////////////////////////////////// - + public function actionEarning() { if(!$this->admin) return; @@ -265,9 +265,9 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('earning_results'); } - + ///////////////////////////////////////////////// - + public function actionPayments() { if(!$this->admin) return; @@ -279,9 +279,9 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('payments_results'); } - + ///////////////////////////////////////////////// - + public function actionUser() { if(!$this->admin) return; @@ -293,9 +293,9 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('user_results'); } - + ///////////////////////////////////////////////// - + public function actionWorker() { if(!$this->admin) return; @@ -307,9 +307,9 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('worker_results'); } - + ///////////////////////////////////////////////// - + public function actionVersion() { if(!$this->admin) return; @@ -321,9 +321,9 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('version_results'); } - + ///////////////////////////////////////////////// - + public function actionCommon() { if(!$this->admin) return; @@ -335,9 +335,9 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('common_results'); } - + ///////////////////////////////////////////////// - + public function actionExchange() { if(!$this->admin) return; @@ -349,9 +349,9 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('exchange_results'); } - + ///////////////////////////////////////////////// - + public function actionCoin() { if(!$this->admin) return; @@ -363,46 +363,46 @@ class SiteController extends CommonController if(!$this->admin) return; $this->renderPartial('coin_results'); } - + public function actionMemcached() { if(!$this->admin) return; $this->render('memcached'); } - + public function actionMonsters() { if(!$this->admin) return; $this->render('monsters'); } - + public function actionEmptyMarkets() { if(!$this->admin) return; $this->render('emptymarkets'); } - + ////////////////////////////////////////////////////////////////////////////////////// - + public function actionTx() { $this->renderPartial('tx'); } ////////////////////////////////////////////////////////////////////////////////////// - + public function actionResetBlockchain() { if(!$this->admin) return; $coin = getdbo('db_coins', $_GET['id']); $coin->action = 3; $coin->save(); - + $this->redirect("/site/coin?id=$coin->id"); } - + ////////////////////////////////////////////////////////////////////////////////////// - + public function actionRestartCoin() { if(!$this->admin) return; @@ -414,11 +414,11 @@ class SiteController extends CommonController $coin->installed = true; $coin->connections = 0; $coin->save(); - + $this->redirect('/site/admin'); // $this->goback(); } - + public function actionStartCoin() { if(!$this->admin) return; @@ -430,16 +430,16 @@ class SiteController extends CommonController $coin->installed = true; $coin->connections = 0; $coin->save(); - + $this->redirect('/site/admin'); // $this->goback(); } - + public function actionStopCoin() { if(!$this->admin) return; $coin = getdbo('db_coins', $_GET['id']); - + $coin->action = 2; $coin->enable = false; $coin->auto_ready = false; @@ -449,12 +449,12 @@ class SiteController extends CommonController $this->redirect('/site/admin'); // $this->goback(); } - + public function actionMakeConfigfile() { if(!$this->admin) return; $coin = getdbo('db_coins', $_GET['id']); - + $coin->action = 5; $coin->installed = true; $coin->save(); @@ -462,79 +462,79 @@ class SiteController extends CommonController $this->redirect('/site/admin'); // $this->goback(); } - + ////////////////////////////////////////////////////////////////////////////////////// - + public function actionSetauto() { if(!$this->admin) return; $coin = getdbo('db_coins', $_GET['id']); - + $coin->auto_ready = true; $coin->save(); - + $this->redirect('/site/admin'); // $this->goback(); } - + public function actionUnsetauto() { if(!$this->admin) return; $coin = getdbo('db_coins', $_GET['id']); - + $coin->auto_ready = false; $coin->save(); - + $this->redirect('/site/admin'); // $this->goback(); } - + public function actionSellBalance() { if(!$this->admin) return; $coin = getdbo('db_coins', getiparam('id')); $amount = getparam('amount'); - + $res = $this->doSellBalance($coin, $amount); - + if(!$res) $this->redirect('/site/admin'); else $this->redirect('/site/exchange'); } - + ////////////////////////////////////////////////////////////////////////////////////////////////// public function actionBlockuser() { if(!$this->admin) return; - + $wallet = getparam('wallet'); $user = getuserparam($wallet); - + $user->is_locked = true; $user->save(); - + $this->redirect('/site/monsters'); } - + public function actionUnblockuser() { if(!$this->admin) return; - + $wallet = getparam('wallet'); $user = getuserparam($wallet); - + $user->is_locked = false; $user->save(); - + $this->redirect('/site/monsters'); } - + public function actionPayuserscoin() { if(!$this->admin) return; - + $coin = getdbo('db_coins', getiparam('id')); if(!$coin) { @@ -545,13 +545,13 @@ class SiteController extends CommonController BackendCoinPayments($coin); $this->goback(); } - + //// - + public function actionDeleteEarnings() { if(!$this->admin) return; - + $coin = getdbo('db_coins', getiparam('id')); if(!$coin) { @@ -565,37 +565,37 @@ class SiteController extends CommonController dborun("delete from earnings where coinid=$coin->id"); $this->redirect("/site/admin"); } - + public function actionDeleteEarning() { if(!$this->admin) return; $earning = getdbo('db_earnings', $_GET['id']); $earning->delete(); - + $this->redirect('/site/earning'); } - + ////////////////////////////////////////////////////////////////////////////////////////////////// public function actionDeleteExchange() { $exchange = getdbo('db_exchange', getiparam('id')); $unspent = $exchange->quantity; - + $exchange->status = 'deleted'; $exchange->price = 0; $exchange->receive_time = time(); $exchange->save(); - + // $earnings = getdbolist('db_earnings', "coinid=$exchange->coinid and not cleared order by create_time"); // foreach($earnings as $earning) // { // $unspent -= $earning->amount; // $earning->delete(); - + // if($unspent <= 0) break; // } - + $this->redirect('/site/exchange'); } @@ -603,16 +603,16 @@ class SiteController extends CommonController { $id = getiparam('id'); $market = getdbo('db_markets', $id); - + if($market) { $market->lastsent = null; $market->save(); } - + $this->redirect('/site/common'); } - + //////////////////////////////////////////////////////////////////////////////////////// public function actionAlgo() @@ -627,7 +627,7 @@ class SiteController extends CommonController $this->goback(); } - + public function actionGomining() { user()->setState('yaamp-algo', getparam('algo')); @@ -640,11 +640,11 @@ class SiteController extends CommonController BackendPricesUpdate(); $this->goback(); } - + public function actionUninstallCoin() { if(!$this->admin) return; - + $coin = getdbo('db_coins', getiparam('id')); if($coin) { @@ -654,7 +654,7 @@ class SiteController extends CommonController // dborun("delete from markets where coinid=$coin->id"); dborun("delete from orders where coinid=$coin->id"); dborun("delete from shares where coinid=$coin->id"); - + $coin->enable = false; $coin->installed = false; $coin->auto_ready = false; @@ -663,14 +663,14 @@ class SiteController extends CommonController $coin->balance = 0; $coin->save(); } - + $this->redirect("/site/admin"); } public function actionBanUser() { if(!$this->admin) return; - + $user = getdbo('db_accounts', getiparam('id')); if($user) { @@ -678,60 +678,60 @@ class SiteController extends CommonController $user->balance = 0; $user->save(); } - + $this->goback(); } - + public function actionOptimize() { BackendOptimizeTables(); $this->goback(); } - + public function actionRunExchange() { $id = getiparam('id'); $balance = getdbo('db_balances', $id); - + if($balance) switch($balance->name) { case 'cryptsy': doCryptsyTrading(true); updateCryptsyMarkets(); - + break; - + case 'bittrex': doBittrexTrading(true); updateBittrexMarkets(); - + break; - + case 'c-cex': doCCexTrading(true); updateCCexMarkets(); - + break; - + case 'yobit': doYobitTrading(true); updateYobitMarkets(); - + break; - + case 'bleutrade': doBleutradeTrading(true); updateBleutradeMarkets(); - + break; case 'poloniex': doPoloniexTrading(true); updatePoloniexMarkets(); - + break; } - + debuglog("runexchange done"); $this->redirect("/site/common"); } @@ -743,7 +743,7 @@ class SiteController extends CommonController // $param = getparam('param'); // if($param) eval($param); // else $param = ''; - + // $this->render('eval', array('param'=>$param)); } @@ -752,7 +752,7 @@ class SiteController extends CommonController debuglog(__METHOD__); setcookie('mainbtc', '1', time()+60*60*24, '/'); } - + public function actionTest() { // if(!$this->admin) return; @@ -760,13 +760,8 @@ class SiteController extends CommonController $ticker = jubi_api_query('ticker', "?coin=sak"); debuglog($ticker); - + debuglog("action test end"); } } - - - - - diff --git a/web/yaamp/modules/site/common_results.php b/web/yaamp/modules/site/common_results.php index b03a30e..8b3bbfb 100644 --- a/web/yaamp/modules/site/common_results.php +++ b/web/yaamp/modules/site/common_results.php @@ -478,8 +478,10 @@ $immature = bitcoinvaluetoa($immature); $mints = bitcoinvaluetoa($mints); $off = bitcoinvaluetoa($off); +$btcaddr = YAAMP_BTCADDRESS; //'14LS7Uda6EZGXLtRrFEZ2kWmarrxobkyu9'; + echo "Bitstamp $mining->usdbtc, "; -echo "wallet $btc->balance, next payout $topay2
"; +echo "wallet $btc->balance, next payout $topay2
"; echo "pay $topay, renter $renter, marg $margin, $margin2
"; echo "mint $mints immature $immature off $off
"; diff --git a/web/yaamp/modules/site/diff.php b/web/yaamp/modules/site/diff.php index 8357082..054c83c 100644 --- a/web/yaamp/modules/site/diff.php +++ b/web/yaamp/modules/site/diff.php @@ -11,7 +11,7 @@ you have from 5 to 15 submits per minute. It's a good trade off between bandwidt if you want to set the difficulty to 64, you would use:

--o stratum+tcp://yaamp.com:3433 -u wallet_adress -p d=64
+-o stratum+tcp://yiimp.ccminer.org:3433 -u wallet_adress -p d=64
 

Here are the accepted values for the custom diff:

diff --git a/web/yaamp/modules/site/index.php b/web/yaamp/modules/site/index.php index dd27542..2260f9b 100644 --- a/web/yaamp/modules/site/index.php +++ b/web/yaamp/modules/site/index.php @@ -24,12 +24,12 @@ echo <<
-
YET ANOTHER ANONYMOUS MINING POOL
+
YII MINING POOL
    -
  • YAAMP is multipool multialgo with auto exchange to Bitcoin or any coin we mine.
  • +
  • YIIMP is multipool multialgo with auto exchange to Bitcoin or any coin we mine.
  • We distribute hashpower in real time among the best coins.
  • No registration required.
  • Just plug in your stratum miner using your bitcoin wallet address as the username.
  • @@ -53,7 +53,7 @@ echo <<

    - -o stratum+tcp://yaamp.com:PORT -u WALLET_ADDRESS -p xx

    + -o stratum+tcp://yiimp.ccminer.org:PORT -u WALLET_ADDRESS -p xx

  • WALLET_ADDRESS can be of any currency we mine or a BTC address.
  • @@ -76,9 +76,9 @@ echo <<BitcoinTalk - https://bitcointalk.org/index.php?topic=508786.0 -
  • API - http://yaamp.com/site/api
  • -
  • Difficulty - http://yaamp.com/site/diff
  • -
  • Algo Switching - http://yaamp.com/site/multialgo
  • +
  • API - http://yiimp.ccminer.org/site/api
  • +
  • Difficulty - http://yiimp.ccminer.org/site/diff
  • +
  • Algo Switching - http://yiimp.ccminer.org/site/multialgo

  • diff --git a/web/yaamp/modules/site/multialgo.php b/web/yaamp/modules/site/multialgo.php index 2c100a1..b71b3de 100644 --- a/web/yaamp/modules/site/multialgo.php +++ b/web/yaamp/modules/site/multialgo.php @@ -39,11 +39,11 @@ connection will close (and move to your next configured algo) if the algo is not :start -ccminer.exe -r 0 -a x11 -o stratum+tcp://yaamp.com:3533 -u joe -p x11,x13,x14,x15,quark,lyra2 -ccminer.exe -r 0 -a x13 -o stratum+tcp://yaamp.com:3633 -u joe -p x11,x13,x14,x15,quark,lyra2 -ccminer.exe -r 0 -a x15 -o stratum+tcp://yaamp.com:3733 -u joe -p x11,x13,x14,x15,quark,lyra2 -ccminer.exe -r 0 -a lyra2 -o stratum+tcp://yaamp.com:4433 -u joe -p x11,x13,x14,x15,quark,lyra2 -ccminer.exe -r 0 -a quark -o stratum+tcp://yaamp.com:4033 -u joe -p x11,x13,x14,x15,quark,lyra2 +ccminer -r 0 -a x11 -o stratum+tcp://yaamp.com:3533 -u joe -p x11,x13,x14,x15,quark,lyra2 +ccminer -r 0 -a x13 -o stratum+tcp://yaamp.com:3633 -u joe -p x11,x13,x14,x15,quark,lyra2 +ccminer -r 0 -a x15 -o stratum+tcp://yaamp.com:3733 -u joe -p x11,x13,x14,x15,quark,lyra2 +ccminer -r 0 -a lyra2 -o stratum+tcp://yaamp.com:4433 -u joe -p x11,x13,x14,x15,quark,lyra2 +ccminer -r 0 -a quark -o stratum+tcp://yaamp.com:4033 -u joe -p x11,x13,x14,x15,quark,lyra2 sleep 5000 goto start @@ -56,6 +56,7 @@ is the reference with a factor of 1.

     'scrypt'	=> 1,
     'scryptn'	=> 0.5,
    +'c11'		=> 5.5,
     'x11'		=> 5.5,
     'x13'		=> 3.9,
     'x14'		=> 3.7,
    diff --git a/web/yaamp/modules/site/tx.php b/web/yaamp/modules/site/tx.php
    index b35052f..7fd945c 100644
    --- a/web/yaamp/modules/site/tx.php
    +++ b/web/yaamp/modules/site/tx.php
    @@ -5,7 +5,7 @@ require dirname(__FILE__).'/../../ui/lib/pageheader.php';
     $user = getuserparam(getparam('address'));
     if(!$user) return;
     
    -$this->pageTitle = "$user->username | yaamp.com";
    +$this->pageTitle = "$user->username | yiimp";
     
     $bitcoin = getdbosql('db_coins', "symbol='BTC'");
     
    diff --git a/web/yaamp/modules/stats/index.php b/web/yaamp/modules/stats/index.php
    index 184ace7..0b07c9d 100644
    --- a/web/yaamp/modules/stats/index.php
    +++ b/web/yaamp/modules/stats/index.php
    @@ -1,5 +1,4 @@
     getState('yaamp-algo');
     
     JavascriptFile("/extensions/jqplot/jquery.jqplot.js");
    diff --git a/web/yaamp/runtime/.gitkeep b/web/yaamp/runtime/.gitkeep
    new file mode 100644
    index 0000000..e69de29
    diff --git a/web/yaamp/ui/js/auto_refresh.js b/web/yaamp/ui/js/auto_refresh.js
    index c9cc95e..ad772bf 100644
    --- a/web/yaamp/ui/js/auto_refresh.js
    +++ b/web/yaamp/ui/js/auto_refresh.js
    @@ -19,12 +19,12 @@ function auto_page_resume()
     function auto_page_refresh()
     {
     	page_refresh();
    -	
    +
     	var now_time = new Date().getTime();
     	if(now_time > auto_start_time + auto_max_time)
     	{
     		$('#resume_update_button').show();
    -		document.title = 'yaamp.com';
    +		document.title = 'yiimp';
     	}
     	
     	else
    diff --git a/web/yaamp/ui/lib/pageheader.php b/web/yaamp/ui/lib/pageheader.php
    index b0f3a98..4591f95 100644
    --- a/web/yaamp/ui/lib/pageheader.php
    +++ b/web/yaamp/ui/lib/pageheader.php
    @@ -1,26 +1,26 @@
    -
    -
    -
    -
    -  
    -
    -	
    -	
    -	
    -	
    -	
    -	
    -	
    -	yaamp.com
    -
    -";
    +
    +
    +
    +
    +  
    +
    +	
    +	
    +	
    +	
    +	
    +	
    +	
    +	YiiMP
    +
    +";
    diff --git a/web/yaamp/ui/main.php b/web/yaamp/ui/main.php
    index 61a1035..5f2dc64 100644
    --- a/web/yaamp/ui/main.php
    +++ b/web/yaamp/ui/main.php
    @@ -18,7 +18,7 @@ echo <<
     
     
    -yaamp.com
    +yiimp
     
     END;
     
    @@ -110,8 +110,8 @@ function showPageHeader()
     	$mining = getdbosql('db_mining');
     	$nextpayment = date('H:i', $mining->last_payout+YAAMP_PAYMENTS_FREQ);
     	
    -	echo "Next Payout: $nextpayment EST";
    -	echo "     © yaamp.com";
    +	echo "Next Payout: $nextpayment EUST";
    +	echo "     © yiimp.ccminer.org";
     	
     	echo "
"; echo "
"; @@ -122,7 +122,7 @@ function showPageFooter() echo "";