簡體   English   中英

為區塊鏈錢包生成新地址

[英]generate new address for blockchain wallet

我正在使用區塊鏈API為每個錢包生成一個新地址。
這是代碼:

<?php
$guid = "7c74bb77-4e25-4eea-a9d3-df1cf6a9d218";
$main_password = "******";
$label = "firsttym";
$json_url = "http://localhost:3000/merchant/$guid/new_address?
password = $main_password & label = $label";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data ,true);

$message = $json_feed->message;
$txid = $json_feed->tx_hash;
?>

它總是返回以下警告:

警告:file_get_contents(localhost:3000 / merchant / 7c74bb77-4e25-4eea‌-a9d3-df1cf6a9d218 /…‌)[function.file-get-contents]:無法打開流:
連接嘗試失敗是因為連接的一方在一段時間后未正確響應,或者建立的連接失敗是因為連接的主機未能響應。

在第8行的C:\\ wamp \\ www \\ block \\ first.php中

致命錯誤:第8行的C:\\ wamp \\ www \\ block \\ first.php中超過30秒的最大執行時間

您可能想要這樣嘗試:我一直在使用它來獲取新地址

發出請求之前,別忘了啟動區塊鏈服務

區塊鏈錢包服務啟動-端口3000

$url = "http://localhost:3000/merchant/$guid/new_address?password=$password&label=$label";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);



   $data = json_decode(curl_exec($ch), TRUE);

   return $data;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM