|
|
@ -19,12 +19,10 @@ my $acname = $ENV{SIONA_ACNAME} || 'DRAGONWX'; |
|
|
|
my $ticker = $acname eq 'HUSH3' ? 'HUSH' : $acname; |
|
|
|
my $domain = $ENV{SIONA_DOMAIN} || 'explorer.dragonx.is'; |
|
|
|
my $root = "/var/www/$domain"; |
|
|
|
my $basedir = "/var/www/$domain/var/www/$domain"; |
|
|
|
my $dir = shift || "$basedir/api"; |
|
|
|
my $cli = $ENV{SIONA_CLI} || "/git/hush3/src/hush-cli"; |
|
|
|
my $getinfo = readfile("$dir/getinfo.json"); |
|
|
|
my $mining = readfile("$dir/getmininginfo.json"); |
|
|
|
my $blocksdir = "$basedir/blocks"; |
|
|
|
my $getinfo = readfile("$root/api/getinfo.json"); |
|
|
|
my $mining = readfile("$root/api/getmininginfo.json"); |
|
|
|
my $blocksdir = "$root/blocks"; |
|
|
|
my $template = readfile("$blocksdir/template.html"); |
|
|
|
if($getinfo =~ m/"blocks": (\d+)/){ $STATS->{BLOCKS} ||= $1; } |
|
|
|
if($getinfo =~ m/"tls_connections": (\d+)/){ $STATS->{TLS_CONNECTIONS} ||= $1; } |
|
|
@ -58,7 +56,7 @@ for my $h ($height-80 .. $height) { |
|
|
|
chomp $hash; |
|
|
|
|
|
|
|
my $blockdir = "$root/block/$hash"; |
|
|
|
if (!-e "$basedir/block/$h") { |
|
|
|
if (!-e "$root/block/$h") { |
|
|
|
# make /block/HEIGHT work |
|
|
|
my $cmd = "ln -s $blockdir $root/block/$h"; |
|
|
|
qx{$cmd}; |
|
|
@ -69,7 +67,7 @@ for my $h ($height-80 .. $height) { |
|
|
|
my $cmd = "mkdir -p $blockdir"; |
|
|
|
qx{$cmd}; |
|
|
|
warn $cmd; |
|
|
|
my $block_template_file = "$basedir/block/template.html"; |
|
|
|
my $block_template_file = "$root/block/template.html"; |
|
|
|
my $new_block_file = "$blockdir/index.html"; |
|
|
|
# TODO: process template with block details |
|
|
|
my $block_template = readfile($block_template_file); |
|
|
|