- POST /v1/names/register endpoint with wallet RPC integration - WalletRpc service for alias registration via daemon wallet - Blade views for homepage, explorer, names directory, network status - Explorer and Names modules with view namespaces and web controllers - Pool endpoint graceful offline handling - Explorer block detail, aliases, search views Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Website\Lethean\Controllers;
|
|
|
|
use Illuminate\Routing\Controller;
|
|
use Mod\Chain\Services\DaemonRpc;
|
|
|
|
/**
|
|
* lthn.io homepage.
|
|
*
|
|
* GET / — TLD landing with live chain stats
|
|
*/
|
|
class HomeController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly DaemonRpc $rpc,
|
|
) {}
|
|
|
|
public function index(): \Illuminate\View\View
|
|
{
|
|
$info = $this->rpc->getInfo();
|
|
$aliases = $this->rpc->getAllAliases();
|
|
|
|
return view('lethean::home', [
|
|
'height' => number_format($info['height'] ?? 0),
|
|
'aliases' => count($aliases['aliases'] ?? []),
|
|
'transactions' => number_format($info['tx_count'] ?? 0),
|
|
'difficulty' => [
|
|
'pow' => number_format($info['pow_difficulty'] ?? 0),
|
|
'pos' => $info['pos_difficulty'] ?? '0',
|
|
],
|
|
]);
|
|
}
|
|
|
|
public function about(): \Illuminate\View\View
|
|
{
|
|
return view('lethean::about');
|
|
}
|
|
|
|
public function network(): \Illuminate\View\View
|
|
{
|
|
$info = $this->rpc->getInfo();
|
|
|
|
return view('lethean::network', [
|
|
'info' => $info,
|
|
]);
|
|
}
|
|
|
|
}
|