首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何生成dev帐户余额

如何生成dev帐户余额
EN

Ethereum用户
提问于 2017-05-28 22:52:18
回答 3查看 780关注 0票数 2

我正在创建加密货币交换,并希望测试我的应用程序,为此,我需要添加开发帐户余额。请帮助我在我的专用网络中生成乙醚作为测试用途。

注意事项

我正在使用geth来运行ethereum节点。

EN

回答 3

Ethereum用户

发布于 2017-05-28 23:36:17

由于您使用的是go-ethereum,所以我建议您尝试使用新的工具来设置名为puppeth的私有ethereum网络。它可以从1.6版中获得。当您回答向导的问题时,有一个问题是Which accounts should be pre-funded?

代码语言:javascript
复制
ubuntu@test1:~$ puppeth
+-----------------------------------------------------------+
| Welcome to puppeth, your Ethereum private network manager |
|                                                           |
| This tool lets you create a new Ethereum network down to  |
| the genesis block, bootnodes, miners and ethstats servers |
| without the hassle that it would normally entail.         |
|                                                           |
| Puppeth uses SSH to dial in to remote servers, and builds |
| its network components out of Docker containers using the |
| docker-compose toolset.                                   |
+-----------------------------------------------------------+

Please specify a network name to administer (no spaces, please)
> foobar
Sweet, you can set this via --network=foobar next time!

INFO [05-28|23:33:58] Administering Ethereum network           name=foobar
WARN [05-28|23:33:58] No previous configurations found         path=/home/ubuntu/.puppeth/foobar

What would you like to do? (default = stats)
 1. Show network stats
 2. Configure new genesis
 3. Track new remote server
 4. Deploy network components
> 2

Which consensus engine to use? (default = clique)
 1. Ethash - proof-of-work
 2. Clique - proof-of-authority
> 2

How many seconds should blocks take? (default = 15)
> 15

Which accounts are allowed to seal? (mandatory at least one)
> 0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98
> 0x

Which accounts should be pre-funded? (advisable at least one)
> 0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98
> 0x
票数 2
EN

Ethereum用户

发布于 2017-06-28 09:56:23

为了测试目的,您应该使用testRPC。在默认情况下,它提供了10个帐户,每个帐户都有一些最初的余额。这样,您就不必解锁帐户或添加余额,而且要快速测试代码也比geth快得多。

使用以下命令安装它-

代码语言:javascript
复制
npm install -g ethereumjs-testrpc
票数 1
EN

Ethereum用户

发布于 2017-06-28 08:58:08

你有三个选择:

1-挖掘:在节点中运行miner.start()来获取一些新的以太,然后在您的余额之间进行拆分

2-用一个成因文件输入您的私人链,该文件定义了您的帐户余额,使用:

"alloc":{“133ded6da4e99fa9e37d75cb9e8cba18aa9a7796”:{ "balance":"100000000000“}

票数 0
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/16779

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档