$method, 'params' => $params, 'id' => '1' )); // Prepare and performs the HTTP POST $opts = array ('http' => array ( 'method' => 'POST', 'header' => 'Content-type: application/json', 'content' => $request )); $fp = fopen($emcCONNECT, 'rb', false, stream_context_create($opts)); if(!$fp) throw new Exception('emcssl_NVS_req: Unable to connect to EMC-wallet'); $rc = json_decode(stream_get_contents($fp), true); $er = $rc['error']; if(!is_null($er)) throw new Exception('emcssl_NVS_req: Response error: ' . $er); return $rc['result']; } // emc_NVS_req //------------------------------------------------------------------------------ // Create initial Anchor name $rc = emc_NVS_req('name_new', array($anchor, 'Demo anchor', 100)); echo "Created Anchor $anchor with transaction=$rc\n"; # Anchoring demo hashes to the Emercoin blockchain every hour foreach ($demo_hashes as $hash) { sleep(3600); $rc = emc_NVS_req('name_update', array($anchor, $hash, 100)); echo "Added anchor hash $hash to $anchor with transaction=$rc\n"; } ?>