Compare commits
11 commits
marcdeb1/n
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
4065389798 | ||
|
a252dc05e6 | ||
|
e8c58e8c15 | ||
|
e8e9346a70 | ||
|
fdecf39f93 | ||
|
d3cd0e13f6 | ||
|
f769cac5da | ||
|
9b554eec1b | ||
|
07d9521cfe | ||
|
820f20a479 | ||
|
0c84ba3fae |
13 changed files with 1324 additions and 460 deletions
|
@ -2,18 +2,23 @@
|
||||||
|
|
||||||
A simple PHP block explorer for browsing transactions and claims on the [LBRY](https://lbry.com) blockchain. The explorer was developed using CakePHP which is a model-view-controller (MVC) PHP framework.
|
A simple PHP block explorer for browsing transactions and claims on the [LBRY](https://lbry.com) blockchain. The explorer was developed using CakePHP which is a model-view-controller (MVC) PHP framework.
|
||||||
|
|
||||||
## Installation
|
## Requirements
|
||||||
There are some prerequisites that need to be installed before the explorer can be accessed.
|
There are some prerequisites that need to be installed before the explorer can be accessed.
|
||||||
* Web server - Apache, caddy or nginx
|
* Web server - Apache, caddy or nginx
|
||||||
* [lbrycrd](https://github.com/lbryio/lbrycrd) with txindex turned on
|
* [lbrycrd](https://github.com/lbryio/lbrycrd) with txindex turned on
|
||||||
* MariaDB 10.2 or higher
|
* MariaDB 10.2 or higher
|
||||||
* Redis Server (optional, only required for the CakePHP redis cache engine, or to run `forevermempool`)
|
* Redis Server (optional, only required for the CakePHP redis cache engine, or to run `forevermempool`)
|
||||||
* PHP 7.2 or higher
|
* PHP 7.4 or higher
|
||||||
* php-fpm
|
* php-fpm
|
||||||
* [igbinary extension](https://github.com/igbinary/igbinary)
|
* [igbinary extension](https://github.com/igbinary/igbinary)
|
||||||
* [phpredis extension](https://github.com/phpredis/phpredis)
|
* [phpredis extension](https://github.com/phpredis/phpredis)
|
||||||
* composer (PHP package manager)
|
* composer (PHP package manager)
|
||||||
|
|
||||||
|
on ubuntu you may use this to install php requirements
|
||||||
|
```bash
|
||||||
|
sudo apt install php7.4-gmp php7.4-intl php7.4-mbstring php7.4-mysql php7.4-bcmath php7.4-gd
|
||||||
|
```
|
||||||
|
|
||||||
### Installation steps
|
### Installation steps
|
||||||
* Clone the Github repository. `git clone https://github.com/lbryio/block-explorer`
|
* Clone the Github repository. `git clone https://github.com/lbryio/block-explorer`
|
||||||
* Create a MariaDB database using the DDL found in `block-explorer/sql/lbryexplorer.ddl.sql`
|
* Create a MariaDB database using the DDL found in `block-explorer/sql/lbryexplorer.ddl.sql`
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"post-install-cmd": "App\\Console\\Installer::postInstall",
|
"post-install-cmd": "App\\Console\\Installer::postInstall",
|
||||||
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
|
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
|
||||||
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
|
|
||||||
"check": [
|
"check": [
|
||||||
"@test",
|
"@test",
|
||||||
"@cs-check"
|
"@cs-check"
|
||||||
|
@ -50,5 +49,11 @@
|
||||||
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
|
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
|
||||||
"test": "phpunit --colors=always"
|
"test": "phpunit --colors=always"
|
||||||
},
|
},
|
||||||
"prefer-stable": true
|
"prefer-stable": true,
|
||||||
|
"config": {
|
||||||
|
"allow-plugins": {
|
||||||
|
"cakephp/plugin-installer": true,
|
||||||
|
"kylekatarnls/update-helper": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
1674
composer.lock
generated
1674
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -32,9 +32,9 @@ class ClaimsController extends AppController {
|
||||||
}
|
}
|
||||||
|
|
||||||
$conn = ConnectionManager::get('default');
|
$conn = ConnectionManager::get('default');
|
||||||
$stmt = $conn->execute('SELECT COUNT(Id) AS Total FROM Claims WHERE ThumbnailUrl IS NOT NULL AND LENGTH(TRIM(ThumbnailUrl)) > 0');
|
// $stmt = $conn->execute('SELECT COUNT(Id) AS Total FROM Claims WHERE ThumbnailUrl IS NOT NULL AND LENGTH(TRIM(ThumbnailUrl)) > 0');
|
||||||
$count = $stmt->fetch(\PDO::FETCH_OBJ);
|
// $count = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||||
$numClaims = $count->Total;
|
$numClaims = 23000000;
|
||||||
|
|
||||||
if ($beforeId < 0) {
|
if ($beforeId < 0) {
|
||||||
$beforeId = 0;
|
$beforeId = 0;
|
||||||
|
|
|
@ -25,13 +25,13 @@ class MainController extends AppController {
|
||||||
|
|
||||||
const txOutSetInfo = 'lbrcrd.tosi';
|
const txOutSetInfo = 'lbrcrd.tosi';
|
||||||
|
|
||||||
const bittrexMarketUrl = 'https://bittrex.com/api/v1.1/public/getticker?market=BTC-LBC';
|
const bittrexMarketUrl = 'https://api.bittrex.com/v3/markets/LBC-BTC/ticker';
|
||||||
|
|
||||||
const blockchainTickerUrl = 'https://blockchain.info/ticker';
|
const blockchainTickerUrl = 'https://blockchain.info/ticker';
|
||||||
|
|
||||||
const tagReceiptAddress = 'bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp';
|
const tagReceiptAddress = 'bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp';
|
||||||
|
|
||||||
const blockedListUrl = 'https://api.lbry.com/file/list_blocked';
|
const blockedListUrl = 'https://api.odysee.com/file/list_blocked';
|
||||||
|
|
||||||
protected $redis;
|
protected $redis;
|
||||||
|
|
||||||
|
@ -72,13 +72,13 @@ class MainController extends AppController {
|
||||||
$btrxjson = json_decode(self::curl_get(self::bittrexMarketUrl));
|
$btrxjson = json_decode(self::curl_get(self::bittrexMarketUrl));
|
||||||
$blckjson = json_decode(self::curl_get(self::blockchainTickerUrl));
|
$blckjson = json_decode(self::curl_get(self::blockchainTickerUrl));
|
||||||
|
|
||||||
if ($btrxjson->success) {
|
if ($btrxjson) {
|
||||||
$onelbc = $btrxjson->result->Bid;
|
$onelbc = $btrxjson->bidRate;
|
||||||
$lbcPrice = 0;
|
$lbcPrice = 0;
|
||||||
if (isset($blckjson->USD)) {
|
if (isset($blckjson->USD)) {
|
||||||
$lbcPrice = $onelbc * $blckjson->USD->buy;
|
$lbcPrice = $onelbc * $blckjson->USD->buy;
|
||||||
if ($lbcPrice > 0) {
|
if ($lbcPrice > 0) {
|
||||||
$priceInfo->price = number_format($lbcPrice, 2, '.', '');
|
$priceInfo->price = number_format($lbcPrice, 3, '.', '');
|
||||||
$priceInfo->time = $now->format('c');
|
$priceInfo->time = $now->format('c');
|
||||||
if ($this->redis) {
|
if ($this->redis) {
|
||||||
$this->redis->set(self::lbcPriceKey, json_encode($priceInfo));
|
$this->redis->set(self::lbcPriceKey, json_encode($priceInfo));
|
||||||
|
@ -99,11 +99,7 @@ class MainController extends AppController {
|
||||||
$lbcUsdPrice = $this->_getLatestPrice();
|
$lbcUsdPrice = $this->_getLatestPrice();
|
||||||
$this->set('lbcUsdPrice', $lbcUsdPrice);
|
$this->set('lbcUsdPrice', $lbcUsdPrice);
|
||||||
|
|
||||||
$blocks = $this->Blocks->find()->select(['chainwork', 'confirmations', 'difficulty', 'hash', 'height', 'transaction_hashes', 'block_time', 'block_size'])->order(['height' => 'desc'])->limit(6)->toArray();
|
$blocks = $this->Blocks->find()->select(['chainwork', 'confirmations', 'difficulty', 'hash', 'height', 'block_time', 'block_size','tx_count'])->order(['height' => 'desc'])->limit(6)->toArray();
|
||||||
for ($i = 0; $i < count($blocks); $i++) {
|
|
||||||
$tx_hashes = preg_split('#,#', $blocks[$i]->transaction_hashes);
|
|
||||||
$blocks[$i]->transaction_count = count($tx_hashes);
|
|
||||||
}
|
|
||||||
// hash rate
|
// hash rate
|
||||||
$hashRate = $this->_formatHashRate($this->_gethashrate());
|
$hashRate = $this->_formatHashRate($this->_gethashrate());
|
||||||
|
|
||||||
|
@ -135,9 +131,9 @@ class MainController extends AppController {
|
||||||
$page = intval($this->request->query('page'));
|
$page = intval($this->request->query('page'));
|
||||||
|
|
||||||
$conn = ConnectionManager::get('default');
|
$conn = ConnectionManager::get('default');
|
||||||
$stmt = $conn->execute('SELECT COUNT(id) AS Total FROM claim');
|
// $stmt = $conn->execute('SELECT COUNT(id) AS Total FROM claim');
|
||||||
$count = $stmt->fetch(\PDO::FETCH_OBJ);
|
// $count = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||||
$numClaims = $count->Total;
|
$numClaims = 20000000;
|
||||||
|
|
||||||
$stmt = $conn->execute('SELECT MAX(id) AS MaxId FROM claim');
|
$stmt = $conn->execute('SELECT MAX(id) AS MaxId FROM claim');
|
||||||
$res = $stmt->fetch(\PDO::FETCH_OBJ);
|
$res = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||||
|
@ -262,11 +258,7 @@ class MainController extends AppController {
|
||||||
$this->loadModel('Outputs');
|
$this->loadModel('Outputs');
|
||||||
|
|
||||||
// load 10 blocks and transactions
|
// load 10 blocks and transactions
|
||||||
$blocks = $this->Blocks->find()->select(['height', 'block_time', 'transaction_hashes'])->order(['height' => 'desc'])->limit(10)->toArray();
|
$blocks = $this->Blocks->find()->select(['height', 'block_time', 'tx_count'])->order(['height' => 'desc'])->limit(10)->toArray();
|
||||||
for ($i = 0; $i < count($blocks); $i++) {
|
|
||||||
$tx_hashes = preg_split('#,#', $blocks[$i]->transaction_hashes);
|
|
||||||
$blocks[$i]->transaction_count = count($tx_hashes);
|
|
||||||
}
|
|
||||||
|
|
||||||
$transactions = $this->Transactions->find()->select(['Transactions.id', 'Transactions.hash', 'Transactions.value', 'Transactions.input_count', 'Transactions.output_count', 'Transactions.transaction_time', 'Transactions.created_at'])->order(['Transactions.created_at' => 'desc'])->limit(10)->toArray();
|
$transactions = $this->Transactions->find()->select(['Transactions.id', 'Transactions.hash', 'Transactions.value', 'Transactions.input_count', 'Transactions.output_count', 'Transactions.transaction_time', 'Transactions.created_at'])->order(['Transactions.created_at' => 'desc'])->limit(10)->toArray();
|
||||||
|
|
||||||
|
@ -335,7 +327,7 @@ class MainController extends AppController {
|
||||||
$page = intval($this->request->query('page'));
|
$page = intval($this->request->query('page'));
|
||||||
|
|
||||||
$conn = ConnectionManager::get('default');
|
$conn = ConnectionManager::get('default');
|
||||||
$stmt = $conn->execute('SELECT COUNT(id) AS Total FROM block');
|
$stmt = $conn->execute('SELECT height AS Total FROM block order by id desc limit 1');
|
||||||
$count = $stmt->fetch(\PDO::FETCH_OBJ);
|
$count = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||||
$numBlocks = $count->Total;
|
$numBlocks = $count->Total;
|
||||||
|
|
||||||
|
@ -350,7 +342,7 @@ class MainController extends AppController {
|
||||||
$offset = ($page - 1) * $pageLimit;
|
$offset = ($page - 1) * $pageLimit;
|
||||||
$currentBlock = $this->Blocks->find()->select(['height'])->order(['height' => 'DESC'])->first();
|
$currentBlock = $this->Blocks->find()->select(['height'])->order(['height' => 'DESC'])->first();
|
||||||
$blocks = $this->Blocks->find()->select(
|
$blocks = $this->Blocks->find()->select(
|
||||||
['height', 'difficulty', 'transaction_hashes', 'block_size', 'nonce', 'block_time']
|
['height', 'difficulty', 'block_size', 'nonce', 'block_time','tx_count']
|
||||||
)->offset($offset)->limit($pageLimit)->order(['height' => 'DESC'])->toArray();
|
)->offset($offset)->limit($pageLimit)->order(['height' => 'DESC'])->toArray();
|
||||||
$this->set('currentBlock', $currentBlock);
|
$this->set('currentBlock', $currentBlock);
|
||||||
$this->set('blocks', $blocks);
|
$this->set('blocks', $blocks);
|
||||||
|
@ -459,7 +451,7 @@ class MainController extends AppController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$lbryAddresses = ['rEqocTgdPdoD8NEbrECTUPfpquJ4zPVCJ8', 'rKaAUDxr24hHNNTQuNtRvNt8SGYJMdLXo3', 'r7hj61jdbGXcsccxw8UmEFCReZoCWLRr7t', 'bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt', 'bU2XUzckfpdEuQNemKvhPT1gexQ3GG3SC2', 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD', 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz', 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393', 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH', 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc', 'bX6napXtY2nVTBRc8PwULBuGWn2i3SCtrN'];
|
$lbryAddresses = ['rEqocTgdPdoD8NEbrECTUPfpquJ4zPVCJ8', 'rKaAUDxr24hHNNTQuNtRvNt8SGYJMdLXo3', 'r7hj61jdbGXcsccxw8UmEFCReZoCWLRr7t', 'bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt', 'bU2XUzckfpdEuQNemKvhPT1gexQ3GG3SC2', 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD', 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz', 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393', 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH', 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc', 'bX6napXtY2nVTBRc8PwULBuGWn2i3SCtrN', 'bG1fEEqDVepDy3AbvM8outQ3FQUu76aDot'];
|
||||||
$totalBalance = 0;
|
$totalBalance = 0;
|
||||||
$maxBalance = 0;
|
$maxBalance = 0;
|
||||||
$minBalance = 0;
|
$minBalance = 0;
|
||||||
|
@ -650,12 +642,7 @@ class MainController extends AppController {
|
||||||
// Load 10 blocks
|
// Load 10 blocks
|
||||||
$this->autoRender = false;
|
$this->autoRender = false;
|
||||||
$this->loadModel('Blocks');
|
$this->loadModel('Blocks');
|
||||||
$blocks = $this->Blocks->find()->select(['Height' => 'height', 'BlockTime' => 'block_time', 'transaction_hashes'])->order(['Height' => 'desc'])->limit(10)->toArray();
|
$blocks = $this->Blocks->find()->select(['Height' => 'height', 'BlockTime' => 'block_time', 'TransactionCount'=>'tx_count'])->order(['Height' => 'desc'])->limit(10)->toArray();
|
||||||
for ($i = 0; $i < count($blocks); $i++) {
|
|
||||||
$tx_hashes = preg_split('#,#', $blocks[$i]->transaction_hashes);
|
|
||||||
$blocks[$i]->TransactionCount = count($tx_hashes);
|
|
||||||
unset($blocks[$i]->transaction_hashes);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->_jsonResponse(['success' => true, 'blocks' => $blocks]);
|
$this->_jsonResponse(['success' => true, 'blocks' => $blocks]);
|
||||||
}
|
}
|
||||||
|
@ -737,12 +724,9 @@ class MainController extends AppController {
|
||||||
public function apirecentblocks() {
|
public function apirecentblocks() {
|
||||||
$this->autoRender = false;
|
$this->autoRender = false;
|
||||||
$this->loadModel('Blocks');
|
$this->loadModel('Blocks');
|
||||||
$blocks = $this->Blocks->find()->select(['Difficulty' => 'difficulty', 'Hash' => 'hash', 'Height' => 'height', 'transaction_hashes', 'BlockTime' => 'block_time', 'BlockSize' => 'block_size'])->order(['Height' => 'desc'])->limit(6)->toArray();
|
$blocks = $this->Blocks->find()->select(['Difficulty' => 'difficulty', 'Hash' => 'hash', 'Height' => 'height', 'BlockTime' => 'block_time', 'BlockSize' => 'block_size', 'TransactionCount' => 'tx_count'])->order(['Height' => 'desc'])->limit(6)->toArray();
|
||||||
for ($i = 0; $i < count($blocks); $i++) {
|
for ($i = 0; $i < count($blocks); $i++) {
|
||||||
$tx_hashes = preg_split('#,#', $blocks[$i]->transaction_hashes);
|
|
||||||
$blocks[$i]->TransactionCount = count($tx_hashes);
|
|
||||||
$blocks[$i]->Difficulty = number_format($blocks[$i]->Difficulty, 2, '.', '');
|
$blocks[$i]->Difficulty = number_format($blocks[$i]->Difficulty, 2, '.', '');
|
||||||
unset($blocks[$i]->transaction_hashes);
|
|
||||||
}
|
}
|
||||||
return $this->_jsonResponse(['success' => true, 'blocks' => $blocks]);
|
return $this->_jsonResponse(['success' => true, 'blocks' => $blocks]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ class AuxShell extends Shell {
|
||||||
|
|
||||||
public static $rpcurl;
|
public static $rpcurl;
|
||||||
|
|
||||||
const bittrex = 'https://bittrex.com/api/v1.1/public/getticker?market=BTC-LBC';
|
const bittrex = 'https://api.bittrex.com/v3/markets/LBC-BTC/ticker';
|
||||||
|
|
||||||
const blockchainticker = 'https://blockchain.info/ticker';
|
const blockchainticker = 'https://blockchain.info/ticker';
|
||||||
|
|
||||||
|
@ -150,13 +150,13 @@ class AuxShell extends Shell {
|
||||||
$btrxjson = json_decode(self::curl_get(self::bittrex));
|
$btrxjson = json_decode(self::curl_get(self::bittrex));
|
||||||
$blckjson = json_decode(self::curl_get(self::blockchainticker));
|
$blckjson = json_decode(self::curl_get(self::blockchainticker));
|
||||||
|
|
||||||
if ($btrxjson->success) {
|
if ($btrxjson) {
|
||||||
$btc = $btrxjson->result->Bid;
|
$btc = $btrxjson->bidRate;
|
||||||
$usd = 0;
|
$usd = 0;
|
||||||
if (isset($blckjson->USD)) {
|
if (isset($blckjson->USD)) {
|
||||||
$usd = $btc * $blckjson->USD->buy;
|
$usd = $btc * $blckjson->USD->buy;
|
||||||
$priceInfo = new \stdClass();
|
$priceInfo = new \stdClass();
|
||||||
$priceInfo->price = number_format($usd, 2, '.', '');
|
$priceInfo->price = number_format($usd, 3, '.', '');
|
||||||
$priceInfo->time = $now->format('c');
|
$priceInfo->time = $now->format('c');
|
||||||
if ($redis) {
|
if ($redis) {
|
||||||
$redis->set(self::lbcpricekey, json_encode($priceInfo));
|
$redis->set(self::lbcpricekey, json_encode($priceInfo));
|
||||||
|
|
|
@ -29,7 +29,7 @@ $ctTag = $claim->getContentTag();
|
||||||
|
|
||||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||||
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
||||||
<img src="<?php echo htmlspecialchars($claim->thumbnail_url) ?>" alt="" />
|
<img src="<?php echo htmlspecialchars('https://thumbnails.odycdn.com/optimize/s:1280:720/quality:85/plain/'.$claim->thumbnail_url) ?>" alt="" />
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
@ -184,7 +184,7 @@
|
||||||
<td class="right"><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></td>
|
<td class="right"><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></td>
|
||||||
<td class="pad-left"><?php echo number_format($block->difficulty, 8, '.', '') ?></td>
|
<td class="pad-left"><?php echo number_format($block->difficulty, 8, '.', '') ?></td>
|
||||||
<td class="right"><?php echo number_format((($currentBlock->height - $block->height) + 1), 0, '', ',') ?></td>
|
<td class="right"><?php echo number_format((($currentBlock->height - $block->height) + 1), 0, '', ',') ?></td>
|
||||||
<td class="right"><?php echo count(preg_split('#,#', $block->transaction_hashes)) ?></td>
|
<td class="right"><?php echo $block->tx_count ?></td>
|
||||||
<td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td>
|
<td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td>
|
||||||
<td class="right pad-left"><?php echo $block->nonce ?></td>
|
<td class="right pad-left"><?php echo $block->nonce ?></td>
|
||||||
<td class="pad-left"><?php echo \DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') ?> UTC</td>
|
<td class="pad-left"><?php echo \DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') ?> UTC</td>
|
||||||
|
|
|
@ -77,7 +77,7 @@ if (strlen(trim($desc)) == 0) {
|
||||||
<div class="claim-info">
|
<div class="claim-info">
|
||||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||||
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
||||||
<img src="<?php echo htmlspecialchars($claim->thumbnail_url) ?>" alt="" />
|
<img src="<?php echo htmlspecialchars('https://thumbnails.odycdn.com/optimize/s:1280:720/quality:85/plain/'.$claim->thumbnail_url) ?>" alt="" />
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
@ -136,9 +136,7 @@ if (strlen(trim($desc)) == 0) {
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<div class="value half-width"<?php if(strlen(trim($claim->license)) > 0): ?> title="<?php echo $claim->license ?>"<?php endif; ?>>
|
<div class="value half-width"<?php if(strlen(trim($claim->license)) > 0): ?> title="<?php echo $claim->license ?>"<?php endif; ?>>
|
||||||
<?php if (strlen(trim($claim->license_url)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
|
||||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<div class="value half-width"><?php echo strlen(trim($claim->language)) > 0 ? ($claim->language == 'en' ? 'English' : '') : '<em>Unspecified</em>' ?></div>
|
<div class="value half-width"><?php echo strlen(trim($claim->language)) > 0 ? ($claim->language == 'en' ? 'English' : '') : '<em>Unspecified</em>' ?></div>
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
<td><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></td>
|
<td><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></td>
|
||||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->block_time)->diffForHumans(); ?></td>
|
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->block_time)->diffForHumans(); ?></td>
|
||||||
<td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td>
|
<td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td>
|
||||||
<td class="right"><?php echo $block->transaction_count ?></td>
|
<td class="right"><?php echo $block->tx_count ?></td>
|
||||||
<td class="right"><?php echo number_format($block->difficulty, 2, '.', '') ?></td>
|
<td class="right"><?php echo number_format($block->difficulty, 2, '.', '') ?></td>
|
||||||
<td class="last-cell"><?php echo DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') . ' UTC' ?></td>
|
<td class="last-cell"><?php echo DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') . ' UTC' ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -203,7 +203,7 @@
|
||||||
|
|
||||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||||
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
||||||
<img src="<?php echo strip_tags($claim->thumbnail_url) ?>" alt="" />
|
<img src="<?php echo strip_tags('https://thumbnails.odycdn.com/optimize/s:1280:720/quality:85/plain/'.$claim->thumbnail_url) ?>" alt="" />
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
<tr data-height="<?php echo $block->height ?>" data-time="<?php echo $block->block_time ?>">
|
<tr data-height="<?php echo $block->height ?>" data-time="<?php echo $block->block_time ?>">
|
||||||
<td><a href="/blocks/<?php echo $block->height ?>" target="_blank"><?php echo $block->height ?></a></td>
|
<td><a href="/blocks/<?php echo $block->height ?>" target="_blank"><?php echo $block->height ?></a></td>
|
||||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->block_time)->diffForHumans(); ?></td>
|
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->block_time)->diffForHumans(); ?></td>
|
||||||
<td class="right"><?php echo $block->transaction_count ?></td>
|
<td class="right"><?php echo $block->tx_count ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -38,7 +38,7 @@ function buildChartData(claimsData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadChartData() {
|
function loadChartData() {
|
||||||
var api_url = "https://chainquery.lbry.com/api/sql?query=";
|
var api_url = "https://chainquery.odysee.tv/api/sql?query=";
|
||||||
var query = "SELECT c1.claim_type, c1.bid_state, c1.effective_amount, c1.transaction_time, o.transaction_time AS 'spent_time' FROM claim c1 LEFT JOIN (SELECT output.claim_id, tx.transaction_time FROM output INNER JOIN input ON input.prevout_hash = output.transaction_hash AND input.prevout_n = output.vout INNER JOIN transaction tx ON tx.id = input.transaction_id) o ON o.claim_id=c1.claim_id AND c1.bid_state='Spent' ORDER BY c1.transaction_time ASC";
|
var query = "SELECT c1.claim_type, c1.bid_state, c1.effective_amount, c1.transaction_time, o.transaction_time AS 'spent_time' FROM claim c1 LEFT JOIN (SELECT output.claim_id, tx.transaction_time FROM output INNER JOIN input ON input.prevout_hash = output.transaction_hash AND input.prevout_n = output.vout INNER JOIN transaction tx ON tx.id = input.transaction_id) o ON o.claim_id=c1.claim_id AND c1.bid_state='Spent' ORDER BY c1.transaction_time ASC";
|
||||||
var url = api_url + query;
|
var url = api_url + query;
|
||||||
var loadProgress = $('.bids-chart-container .load-progress');
|
var loadProgress = $('.bids-chart-container .load-progress');
|
||||||
|
|
|
@ -97,7 +97,7 @@ function buildChartData(blockData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadChartData() {
|
function loadChartData() {
|
||||||
var api_url = "https://chainquery.lbry.com/api/sql?query=";
|
var api_url = "https://chainquery.odysee.tv/api/sql?query=";
|
||||||
var query = "SELECT height, block_time FROM block WHERE confirmations > 0 ORDER BY height";
|
var query = "SELECT height, block_time FROM block WHERE confirmations > 0 ORDER BY height";
|
||||||
var url = api_url + query;
|
var url = api_url + query;
|
||||||
var loadProgress = $('.mining-inflation-chart-container .load-progress');
|
var loadProgress = $('.mining-inflation-chart-container .load-progress');
|
||||||
|
|
Loading…
Reference in a new issue