Compare commits
56
Commits
Mooore
...
tx-claim-link
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d426c1fd0c | ||
|
|
2164abd52f | ||
|
|
c13c06f74f | ||
|
|
ad82fc3975 | ||
|
|
4d0efbaff8 | ||
|
|
07a0d0c0fe | ||
|
|
c09da8ade8 | ||
|
|
1a082dc794 | ||
|
|
69734f2add | ||
|
|
1505548a3a | ||
|
|
0d1bd292fe | ||
|
|
c8462afdee | ||
|
|
a8a956f2bc | ||
|
|
b91b3681d3 | ||
|
|
190d998e4c | ||
|
|
667097f35d | ||
|
|
8d552afe8f | ||
|
|
ad4615cc5a | ||
|
|
3ad5db032b | ||
|
|
e25cd7807e | ||
|
|
71c7834521 | ||
|
|
27ff22ff5a | ||
|
|
70032020f5 | ||
|
|
c8ca48220f | ||
|
|
c2a19d91c1 | ||
|
|
d3e542dd91 | ||
|
|
5d23294dba | ||
|
|
a0cbc324b7 | ||
|
|
f66101a9de | ||
|
|
537dd85473 | ||
|
|
0adcf92cbb | ||
|
|
ade487848d | ||
|
|
7706338460 | ||
|
|
c60b3946ce | ||
|
|
6bf194c448 | ||
|
|
7cd3e5322c | ||
|
|
c82fd1a982 | ||
|
|
efcce65004 | ||
|
|
df6264f388 | ||
|
|
a99606ecbf | ||
|
|
f2bf172997 | ||
|
|
5db80ac0d4 | ||
|
|
fe14cd88f0 | ||
|
|
a855ee3d94 | ||
|
|
58620a6298 | ||
|
|
409a0a7da7 | ||
|
|
6e6dcd0613 | ||
|
|
ba995ed51f | ||
|
|
e7e444f84a | ||
|
|
1d9dbb802b | ||
|
|
85926e316f | ||
|
|
7f701f87d5 | ||
|
|
06a495d396 | ||
|
|
a19e3abd07 | ||
|
|
66940ac02a | ||
|
|
5acd8f6039 |
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
/vendor/*
|
||||
/config/app.php
|
||||
/tmp/*
|
||||
/config/lbry.php
|
||||
/logs/*
|
||||
lbryexplorer.zip
|
||||
lbryexplorer.komodoproject
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017-2018 LBRY Inc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
# LBRY Block Explorer
|
||||
|
||||
A simple PHP block explorer for browsing transactions and claims on the [LBRY](https://lbry.io) blockchain. The explorer was developed using CakePHP which is a model-view-controller (MVC) PHP framework.
|
||||
|
||||
## Installation
|
||||
There are some prerequisites that need to be installed before the explorer can be accessed.
|
||||
* Web server - Apache, caddy or nginx
|
||||
* [lbrycrd](https://github.com/lbryio/lbrycrd) with txindex turned on
|
||||
* [Python claims decoder](https://github.com/cryptodevorg/lbry-decoder)
|
||||
* MariaDB 10.2 or higher
|
||||
* Redis Server (optional, only required for the CakePHP redis cache engine, or to run `forevermempool`)
|
||||
* PHP 7.2 or higher
|
||||
* php-fpm
|
||||
* [igbinary extension](https://github.com/igbinary/igbinary)
|
||||
* [phpredis extension](https://github.com/phpredis/phpredis)
|
||||
* composer (PHP package manager)
|
||||
|
||||
### Installation steps
|
||||
* 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`
|
||||
* Change the working directory to the cloned directory and run composer.
|
||||
```
|
||||
cd block-explorer
|
||||
composer update
|
||||
```
|
||||
* Create the directories, `tmp` and `logs` in the `block-explorer` folder if they have not been created yet, and make sure that they are writable by the web server.
|
||||
* Copy `config/app.default.php` to `config/app.php`. Edit the database connection values to correspond to your environment.
|
||||
* Copy `config/lbry.default.php` to `config/lbry.php`. Update the values for LBRY RPC URL and the Redis URL to correspond to your environment.
|
||||
* Configure your web server with the host root folder set to `<path to>/block-explorer/webroot` where `<path to>` is the absolute path to the configuraiton. Here is a sample nginx configuration. You can make changes to this configuration to correspond to your environment.
|
||||
```
|
||||
server {
|
||||
listen 80;
|
||||
server_name my.explorer.com;
|
||||
|
||||
root /var/www/block-explorer/webroot;
|
||||
index index.php;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
# pass the PHP scripts to FastCGI server listening on the php-fpm socket
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_ignore_client_abort on;
|
||||
fastcgi_param PHP_AUTH_USER $remote_user;
|
||||
fastcgi_param PHP_AUTH_PW $http_authorization;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
}
|
||||
```
|
||||
* Restart your web server.
|
||||
|
||||
|
||||
### Cron jobs
|
||||
There are a few scripts which can be set up as cron jobs or scheduled tasks.
|
||||
|
||||
#### blocks.sh
|
||||
Detect new LBRY blocks. Can also be configured to be triggered using the lbrycrd `blocknotify` flag. This cron will create new blocks obtained from lbrycrd starting from the highest block number in the database, and then create the corresponding block transactions. If there are pending transactions created by the forevermempool script, they will be automatically associated with the respective blocks.
|
||||
|
||||
#### claimindex.sh
|
||||
Create claims found on the LBRY blockchain in the database. This requires the Python decoder to be running in the background.
|
||||
|
||||
#### pricehistory.sh
|
||||
Get the current LBC price in USD and store the value in the `PriceHistory` table. This also caches the most recent price in Redis.
|
||||
|
||||
#### forever.sh
|
||||
Run the `forevermempool` script, and restart if necessary. The `forevermempool` script checks the LBRY blockchain mempool every second and creates transactions found in the database. The script makes use of Redis for caching the pending transation IDs.
|
||||
|
||||
|
||||
## Usage
|
||||
Launch the URL for the configured web server root in a browser.
|
||||
|
||||
|
||||
## Contributing
|
||||
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
|
||||
|
||||
|
||||
## License
|
||||
This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
|
||||
|
||||
|
||||
## Security
|
||||
We take security seriously. Please contact security@lbry.io regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it.
|
||||
|
||||
|
||||
## Contact
|
||||
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.io)
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
"mobiledetect/mobiledetectlib": "2.*",
|
||||
"cakephp/migrations": "~1.0",
|
||||
"cakephp/plugin-installer": "~1.0",
|
||||
"mdanter/ecc": "^0.4.2",
|
||||
"mdanter/ecc": "^0.5.0",
|
||||
"nesbot/carbon": "~1.18",
|
||||
"endroid/qrcode": "^2.2.2",
|
||||
"predis/predis": "^1.1.1"
|
||||
|
||||
Generated
+551
-555
File diff suppressed because it is too large.
Load diff
@@ -220,3 +220,6 @@ Type::build('timestamp')
|
||||
if (Configure::read('debug')) {
|
||||
Plugin::load('DebugKit', ['bootstrap' => true]);
|
||||
}
|
||||
|
||||
Configure::load('lbry');
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Lbry' => [
|
||||
'RpcUrl' => 'http://user:password@127.0.0.1:9245',
|
||||
],
|
||||
|
||||
'Redis' => [
|
||||
'Url' => 'tcp://127.0.0.1:6379',
|
||||
]
|
||||
];
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake block addrtxamounts
|
||||
|
||||
+4
-1
@@ -1,4 +1,7 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake block parsenewblocks
|
||||
rm tmp/lock/parsenewblocks 2>/dev/null
|
||||
bin/cake block parsetxs
|
||||
rm tmp/lock/parsetxs 2>/dev/null
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
<?php
|
||||
|
||||
define('TMP', '/tmp/');
|
||||
define('DS', '/');
|
||||
|
||||
class BlockSyncThread extends \Thread {
|
||||
private $_startHeight;
|
||||
private $_endHeight;
|
||||
private $_maxHeight;
|
||||
|
||||
public function __construct($startBlock, $endBlock, $maxHeight) {
|
||||
$this->_startHeight = $startBlock;
|
||||
$this->_endHeight = $endBlock;
|
||||
$this->_maxHeight = $maxHeight;
|
||||
}
|
||||
|
||||
public function run() {
|
||||
$conn = new \PDO("mysql:host=localhost;dbname=lbry", 'lbry-admin', '46D861aX#!yQ');
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$data_error = false;
|
||||
$conn->beginTransaction();
|
||||
|
||||
// TODO: Batch block synchronisation from memory to DB
|
||||
|
||||
for ($curr_height = $this->_startHeight; $curr_height <= $this->_endHeight; $curr_height++) {
|
||||
$idx_str = str_pad($curr_height, strlen($this->_maxHeight), '0', STR_PAD_LEFT);
|
||||
|
||||
// get the block hash
|
||||
$req = ['method' => 'getblockhash', 'params' => [$curr_height]];
|
||||
$response = BlockStuff::curl_json_post(BlockStuff::rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$curr_block_hash = $json->result;
|
||||
|
||||
$req = ['method' => 'getblock', 'params' => [$curr_block_hash]];
|
||||
$response = BlockStuff::curl_json_post(BlockStuff::rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$curr_block = $json->result;
|
||||
|
||||
$stmt = $conn->prepare('UPDATE Blocks SET Confirmations = ? WHERE Height = ?');
|
||||
try {
|
||||
$stmt->execute([$curr_block->confirmations, $curr_height]);
|
||||
echo "[$idx_str/$this->_maxHeight] Updated block height: $curr_height with confirmations $curr_block->confirmations.\n";
|
||||
} catch (Exception $e) {
|
||||
$data_error = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($data_error) {
|
||||
echo "Rolling back changes.\n";
|
||||
$conn->rollBack();
|
||||
return;
|
||||
}
|
||||
|
||||
echo "Committing data.\n";
|
||||
$conn->commit();
|
||||
}
|
||||
}
|
||||
|
||||
class BlockStuff {
|
||||
const rpcurl = 'http://lrpc:lrpc@127.0.0.1:9245';
|
||||
public static function blocksync() {
|
||||
self::lock('blocksync');
|
||||
|
||||
$conn = new \PDO("mysql:host=localhost;dbname=lbry", 'lbry-admin', '46D861aX#!yQ');
|
||||
|
||||
$stmt = $conn->prepare('SELECT Height FROM Blocks ORDER BY Height DESC LIMIT 1');
|
||||
$stmt->execute([]);
|
||||
$max_block = $stmt->fetch(PDO::FETCH_OBJ);
|
||||
if ($max_block) {
|
||||
$chunk_limit = 2;
|
||||
$curr_height = 0;
|
||||
$chunks = floor($max_block->Height / $chunk_limit);
|
||||
$threads = [];
|
||||
for ($i = 0; $i < $chunk_limit; $i++) {
|
||||
$start = $curr_height;
|
||||
$end = ($i == ($chunk_limit - 1)) ? $max_block->Height : $start + $chunks;
|
||||
$curr_height += $chunks + 1;
|
||||
$thread = new BlockSyncThread($start, $end, $max_block->Height);
|
||||
$threads[] = $thread;
|
||||
|
||||
$thread->start();
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($threads); $i++) {
|
||||
$threads[$i]->join();
|
||||
}
|
||||
}
|
||||
|
||||
self::unlock('blocksync');
|
||||
}
|
||||
|
||||
public static function curl_json_post($url, $data, $headers = []) {
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
//Log::debug('Request execution completed.');
|
||||
if ($response === false) {
|
||||
$error = curl_error($ch);
|
||||
$errno = curl_errno($ch);
|
||||
curl_close($ch);
|
||||
|
||||
throw new \Exception(sprintf('The request failed: %s', $error), $errno);
|
||||
} else {
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
// Close any open file handle
|
||||
return $response;
|
||||
}
|
||||
|
||||
public static function lock($process_name) {
|
||||
if (!is_dir(TMP . 'lock')) {
|
||||
mkdir(TMP . 'lock');
|
||||
}
|
||||
$lock_file = TMP . 'lock' . DS . $process_name;
|
||||
if (file_exists($lock_file)) {
|
||||
echo "$process_name is already running.\n";
|
||||
exit(0);
|
||||
}
|
||||
file_put_contents($lock_file, '1');
|
||||
}
|
||||
|
||||
public static function unlock($process_name) {
|
||||
$lock_file = TMP . 'lock' . DS . $process_name;
|
||||
if (file_exists($lock_file)) {
|
||||
unlink($lock_file);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
BlockStuff::blocksync();
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake block parsetxs
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake block buildclaimindex
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng/cron
|
||||
php -d extension=pthreads.so blockstuff.php
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake block fixzerooutputs
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
pkill -f forevermempool
|
||||
rm -f /home/lbry/explorer.lbry.io/tmp/lock/forevermempool 2>/dev/null
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake block forevermempool &
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
bin/cake block forevermempool &
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake block parsemempool
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake aux pricehistory
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake block updatespends
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd /var/www/lbry.block.ng
|
||||
cd /home/lbry/explorer.lbry.io
|
||||
bin/cake aux verifytags
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
l--DROP DATABASE IF EXISTS lbry;
|
||||
--DROP DATABASE IF EXISTS lbry;
|
||||
CREATE DATABASE lbry DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
USE lbry;
|
||||
|
||||
@@ -163,11 +163,11 @@ CREATE TABLE `TransactionsAddresses`
|
||||
`AddressId` BIGINT UNSIGNED NOT NULL,
|
||||
`DebitAmount` DECIMAL(18,8) DEFAULT 0 NOT NULL COMMENT 'Sum of the inputs to this address for the tx',
|
||||
`CreditAmount` DECIMAL(18,8) DEFAULT 0 NOT NULL COMMENT 'Sum of the outputs to this address for the tx',
|
||||
`LatestTransactionTime` DATETIME DEFAULT UTC_TIMESTAMP() NOT NULL,
|
||||
`TransactionTime` DATETIME DEFAULT UTC_TIMESTAMP() NOT NULL,
|
||||
PRIMARY KEY `PK_TransactionAddress` (`TransactionId`, `AddressId`),
|
||||
FOREIGN KEY `Idx_TransactionsAddressesTransaction` (`TransactionId`) REFERENCES `Transactions` (`Id`),
|
||||
FOREIGN KEY `Idx_TransactionsAddressesAddress` (`AddressId`) REFERENCES `Addresses` (`Id`),
|
||||
INDEX `Idx_TransactionsAddressesLatestTransactionTime` (`LatestTransactionTime`),
|
||||
INDEX `Idx_TransactionsAddressesTransactionTime` (`TransactionTime`),
|
||||
INDEX `Idx_TransactionsAddressesDebit` (`DebitAmount`),
|
||||
INDEX `Idx_TransactionsAddressesCredit` (`CreditAmount`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
|
||||
@@ -233,7 +233,3 @@ CREATE TABLE `PriceHistory`
|
||||
PRIMARY KEY `PK_PriceHistory` (`Id`),
|
||||
UNIQUE KEY `Idx_PriceHistoryCreated` (`Created`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
|
||||
|
||||
ALTER TABLE Claims ADD UNIQUE KEY `Idx_ClaimUnique` (`TransactionHash`, `Vout`, `ClaimId`);
|
||||
ALTER TABLE Addresses ADD COLUMN `Balance` DECIMAL(18,8) AS (`TotalReceived` - `TotalSent`) PERSISTENT AFTER `TotalSent`;
|
||||
ALTER TABLE Addresses ADD INDEX `Idx_AddressBalance` (`Balance`);
|
||||
@@ -7,6 +7,7 @@ use Mdanter\Ecc\Crypto\Signature\Signer;
|
||||
use Mdanter\Ecc\Serializer\PublicKey\PemPublicKeySerializer;
|
||||
use Mdanter\Ecc\Serializer\PublicKey\DerPublicKeySerializer;
|
||||
use Mdanter\Ecc\Serializer\Signature\DerSignatureSerializer;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Log\Log;
|
||||
use Endroid\QrCode\ErrorCorrectionLevel;
|
||||
@@ -15,7 +16,7 @@ use Endroid\QrCode\QrCode;
|
||||
|
||||
class MainController extends AppController {
|
||||
|
||||
const rpcurl = 'http://lrpc:lrpc@127.0.0.1:9245';
|
||||
public static $rpcurl;
|
||||
|
||||
const lbcPriceKey = 'lbc.price';
|
||||
|
||||
@@ -29,7 +30,8 @@ class MainController extends AppController {
|
||||
|
||||
public function initialize() {
|
||||
parent::initialize();
|
||||
$this->redis = new \Predis\Client('tcp://127.0.0.1:6379');
|
||||
self::$rpcurl = Configure::read('Lbry.RpcUrl');
|
||||
$this->redis = new \Predis\Client(Configure::read('Redis.Url'));
|
||||
try {
|
||||
$this->redis->info('mem');
|
||||
} catch (\Predis\Connection\ConnectionException $e) {
|
||||
@@ -400,7 +402,11 @@ class MainController extends AppController {
|
||||
}
|
||||
|
||||
$offset = ($page - 1) * $pageLimit;
|
||||
$blocks = $this->Blocks->find()->offset($offset)->limit($pageLimit)->order(['Height' => 'DESC'])->toArray();
|
||||
$currentBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'DESC'])->first();
|
||||
$blocks = $this->Blocks->find()->select(
|
||||
['Height', 'Difficulty', 'TransactionHashes', 'BlockSize', 'Nonce', 'BlockTime']
|
||||
)->offset($offset)->limit($pageLimit)->order(['Height' => 'DESC'])->toArray();
|
||||
$this->set('currentBlock', $currentBlock);
|
||||
$this->set('blocks', $blocks);
|
||||
$this->set('pageLimit', $pageLimit);
|
||||
$this->set('numPages', $numPages);
|
||||
@@ -421,7 +427,7 @@ class MainController extends AppController {
|
||||
try {
|
||||
// update the block confirmations
|
||||
$req = ['method' => 'getblock', 'params' => [$block->Hash]];
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$rpc_block = $json->result;
|
||||
if (isset($rpc_block->confirmations)) {
|
||||
@@ -446,6 +452,8 @@ class MainController extends AppController {
|
||||
$this->loadModel('Transactions');
|
||||
$this->loadModel('Inputs');
|
||||
$this->loadModel('Outputs');
|
||||
$this->loadModel('Claims');
|
||||
|
||||
$sourceAddress = $this->request->query('address');
|
||||
|
||||
$tx = $this->Transactions->find()->select(
|
||||
@@ -460,13 +468,17 @@ class MainController extends AppController {
|
||||
$conn->execute('UPDATE Transactions SET TransactionSize = ? WHERE Id = ?', [$tx->TransactionSize, $tx->Id]);
|
||||
}
|
||||
|
||||
$maxBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'desc'])->first();
|
||||
$block = $this->Blocks->find()->select(['Confirmations', 'Height'])->where(['Hash' => $tx->BlockHash])->first();
|
||||
$confirmations = $block ? (($maxBlock->Height - $block->Height) + 1) : '0';
|
||||
$inputs = $this->Inputs->find()->contain(['InputAddresses'])->where(['TransactionId' => $tx->Id])->order(['PrevoutN' => 'asc'])->toArray();
|
||||
$outputs = $this->Outputs->find()->contain(['OutputAddresses', 'SpendInput' => ['fields' => ['Id', 'TransactionHash', 'PrevoutN', 'PrevoutHash']]])->where(['Outputs.TransactionId' => $tx->Id])->order(['Vout' => 'asc'])->toArray();
|
||||
for ($i = 0; $i < count($outputs); $i++) {
|
||||
$outputs[$i]->IsClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'CLAIM') > -1);
|
||||
$outputs[$i]->IsSupportClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'SUPPORT_CLAIM') > -1);
|
||||
$outputs[$i]->IsUpdateClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'UPDATE_CLAIM') > -1);
|
||||
$claim = $this->Claims->find()->where(['TransactionHash' => $tx->Hash, 'Vout' => $outputs[$i]->Vout])->first();
|
||||
$outputs[$i]->Claim = $claim;
|
||||
}
|
||||
|
||||
$totalIn = 0;
|
||||
@@ -482,7 +494,7 @@ class MainController extends AppController {
|
||||
|
||||
$this->set('tx', $tx);
|
||||
$this->set('block', $block);
|
||||
$this->set('confirmations', $block ? number_format($block->Confirmations, 0, '', ',') : '0');
|
||||
$this->set('confirmations', $confirmations);
|
||||
$this->set('fee', $fee);
|
||||
$this->set('inputs', $inputs);
|
||||
$this->set('outputs', $outputs);
|
||||
@@ -524,6 +536,7 @@ class MainController extends AppController {
|
||||
public function address($addr = null) {
|
||||
set_time_limit(0);
|
||||
|
||||
$this->loadModel('Blocks');
|
||||
$this->loadModel('Addresses');
|
||||
$this->loadModel('Transactions');
|
||||
$this->loadModel('Inputs');
|
||||
@@ -552,7 +565,6 @@ class MainController extends AppController {
|
||||
$tagRequestAmount = '25.' . rand(11111111, 99999999);
|
||||
}
|
||||
|
||||
|
||||
$address = $this->Addresses->find()->where(['Address' => $addr])->first();
|
||||
if (!$address) {
|
||||
if (strlen($addr) === 34) {
|
||||
@@ -591,13 +603,18 @@ class MainController extends AppController {
|
||||
$stmt = $conn->execute('SELECT A.TotalReceived, A.TotalSent, A.Balance FROM Addresses A WHERE A.Id = ?', [$address->Id]);
|
||||
$totals = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
$stmt = $conn->execute(sprintf('SELECT T.Id, T.Hash, T.InputCount, T.OutputCount, T.Value, ' .
|
||||
'TA.DebitAmount, TA.CreditAmount, ' .
|
||||
'B.Height, B.Confirmations, IFNULL(T.TransactionTime, T.CreatedTime) AS TxTime ' .
|
||||
'FROM Transactions T ' .
|
||||
'LEFT JOIN Blocks B ON T.BlockHash = B.Hash ' .
|
||||
'RIGHT JOIN (SELECT TransactionId, DebitAmount, CreditAmount FROM TransactionsAddresses ' .
|
||||
' WHERE AddressId = ? ORDER BY TransactionTime DESC LIMIT %d, %d) TA ON TA.TransactionId = T.Id', $offset, $pageLimit), [$addressId]);
|
||||
$currentBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'desc'])->first();
|
||||
$currentHeight = $currentBlock ? intval($currentBlock->Height) : 0;
|
||||
|
||||
$stmt = $conn->execute(sprintf(
|
||||
'SELECT T.Id, T.Hash, T.InputCount, T.OutputCount, T.Value, ' .
|
||||
' TA.DebitAmount, TA.CreditAmount, ' .
|
||||
' B.Height, (CASE WHEN B.Height IS NOT NULL THEN ((' . $currentHeight . ' - B.Height) + 1) ELSE NULL END) AS Confirmations, ' .
|
||||
' IFNULL(T.TransactionTime, T.CreatedTime) AS TxTime ' .
|
||||
'FROM Transactions T ' .
|
||||
'LEFT JOIN Blocks B ON T.BlockHash = B.Hash ' .
|
||||
'RIGHT JOIN (SELECT TransactionId, DebitAmount, CreditAmount FROM TransactionsAddresses ' .
|
||||
' WHERE AddressId = ? ORDER BY TransactionTime DESC LIMIT %d, %d) TA ON TA.TransactionId = T.Id', $offset, $pageLimit), [$addressId]);
|
||||
$recentTxs = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
|
||||
$totalRecvAmount = $totals->TotalReceived == 0 ? '0' : $totals->TotalReceived + 0;
|
||||
@@ -671,7 +688,7 @@ class MainController extends AppController {
|
||||
private function _gethashrate() {
|
||||
$req = ['method' => 'getnetworkhashps', 'params' => []];
|
||||
try {
|
||||
$res = json_decode(self::curl_json_post(self::rpcurl, json_encode($req)));
|
||||
$res = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req)));
|
||||
if (!isset($res->result)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -680,10 +697,11 @@ class MainController extends AppController {
|
||||
return 'N/A';
|
||||
}
|
||||
}
|
||||
|
||||
private function _gettxoutsetinfo() {
|
||||
$req = ['method' => 'gettxoutsetinfo', 'params' => []];
|
||||
try {
|
||||
$res = json_decode(self::curl_json_post(self::rpcurl, json_encode($req)));
|
||||
$res = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req)));
|
||||
if (!isset($res->result)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -692,6 +710,7 @@ class MainController extends AppController {
|
||||
return 'N/A';
|
||||
}
|
||||
}
|
||||
|
||||
public function apistatus() {
|
||||
$this->autoRender = false;
|
||||
$this->loadModel('Blocks');
|
||||
@@ -864,28 +883,37 @@ class MainController extends AppController {
|
||||
public function apiutxosupply() {
|
||||
$this->autoRender = false;
|
||||
$this->loadModel('Addresses');
|
||||
|
||||
|
||||
$circulating = 0;
|
||||
$reservedcommunity = 0;
|
||||
$reservedoperational = 0;
|
||||
$reservedinstitutional = 0;
|
||||
$reservedtotal = 0;
|
||||
$circulating = 0;
|
||||
|
||||
|
||||
$txoutsetinfo = $this->_gettxoutsetinfo();
|
||||
$reservedcommunity = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'rFLUohPG4tP3gZHYoyhvADCtrDMiaYb7Qd'])->first();
|
||||
$reservedoperational = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'r9PGXsejVJb9ZfMf3QVdDEJCzxkd9JLxzL'])->first();
|
||||
$reservedinstitutional = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'r9srwX7DEN7Mex3a8oR1mKSqQmLBizoJvi'])->first();
|
||||
//aux is the address where some of the LBRY operational fund are, but not sold on market.
|
||||
$reservedaux = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt'])->first();
|
||||
//aux is the address of hot wallets and where some of the LBRY operational fund are, but not sold on market.
|
||||
$reservedaux = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bU2XUzckfpdEuQNemKvhPT1gexQ3GG3SC2'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h'])->first();
|
||||
|
||||
$reservedtotal = $reservedcommunity->Balance + $reservedoperational->Balance + $reservedinstitutional->Balance + $reservedaux->Balance;
|
||||
|
||||
|
||||
|
||||
|
||||
$circulating = $txoutsetinfo->total_amount - $reservedtotal;
|
||||
|
||||
|
||||
return $this->_jsonResponse(['success' => true, 'utxosupply' => ['total' => $txoutsetinfo->total_amount, 'circulating' => $circulating]]);
|
||||
}
|
||||
|
||||
|
||||
private static function curl_json_post($url, $data, $headers = []) {
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
|
||||
@@ -5,7 +5,19 @@ namespace App\Model\Entity;
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
class Claim extends Entity {
|
||||
function getLbryLink() {
|
||||
$link = $this->Name;
|
||||
if (isset($this->Publisher->Name)) {
|
||||
$link = $this->Publisher->Name . '/' . $link;
|
||||
}
|
||||
$link = 'lbry://' . $link;
|
||||
return $link;
|
||||
}
|
||||
|
||||
function getExplorerLink() {
|
||||
$link = '/claims/' . $this->ClaimId;
|
||||
return $link;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -4,12 +4,15 @@ namespace App\Shell;
|
||||
|
||||
use Cake\Console\ConsoleOutput;
|
||||
use Cake\Console\Shell;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Log\Log;
|
||||
use Mdanter\Ecc\EccFactory;
|
||||
|
||||
class AuxShell extends Shell {
|
||||
|
||||
public static $rpcurl;
|
||||
|
||||
const bittrex = 'https://bittrex.com/api/v1.1/public/getticker?market=BTC-LBC';
|
||||
|
||||
const blockchainticker = 'https://blockchain.info/ticker';
|
||||
@@ -20,12 +23,11 @@ class AuxShell extends Shell {
|
||||
|
||||
const scriptAddress = [5, 122];
|
||||
|
||||
const rpcurl = 'http://lrpc:lrpc@127.0.0.1:9245';
|
||||
|
||||
const tagrcptaddress = 'bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp';
|
||||
|
||||
public function initialize() {
|
||||
parent::initialize();
|
||||
self::$rpcurl = Configure::read('Lbry.RpcUrl');
|
||||
$this->loadModel('Addresses');
|
||||
$this->loadModel('Inputs');
|
||||
$this->loadModel('Outputs');
|
||||
@@ -126,7 +128,7 @@ class AuxShell extends Shell {
|
||||
self::lock('pricehistory');
|
||||
|
||||
$conn = ConnectionManager::get('default');
|
||||
$redis = new \Predis\Client('tcp://127.0.0.1:6379');
|
||||
$redis = new \Predis\Client(Configure::read('Redis.Url'));
|
||||
|
||||
try {
|
||||
// Only allow 5-minute update intervals
|
||||
|
||||
+33
-25
@@ -4,24 +4,27 @@ namespace App\Shell;
|
||||
|
||||
use Cake\Console\ConsoleOutput;
|
||||
use Cake\Console\Shell;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Log\Log;
|
||||
use Mdanter\Ecc\EccFactory;
|
||||
|
||||
class BlockShell extends Shell {
|
||||
|
||||
public static $rpcurl;
|
||||
|
||||
public static $redisurl;
|
||||
|
||||
const mempooltxkey = 'lbc.mempooltx';
|
||||
|
||||
const pubKeyAddress = [0, 85];
|
||||
|
||||
const scriptAddress = [5, 122];
|
||||
|
||||
const rpcurl = 'http://lrpc:lrpc@127.0.0.1:9245';
|
||||
|
||||
const redisurl = 'tcp://127.0.0.1:6379';
|
||||
|
||||
public function initialize() {
|
||||
parent::initialize();
|
||||
self::$rpcurl = Configure::read('Lbry.RpcUrl');
|
||||
self::$redisurl = Configure::read('Redis.Url');
|
||||
$this->loadModel('Blocks');
|
||||
$this->loadModel('Addresses');
|
||||
$this->loadModel('Claims');
|
||||
@@ -35,11 +38,6 @@ class BlockShell extends Shell {
|
||||
$this->out('No arguments specified');
|
||||
}
|
||||
|
||||
public function testtx() {
|
||||
$raw = '0100000001e4801fa8c9621753410e6c576c73168cc551624e08e4cc56e9a9189e8ebabcc3010000006b483045022100dcc5ae5564353e05cd8415936cdb534a26049a80a9866dbcab5dbb6ab16abbc702203af681fb5fbba5c78af887778aa32f27bc653312322b44c2a78e883e322921790121031c38def6b103b58481818d7d8aba39f9f51798f686ec3332bac23726a23366adffffffff0200e1f50500000000fd3a01b512626c6f636b6578706c6f7265722d686f6d654d0801080110011aa3010801125c080410011a1c4c42525920426c6f636b204578706c6f72657220486f6d6570616765222c574950204c42525920426c6f636b204578706c6f72657220686f6d6520706167652073637265656e73686f742a00320038004a0052005a001a41080110011a3038c6bf4a310d5b172aaae03cffb93e5a27c47f3946f58af0a4b9f99d7be42998f7dcec9b0fb0c124a6477bdb4c5311db2209696d6167652f706e672a5c080110031a401eb69f65768ba2cc347067dfb1317131137f7d685a5e804a4aeedd2385332c70f3ec7632fcebfbc073e37a58dbfbf4e6641853bbfc188b0d8bf27435b540801d22146b2a1d378efcdb7db7a03baa7dfedb86b976bc4a6d7576a914b7182b0f7c896ab240d233f81cb891e3f25e739988ac8085e811000000001976a9146fde27b4dac0b79a9ea06756562a52b019da7a8e88ac00000000';
|
||||
$decoded = self::decode_tx($raw);
|
||||
}
|
||||
|
||||
public function fixscripthashtx() {
|
||||
$conn = ConnectionManager::get('default');
|
||||
$otxs = $this->Outputs->find()->select(['TransactionId'])->distinct(['TransactionId'])->where(['Type' => 'scripthash'])->toArray();
|
||||
@@ -47,7 +45,7 @@ class BlockShell extends Shell {
|
||||
$txid = $otx->TransactionId;
|
||||
$tx = $this->Transactions->find()->select(['Hash'])->where(['Id' => $txid])->first();
|
||||
$req = ['method' => 'getrawtransaction', 'params' => [$tx->Hash]];
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$tx_result = $json->result;
|
||||
$raw_tx = $tx_result;
|
||||
@@ -165,7 +163,7 @@ class BlockShell extends Shell {
|
||||
$req = ['method' => 'getvalueforname', 'params' => [$claim_name]];
|
||||
$json = null;
|
||||
try {
|
||||
$json = json_decode(self::curl_json_post(self::rpcurl, json_encode($req)));
|
||||
$json = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req)));
|
||||
if (!$json) {
|
||||
echo "[$idx_str/$count] getvalueforname failed for [$out->Hash:$vout]. Skipping.\n";
|
||||
continue;
|
||||
@@ -300,7 +298,7 @@ class BlockShell extends Shell {
|
||||
$req = ['method' => 'getvalueforname', 'params' => [$claim_name]];
|
||||
$json = null;
|
||||
try {
|
||||
$json = json_decode(self::curl_json_post(self::rpcurl, json_encode($req)));
|
||||
$json = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req)));
|
||||
if ($json) {
|
||||
$claim_data = [];
|
||||
$claim_id = $json->result->claimId;
|
||||
@@ -396,7 +394,7 @@ class BlockShell extends Shell {
|
||||
// getraw
|
||||
$req = ['method' => 'getrawtransaction', 'params' => [$tx->Hash]];
|
||||
$start_ms = round(microtime(true) * 1000);
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$diff_ms = (round(microtime(true) * 1000)) - $start_ms;
|
||||
$total_diff += $diff_ms;
|
||||
echo "getrawtx took {$diff_ms}ms. ";
|
||||
@@ -678,7 +676,7 @@ class BlockShell extends Shell {
|
||||
private function processtx($tx_hash, $block_ts, $block_data, &$data_error) {
|
||||
// Get the raw transaction (Use getrawtx daemon instead (for speed!!!)
|
||||
$req = ['method' => 'getrawtransaction', 'params' => [$tx_hash]];
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$tx_result = $json->result;
|
||||
$raw_tx = $tx_result;
|
||||
@@ -1080,12 +1078,13 @@ class BlockShell extends Shell {
|
||||
try {
|
||||
// Get the best block hash
|
||||
$req = ['method' => 'getbestblockhash', 'params' => []];
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
print_r($response); print_r($json);
|
||||
$best_hash = $json->result;
|
||||
|
||||
$req = ['method' => 'getblock', 'params' => [$best_hash]];
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$best_block = $json->result;
|
||||
|
||||
@@ -1108,20 +1107,20 @@ class BlockShell extends Shell {
|
||||
for ($curr_height = $min_height; $curr_height <= $max_height; $curr_height++) {
|
||||
// get the block hash
|
||||
$req = ['method' => 'getblockhash', 'params' => [$curr_height]];
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$curr_block_hash = $json->result;
|
||||
|
||||
$next_block_hash = null;
|
||||
if ($curr_height < $max_height) {
|
||||
$req = ['method' => 'getblockhash', 'params' => [$curr_height + 1]];
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$next_block_hash = $json->result;
|
||||
}
|
||||
|
||||
$req = ['method' => 'getblock', 'params' => [$curr_block_hash]];
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$curr_block = $json->result;
|
||||
|
||||
@@ -1132,7 +1131,7 @@ class BlockShell extends Shell {
|
||||
$next_block = null;
|
||||
if ($next_block_hash != null) {
|
||||
$req = ['method' => 'getblock', 'params' => [$next_block_hash]];
|
||||
$response = self::curl_json_post(self::rpcurl, json_encode($req));
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$next_block = $json->result;
|
||||
}
|
||||
@@ -1248,7 +1247,7 @@ class BlockShell extends Shell {
|
||||
while (true) {
|
||||
try {
|
||||
$data = ['method' => 'getrawmempool', 'params' => []];
|
||||
$res = self::curl_json_post(self::rpcurl, json_encode($data));
|
||||
$res = self::curl_json_post(self::$rpcurl, json_encode($data));
|
||||
$json = json_decode($res);
|
||||
$txs = $json->result;
|
||||
$now = new \DateTime('now', new \DateTimeZone('UTC'));
|
||||
@@ -1298,7 +1297,16 @@ class BlockShell extends Shell {
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
echo "Error occurred processing mempool: " . $e->getMessage() . "\n";
|
||||
echo "Mempool database error. Attempting to reconnect.\n";
|
||||
|
||||
// Final fix for MySQL server has gone away (hopefully)
|
||||
try {
|
||||
$conn->disconnect();
|
||||
} catch (\Exception $e) {
|
||||
// ignore possible disconnect errors
|
||||
}
|
||||
|
||||
$conn->connect();
|
||||
}
|
||||
|
||||
echo "*******************\n";
|
||||
@@ -1848,7 +1856,7 @@ class BlockShell extends Shell {
|
||||
// Other standard: pay to pubkey hash
|
||||
$define['p2pk'] = array('type' => 'pubkeyhash',
|
||||
'reqSigs' => 1,
|
||||
'data_index_for_hash' => 1);
|
||||
'data_index_for_hash' => 0);
|
||||
$rule['p2pk'] = [
|
||||
'0' => '/^[0-9a-f]+$/i',
|
||||
'1' => '/^OP_CHECKSIG/'
|
||||
@@ -2066,7 +2074,7 @@ class BlockShell extends Shell {
|
||||
}
|
||||
|
||||
public static function _init_redis() {
|
||||
$redis = new \Predis\Client(self::redisurl);
|
||||
$redis = new \Predis\Client(self::$redisurl);
|
||||
try {
|
||||
$redis->info('mem');
|
||||
} catch (\Predis\Connection\ConnectionException $e) {
|
||||
@@ -2196,4 +2204,4 @@ class BlockShell extends Shell {
|
||||
*/
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -9,6 +9,6 @@
|
||||
<button class="btn btn-inline-search">Search</button>
|
||||
</div>
|
||||
</form>
|
||||
</div
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -16,22 +16,16 @@
|
||||
<script src="https://use.typekit.net/yst3vhs.js"></script>
|
||||
<script>try{Typekit.load({ async: true });}catch(e){}</script>
|
||||
|
||||
<?php if ($_SERVER['HTTP_HOST'] !== 'local.lbry.block.ng' && $_SERVER['HTTP_HOST'] !== 'explorer.lbry.io'): ?>
|
||||
<!-- Analytics -->
|
||||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//analytics.aureolin.co/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', '1']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
<?php if ($_SERVER['HTTP_HOST'] === 'explorer.lbry.io'): ?>
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="//www.googletagmanager.com/gtag/js?id=UA-60403362-1"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'UA-60403362-4');
|
||||
</script>
|
||||
<!-- End Analytics Code -->
|
||||
<?php endif; ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -87,36 +87,10 @@
|
||||
|
||||
<div class="address-head">
|
||||
<h3>LBRY Address</h3>
|
||||
<h4><?php echo $address->Address ?></h4> <div class="tag">
|
||||
<h4><?php echo $address->Address ?></h4>
|
||||
<?php if (isset($address->Tag) && strlen(trim($address->Tag)) > 0): ?>
|
||||
<?php if (strlen(trim($address->TagUrl)) > 0): ?><a href="<?php echo $address->TagUrl ?>" target="_blank" rel="nofollow"><?php echo $address->Tag ?></a><?php else: echo $address->Tag; endif; ?>
|
||||
<?php else: ?><a href="#" class="tag-link">Tag this address</a><?php endif; ?></div>
|
||||
|
||||
<div class="tag-address-container">
|
||||
<h4>Tag adddress</h4>
|
||||
<?php if ($pending): ?>
|
||||
<div class="desc">This address has a pending tag request. If you made this request, please send exactly <strong><?php echo $pending->VerificationAmount ?> LBC</strong> from <strong><?php echo $address->Address ?></strong> to <strong><a href="/address/bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp" target="_blank">bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp</a></strong>. Incomplete requests will be automatically deleted 7 days from the request creation date.</div>
|
||||
<?php else: ?>
|
||||
<div class="desc">Label your public LBRY address with a name and an optional link. In order to tag this address, please send exactly <strong><?php echo $tagRequestAmount ?> LBC</strong>
|
||||
from <strong><?php echo $address->Address ?></strong> to <strong><a href="/address/bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp" target="_blank">bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp</a></strong>
|
||||
and then specify the desired tag (maximum 30 characters) and link in the fields below. The transaction will be verified after at least 1 confirmation. The <strong><?php echo $tagRequestAmount ?> LBC</strong> fee is a measure to prevent spam and low-effort submissions. Verification is an automatic process, but any tags or URLs that may be considered illegal when brought to attention will be removed.</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="tag_verify_amount" value="<?php echo $tagRequestAmount ?>" />
|
||||
<div class="error-message"></div>
|
||||
<div class="col">
|
||||
<input name="tag_value" maxlength="30" placeholder="Tag (max. 30 characters)" />
|
||||
</div>
|
||||
<div class="col">
|
||||
<input name="tag_url" maxlength="200" placeholder="Link (max. 200 characters)" />
|
||||
</div>
|
||||
<div class="col buttons">
|
||||
<button class="btn btn-tag">Tag address</button>
|
||||
<button class="btn btn-close">Close</button>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="address-subhead">
|
||||
@@ -184,13 +158,8 @@
|
||||
<td class="right"><?php echo number_format($tx->Confirmations, 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo $tx->InputCount ?></td>
|
||||
<td class="right"><?php echo $tx->OutputCount ?></td>
|
||||
<td class="right<?php echo ' ' . (($tx->DebitAmount > 0 && $tx->CreditAmount > 0) ? '' : (($tx->DebitAmount > 0) ? 'debit' : 'credit')) ?>">
|
||||
<?php if ($tx->DebitAmount > 0 && $tx->CreditAmount > 0): ?>
|
||||
<div class="credit">+<?php echo number_format($tx->CreditAmount, 8, '.', ',') ?> LBC</div>
|
||||
<div class="debit">-<?php echo number_format($tx->DebitAmount, 8, '.', ',') ?> LBC</div>
|
||||
<?php else: ?>
|
||||
<?php echo (($tx->DebitAmount > 0) ? '-' : '+'); ?><?php echo number_format((($tx->DebitAmount > 0) ? $tx->DebitAmount : $tx->CreditAmount), 8, '.', ',') ?> LBC
|
||||
<?php endif; ?>
|
||||
<td class="right<?php echo ' ' . ($tx->DebitAmount > 0 && $tx->CreditAmount > 0 ? 'diff' : ($tx->DebitAmount > 0 ? 'debit' : 'credit')) ?>">
|
||||
<?php echo number_format($tx->CreditAmount - $tx->DebitAmount, 8, '.', ',') ?> LBC
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -412,7 +412,7 @@
|
||||
<tr>
|
||||
<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="right"><?php echo number_format($block->Confirmations, 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo number_format((($currentBlock->Height - $block->Height) + 1), 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo count(json_decode($block->TransactionHashes)) ?></td>
|
||||
<td class="right"><?php echo round($block->BlockSize / 1024, 2) . 'KB' ?></td>
|
||||
<td class="right pad-left"><?php echo $block->Nonce ?></td>
|
||||
|
||||
@@ -40,14 +40,6 @@
|
||||
|
||||
$a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow'];
|
||||
$autoThumbText = '';
|
||||
$link = $claim->Name;
|
||||
$rawLink = $claim->Name;
|
||||
if (isset($claim->Publisher->Name)) {
|
||||
$link = urlencode($claim->Publisher->Name) . '/' . $link;
|
||||
$rawLink = $claim->Publisher->Name . '/' . $rawLink;
|
||||
}
|
||||
$link = 'lbry://' . $link;
|
||||
$rawLink = 'lbry://' . $rawLink;
|
||||
if ($claim->ClaimType == 1) { $autoThumbText = strtoupper(substr($claim->Name, 1, min( strlen($claim->Name), 10 ))); } else {
|
||||
$str = str_replace(' ', '', (strlen(trim($claim->Title)) > 0) ? $claim->Title : $claim->Name);
|
||||
$autoThumbText = strtoupper(mb_substr($str, 0, min( strlen($str), 10 )));
|
||||
@@ -81,7 +73,7 @@ if (strlen(trim($desc)) == 0) {
|
||||
<div class="claim-info">
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo $claim->ThumbnailUrl ?>" alt="" />
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
@@ -89,7 +81,7 @@ if (strlen(trim($desc)) == 0) {
|
||||
|
||||
<div class="content">
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label">Published by</div>
|
||||
<div class="label">Published By</div>
|
||||
<div class="value">
|
||||
<?php if (isset($claim->Publisher)): ?>
|
||||
<a href="lbry://<?php echo $claim->Publisher->Name ?>"><?php echo $claim->Publisher->Name ?></a>
|
||||
@@ -99,15 +91,15 @@ if (strlen(trim($desc)) == 0) {
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="label">Created</div>
|
||||
<div class="label">Created On</div>
|
||||
<div class="value"><?php echo \DateTime::createFromFormat('U', $claim->TransactionTime > 0 ? $claim->TransactionTime : $claim->Created->format('U'))->format('j M Y H:i:s') ?> UTC</div>
|
||||
|
||||
<div class="label">Transaction</div>
|
||||
<div class="label">Transaction ID</div>
|
||||
<div class="value"><a href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>"><?php echo $claim->TransactionHash ?></a></div>
|
||||
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label half-width">Cost</div>
|
||||
<div class="label half-width">Safe for work</div>
|
||||
<div class="label half-width">Safe for Work</div>
|
||||
|
||||
<div class="value half-width"><?php echo $cost ?></div>
|
||||
<div class="value half-width"><?php echo $claim->IsNSFW ? 'No' : 'Yes' ?></div>
|
||||
@@ -144,7 +136,7 @@ if (strlen(trim($desc)) == 0) {
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->Language)) > 0 ? ($claim->Language == 'en' ? 'English' : '') : '<em>Unspecified</em>' ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo $link ?>" class="open-lbry-link">Open in LBRY</a>
|
||||
<a href="<?php echo $claim->getLbryLink() ?>" class="open-lbry-link">Open in LBRY</a>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
@@ -165,14 +157,6 @@ if (strlen(trim($desc)) == 0) {
|
||||
}
|
||||
|
||||
$autoThumbText = '';
|
||||
$link = $claim->Name;
|
||||
$rawLink = $claim->Name;
|
||||
if (isset($claim->Publisher->Name)) {
|
||||
$link = urlencode($claim->Publisher->Name) . '/' . $link;
|
||||
$rawLink = $claim->Publisher->Name . '/' . $rawLink;
|
||||
}
|
||||
$link = 'lbry://' . $link;
|
||||
$rawLink = 'lbry://' . $rawLink;
|
||||
$cost = '';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
@@ -216,7 +200,7 @@ if (strlen(trim($desc)) == 0) {
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo $claim->ThumbnailUrl ?>" alt="" />
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
@@ -224,7 +208,7 @@ if (strlen(trim($desc)) == 0) {
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $rawLink ?>"><a href="<?php echo $link ?>" rel="nofollow"><?php echo $rawLink ?></a></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
|
||||
|
||||
@@ -291,14 +275,6 @@ if (strlen(trim($desc)) == 0) {
|
||||
$row++;
|
||||
}
|
||||
$autoThumbText = '';
|
||||
$link = $claim->Name;
|
||||
$rawLink = $claim->Name;
|
||||
if (isset($claim->Publisher->Name)) {
|
||||
$link = urlencode($claim->Publisher->Name) . '/' . $link;
|
||||
$rawLink = $claim->Publisher->Name . '/' . $rawLink;
|
||||
}
|
||||
$link = 'lbry://' . $link;
|
||||
$rawLink = 'lbry://' . $rawLink;
|
||||
$cost = '';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
@@ -342,7 +318,7 @@ if (strlen(trim($desc)) == 0) {
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo $claim->ThumbnailUrl ?>" alt="" />
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
@@ -350,7 +326,7 @@ if (strlen(trim($desc)) == 0) {
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $rawLink ?>"><a href="<?php echo $link ?>" rel="nofollow"><?php echo $rawLink ?></a></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
|
||||
|
||||
@@ -392,4 +368,4 @@ if (strlen(trim($desc)) == 0) {
|
||||
|
||||
<?php echo $this->element('pagination') ?>
|
||||
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
@@ -113,10 +113,16 @@
|
||||
<div class="home-container">
|
||||
<div class="home-container-cell">
|
||||
<div class="main">
|
||||
<div class="title">LBRY Block Explorer</div>
|
||||
<div class="title">LBRY Block Explorer</div><br>
|
||||
<form method="get" action="/find">
|
||||
<input class="search-input" name="q" type="text" placeholder="Enter a block height or hash, claim id or name, transaction hash or address" />
|
||||
<div class="ctls"><button class="btn btn-search">Search</button> <div class="links"><a href="/realtime">Realtime</a> • <a href="/stats" class="last">Stats</a></div></div>
|
||||
<div class="ctls">
|
||||
<div class="left-links"><a href="https://lbry.io/get">Download the LBRY App</a></div>
|
||||
<button class="btn btn-search">Search</button>
|
||||
<div class="right-links">
|
||||
<a href="/realtime">Realtime</a> • <a href="/stats" class="last">Stats</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -220,7 +226,7 @@
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo $claim->ThumbnailUrl ?>" alt="" />
|
||||
<img src="<?php echo strip_tags($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
@@ -244,4 +250,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -136,6 +136,7 @@
|
||||
foreach ($outputs as $out): ?>
|
||||
<div id="output-<?php echo $out->Vout ?>" class="output <?php if (isset($out['OutputAddresses']) && count($out['OutputAddresses']) > 0 && $out['OutputAddresses'][0]->Address == $sourceAddress): ?>is-source<?php endif; ?>">
|
||||
<div class="labels">
|
||||
<?php if($out->IsClaim or $out->IsSupportClaim or $out->IsUpdateClaim): ?><a class="view-claim" href="<?php echo $out->Claim->getExplorerLink() ?>">View</a><?php endif; ?>
|
||||
<?php if($out->IsSupportClaim): ?><div class="support">SUPPORT</div><?php endif; ?>
|
||||
<?php if($out->IsUpdateClaim): ?><div class="update">UPDATE</div><?php endif; ?>
|
||||
<?php if($out->IsClaim): ?><div class="claim">CLAIM</div><?php endif; ?>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
*
|
||||
!*/
|
||||
!.git*
|
||||
|
||||
+15
-12
@@ -6,14 +6,14 @@
|
||||
a:link, a:visited { color: #1e88e5; text-decoration: none }
|
||||
a:hover { text-decoration: underline; color: #1976d2 }
|
||||
|
||||
.header { width: 1200px; margin: 0 auto 24px auto; padding: 12px 0 64px 0; border-bottom: 1px solid #ddd }
|
||||
.header { width: 1200px; margin: 0 auto 24px auto; padding: 12px 0 50px 0; border-bottom: 1px solid #ddd }
|
||||
.header a:link, .header a:visited { color: #333; text-decoration: none }
|
||||
.header .title { font-family: 'adelle-sans', sans-serif; font-weight: bold; font-size: 140%; float: left; position: relative; top: 4px }
|
||||
.header .search { float: right }
|
||||
.header .search .input-group { border: 2px solid #1e88e5; position: relative; width: 525px; height: 36px; border-radius: 8px }
|
||||
.header .search .input-group input { border: none; border-radius: 8px; padding: 8px 133px 8px 8px; width: 100%; height: 32px; width: 521px }
|
||||
.header .search .input-group .btn-inline-search { border: none; cursor: pointer; position: absolute; right: -4px; top: 0; height: 100%; background: #1e88e5; color: #fff; width: 125px;
|
||||
border-radius: 0 6px 8px 0 }
|
||||
border-radius: 0 8px 8px 0 }
|
||||
.header .search .input-group .btn-inline-search:hover { background: #1976d2 }
|
||||
|
||||
.home-container-cell > .main > .title { font-family: 'adelle-sans', sans-serif; font-weight: bold; font-size: 280%; margin: 24px auto 24px auto; width: 600px; text-align: center; color: #333; cursor: default }
|
||||
@@ -21,7 +21,8 @@ border-radius: 0 6px 8px 0 }
|
||||
.home-container-cell .ctls { width: 720px; text-align: center; margin: 24px auto; position: relative }
|
||||
.home-container-cell .ctls .btn-search { font-size: 115%; display: inline-block; padding: 12px 48px; background: #1e88e5; color: #fff; border-radius: 8px; border: none; font-weight: 300; cursor: pointer }
|
||||
.home-container-cell .ctls .btn-search:hover { background: #1976d2 }
|
||||
.home-container-cell .ctls .links { display: inline-block; font-weight: 300; position: absolute; right: 0; padding-top: 12px; }
|
||||
.home-container-cell .ctls .left-links { display: inline-block; font-weight: 300; position: absolute; left: 0; padding-top: 12px; }
|
||||
.home-container-cell .ctls .right-links { display: inline-block; font-weight: 300; position: absolute; right: 0; padding-top: 12px; }
|
||||
.home-container-cell .ctls a { font-size: 115%; display: inline-block; margin-right: 12px }
|
||||
.home-container-cell .ctls a.last { margin-left: 12px; margin-right: 0 }
|
||||
.home-container-cell .ctls a:hover { text-decoration: none; color: #1976d2 }
|
||||
@@ -59,7 +60,7 @@ border-radius: 0 6px 8px 0 }
|
||||
.claims-head h2 { font-weight: 300; margin-bottom: 0; font-size: 220% }
|
||||
.claims-head { width: 1200px; margin: 0 auto 24px auto; cursor: default }
|
||||
.claims-head h3, h4 { font-weight: 300; margin: 0 }
|
||||
.claims-head h3 { font-size: 200%; margin-bottom: 3px }
|
||||
.claims-head h3 { font-size: 170%; margin-bottom: 3px }
|
||||
.claims-head h4 { font-size: 125% }
|
||||
|
||||
.claims-grid { width: 1200px; margin: 0 auto 0 auto; cursor: default }
|
||||
@@ -92,11 +93,11 @@ border-radius: 0 6px 8px 0 }
|
||||
.claims-grid .claim-grid-item .spacer { height: 16px }
|
||||
|
||||
.claims-body { width: 1200px; margin: 0 auto 0 auto; cursor: default }
|
||||
.claims-body .claim-info { width: 400px; float: left; box-shadow: 0 2px 4px rgba(0,0,0,.175); border: 1px solid rgba(0,0,0,.15); cursor: default }
|
||||
.claims-body .claim-info { width: 400px; float: left; /*box-shadow: 0 2px 4px rgba(0,0,0,.175);*/ border: 1px solid rgba(0,0,0,.15); cursor: default }
|
||||
.claims-body .claim-info .thumbnail { width: 100%; height: 220px; background: #f0f0f0; display: block; position: relative; overflow: hidden }
|
||||
.claims-body .claim-info .thumbnail img { width: 100% }
|
||||
.claims-body .claim-info .content { padding: 24px }
|
||||
.claims-body .claim-info .content .label { font-size: 90%; color: #1e88e5 }
|
||||
.claims-body .claim-info .content .label { font-size: inherit; text-decoration: underline; color: #666666 }
|
||||
.claims-body .claim-info .content .value { font-weight: 300; margin-bottom: 24px; word-break: break-word; word-wrap: break-word }
|
||||
.claims-body .claim-info .content .value:last-child { margin-bottom: 0 }
|
||||
.claims-body .claim-info .content .half-width { width: 50%; float: left }
|
||||
@@ -108,12 +109,12 @@ border-radius: 0 6px 8px 0 }
|
||||
.claims-body .claim-info .thumbnail.yellow { background: #fdd835 }
|
||||
.claims-body .claim-info .thumbnail .autothumb { display: block; margin: 93px auto 0 auto; text-align: center; font-size: 240%; color: #fff; line-height: 54px }
|
||||
|
||||
.claims-body .claim-metadata { width: 750px; margin-left: 50px; float: left; box-shadow: 0 2px 4px rgba(0,0,0,.175); border: 1px solid rgba(0,0,0,.15); padding: 24px 36px 88px 36px; cursor: default; position: relative }
|
||||
.claims-body .claim-metadata .title { font-weight: 300; font-size: 170%; margin-bottom: 16px; color: #1e88e5; padding: 0 8px }
|
||||
.claims-body .claim-metadata .desc { font-weight: 300; font-size: 130%; line-height: 36px; padding: 0 12px; word-break: break-word; word-wrap: break-word }
|
||||
.claims-body .claim-metadata { width: 770px; margin-left: 30px; float: left; /*box-shadow: 0 2px 4px rgba(0,0,0,.175);*/ border: 1px solid rgba(0,0,0,.15); padding: 24px 36px 88px 36px; cursor: default; position: relative }
|
||||
.claims-body .claim-metadata .title { font-weight: bold; font-size: 120%; margin-bottom: 16px; color: #666666; padding: 0 8px }
|
||||
.claims-body .claim-metadata .desc { font-weight: 300; font-size: inherit; line-height: 1.8em; padding: 0 12px; word-break: break-word; word-wrap: break-word }
|
||||
.claims-body .claim-metadata .details { margin-top: 36px; border-top: 1px solid #ddd; padding: 36px 16px 0 16px }
|
||||
.claims-body .claim-metadata .details .label { font-size: 90%; color: #1e88e5 }
|
||||
.claims-body .claim-metadata .details .value { font-size: 110%; font-weight: 300; margin-bottom: 24px }
|
||||
.claims-body .claim-metadata .details .label { font-size: inherit; color: #666666; text-decoration: underline }
|
||||
.claims-body .claim-metadata .details .value { font-size: inherit; font-weight: 300; margin-bottom: 24px }
|
||||
.claims-body .claim-metadata .details .half-width { width: 50%; padding-right: 36px; float: left; height: 25px; line-height: 25px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
|
||||
.claims-body .claim-metadata .open-lbry-link { position: absolute; right: 36px; bottom: 36px; padding: 10px 24px; color: #fff; font-weight: 300; font-size: 90%; background: #1e88e5 }
|
||||
.claims-body .claim-metadata .open-lbry-link:hover { text-decoration: none; background: #1976d2 }
|
||||
@@ -251,6 +252,7 @@ footer .content .page-time { position: absolute; right: 12px; bottom: 0px; paddi
|
||||
.tx-details-layout .outputs .output .labels .support { background: #ffeb3b }
|
||||
.tx-details-layout .outputs .output .labels .update { background: #ea80fc }
|
||||
.tx-details-layout .outputs .output .labels .claim { background: #76ff03 }
|
||||
.tx-details-layout .outputs .output .view-claim { font-size: 80%; }
|
||||
.tx-details-layout .inputs .input .value, .tx-details-layout .outputs .output .value { font-weight: normal }
|
||||
.tx-details-layout .inputs .input.is-source, .tx-details-layout .outputs .output.is-source { border-right-width: 18px; border-right-color: #1e88e5; background: #e3f2fd }
|
||||
.tx-details-layout .inputs .input.highlighted, .tx-details-layout .outputs .output.highlighted { background: #f1f8e9 }
|
||||
@@ -294,6 +296,7 @@ footer .content .page-time { position: absolute; right: 12px; bottom: 0px; paddi
|
||||
.tx-table td { vertical-align: top; line-height: 24px }
|
||||
.tx-table td.credit, .tx-table td div.credit { color: #00e676 }
|
||||
.tx-table td.debit, .tx-table td div.debit { color: #ff0000 }
|
||||
.tx-table td.diff, .tx-table td div.diff{ color: #337ab7 }
|
||||
.tx-table td div.debit { padding-top: 8px }
|
||||
|
||||
.pagination { width: 1200px; margin: 36px auto 0 auto; cursor: default }
|
||||
@@ -307,4 +310,4 @@ footer .content .page-time { position: absolute; right: 12px; bottom: 0px; paddi
|
||||
@keyframes indeterminate {
|
||||
from { left: -25%; }
|
||||
to { left: 100% }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user