Ejemplo n.º 1
0
 public function __construct()
 {
     $this->config = \json_decode(\file_get_contents(CONFIGDIR . '/notary_server.json'), true);
     $this->db = \ParagonIE\AsgardClient\Utilities::getStorageAdapter('notary', \file_get_contents(CONFIGDIR . '/config.json'), true);
 }
Ejemplo n.º 2
0
 */
if (\is_readable(__DIR__ . "/data/config.json")) {
    // Allow people to edit the JSON config and define their own locations
    $config = \json_decode(\file_get_contents(__DIR__ . "/data/config.json"), true);
} else {
    // Sane defaults
    $config = ['storage' => ['blockchain' => ['driver' => 'sqlite', 'path' => 'blockchain.etilqs'], 'settings' => ['driver' => 'sqlite', 'path' => 'asgard.etilqs']]];
}
if (!\class_exists('Sodium')) {
    // Don't disable this. Our BLAKE2b source is Sodium::crypto_generichash()
    die("Please install libsodium and the libsodium-php extension from PECL\n\n" . "\thttp://doc.libsodium.org/installation/README.html\n" . "\thttp://pecl.php.net/package/libsodium\n");
}
// Let's load our storage adapters
$store = \ParagonIE\AsgardClient\Utilities::getStorageAdapter('settings', $config);
$bchain = \ParagonIE\AsgardClient\Utilities::getStorageAdapter('blockchain', $config);
$notary = \ParagonIE\AsgardClient\Utilities::getStorageAdapter('notary', $config);
/**
 * 3. Process the CLI parameters
 */
$showAll = true;
if ($argc < 2) {
    // Default behavior: Display the help menu
    $argv[1] = 'help';
    $showAll = false;
    $argc = 2;
}
// Create a little cache for the Help command, if applicable. Doesn't contain objects.
$commands = [];
foreach (\glob(__DIR__ . '/Client/Commands/*.php') as $file) {
    // Let's build a queue of all the file names
    // Grab the filename from the Commands directory: