chain:stop sends SIGTERM and waits for graceful shutdown. DNS updateRecords now logs 'dns_updated' activity with ticket_id and records. Claim approve/reject also logged in previous commit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Mod\Chain;
|
|
|
|
use Core\Events\ConsoleBooting;
|
|
use Core\Events\FrameworkBooted;
|
|
use Mod\Chain\Contracts\ChainDaemon;
|
|
use Mod\Chain\Contracts\ChainWallet;
|
|
use Mod\Chain\Services\DaemonRpc;
|
|
use Mod\Chain\Services\WalletRpc;
|
|
|
|
class Boot
|
|
{
|
|
public static array $listens = [
|
|
FrameworkBooted::class => 'onFrameworkBooted',
|
|
ConsoleBooting::class => 'onConsole',
|
|
];
|
|
|
|
public function onFrameworkBooted(FrameworkBooted $event): void
|
|
{
|
|
app('config')->set('chain', require __DIR__ . '/config.php');
|
|
|
|
// Bind interfaces to implementations — swap for testing/Go wrapper
|
|
app()->singleton(ChainDaemon::class, DaemonRpc::class);
|
|
app()->singleton(ChainWallet::class, WalletRpc::class);
|
|
|
|
// Keep concrete bindings for backwards compatibility
|
|
app()->singleton(DaemonRpc::class);
|
|
app()->singleton(WalletRpc::class);
|
|
|
|
app('router')->aliasMiddleware('auth.api', \App\Http\Middleware\ApiTokenAuth::class);
|
|
app('router')->aliasMiddleware('domain', \App\Http\Middleware\DomainScope::class);
|
|
}
|
|
|
|
public function onConsole(ConsoleBooting $event): void
|
|
{
|
|
$event->command(Commands\ChainStart::class);
|
|
$event->command(Commands\ChainStop::class);
|
|
$event->command(Commands\ChainStatus::class);
|
|
}
|
|
}
|