简体   繁体   English

如何在Blockcypher Api中为以太坊创建钱包和地址

[英]How to create wallet and address for Ethereum in Blockcypher Api

I am using blockcypher Library and creating Api for Ethereum wallet and address but when i am passing ETH.main in 我正在使用blockcypher库并为以太坊钱包和地址创建Api,但是当我通过ETH.main

 $addressClient = new \BlockCypher\Client\AddressClient($apiContexts['ETH.main']);

than it's giving undefined index error. 比给出未定义的索引错误。

Unable to identify what is the issue and how can i create address and wallet through blockcypher Api. 无法确定问题出在哪里,以及如何通过加密货币Api创建地址和钱包。

好像您没有加载整个BlockCypher库,您需要加载bootstrap.php或查看https://github.com/blockcypher/php-client/wiki/Making-First-Call中的一些入门说明。

I had the same issue. 我遇到过同样的问题。 I think the current library version for the toolkit needs to be adjusted to include ETH. 我认为该工具箱的当前库版本需要进行调整以包含ETH。

Open the file BlockCypherCoinSymbolConstants.php in the directory: 打开目录中的文件BlockCypherCoinSymbolConstants.php:

php-client/blockcypher/php-client/lib/BlockCypher/Core/BlockCypherCoinSymbolConstants.php php-client / blockcypher / php-client / lib / BlockCypher / Core / BlockCypherCoinSymbolConstants.php

You can add ETH in the array that starts on Line 19, $COIN_SYMBOL_ODICT_LIST. 您可以在以行19开始的数组$ COIN_SYMBOL_ODICT_LIST中添加ETH。 The code I used is below. 我使用的代码如下。 It works, but I'm not 100% sure of the correct values for 'pow', and 'address_first_char_list' 它可以工作,但是我不确定100%正确的'pow'和'address_first_char_list'值

array(
        'coin_symbol' => 'eth',
        'display_name' => 'Ethereum',
        'display_shortname' => 'ETH',
        'blockcypher_code' => 'eth',
        'blockcypher_network' => 'main',
        'currency_abbrev' => 'eth',
        'pow' => 'sha',
        'example_address' => 'CFr99841LyMkyX5ZTGepY58rjXJhyNGXHf',
        "address_first_char_list" => array('B', 'C', 'D')
    )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM