问题标签 [go-ethereum]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ethereum - 以太坊合约在铸造时不会改变它的状态
有sol合约函数mint():
我成功地调用了这个函数来创建 10000 个令牌并将它们发送到 eth.accounts[0]:
个人.unlockAccount(eth.accounts[0])
真的
minedContract.mint.sendTransaction(eth.accounts[0], 10000, {from:eth.accounts[0]})
“0x6e4474072ebf2836fa6b737a6341504f79b53417e366c742c7ffefa0f3aff832”
但是 eth.accounts[0] 的余额仍然是 0。合约的总余额也是 0。我一直等到它被开采。为什么合同状态没有改变?
ethereum - eth.estimateGas 以合约地址作为第二个参数失败
新手。有一个 go-ethereum 方法:
eth.estimateGas({from:'firstAccount', to:'secondAccount'})
效果很好,但是与合同地址相同的方法,例如:
eth.estimateGas({from:'firstAccount', to:'contractAddr'})
因错误而失败
所需气体超过限额或交易总是失败
我查看了 go-ethereum 源代码,它有一行,其中包含使用合约地址作为第二个参数的建议: https ://github.com/ethereum/go-ethereum/blob/master/accounts/abi/bind/ base.go#L221
问题是:是否有可能使用带有合约地址的 eth.estimateGas 作为第二个参数以及如何避免上述错误?谢谢你。
python - Web3.py transactions are not broadcast on Ethereum Rinkby testnet
I am using the web.py code below to try and send a transaction with 1 ETH on the Rinkeby testnet via a local geth node. I can see the transactions as submitted in live local ethereum node log stream, but they don't ever seem to be broadcast to the network (I can never see them on rinkeby.io block explorer). I am manually setting the nonce each time, but I read that if a previous nonce was used and it didn't broadcast it may be stuck? As a part of the answer it would be great if the nonce purpose/usage can be explained.
php - JSON RPC api 或在特定地址上获取 ETH 交易的步骤
我正在使用 php。我想通过用户的 ETH 地址获取所有存款交易。我正在使用“geth”客户端。我无法获取任何用于获取事务的 json rpc api。根据在互联网上的搜索,我尝试了“eth_newFilter”、“eth_getFilterChanges”、“eth_getFilterLogs”。我为“eth_newFilter”设置了以下参数
作为回应,我得到了 id,并且在“eth_getFilterChanges”、“eth_getFilterLogs”中使用了该 id,但两者都返回空结果。
任何人都可以帮助了解如何获取特定地址的交易列表吗?
ethereum - Web3js 中的 HTTP 基本身份验证
我在远程服务器上运行 geth,并使用 HTTP Basic Auth 进行保护。
我尝试了以下两种方法。两者都不起作用:
根据官方文档:
有没有其他方法可以实现这一点:
ethereum - 以太坊客户端-go RPC 响应 403“指定的主机无效”
我正在运行带有以下标志的ethereum/client-go docker映像:
此映像在机器 A 上运行,我可以查询其中的 RPC。但是当我尝试从机器 BI 查询它时,会收到以下响应:
要求:
回复:
如何从机器 B 查询托管在机器 A 上的以太坊客户端?我在哪里可以找到以太坊客户端日志以便调试它?
ethereum - Ropsten 网络连接与 web3.js(版本 1.0.0-beta.34)
我有一个严重的问题,两天以来我一直在尝试解决,但没有成功。我想使用 web3.js 连接 testnet ropsten,我想我成功了,但问题是我在 ropsten 网络上有一些平衡,但 web3.js 只显示 0。
你可以在这里查看我的地址,它有一些测试 4.999873784 Ether: https ://ropsten.etherscan.io/address/0x0346d2e50E29065b3b3c73B878FaFDcEb8Ee13f0
在这里我将描述我的流程(所有链接和ips都是假的):
首先开始 geth
/li>我在我的网页中包含了 web3.js。
/li>
采取的其他步骤:
这里有什么问题,任何线索都将不胜感激。
ethereum - 余额不会因私网挖矿而增加
我无法使用 private_net 从 geth(v1.8.3) 挖掘。但我不能增加我的账户余额。我想增加我的账户余额。
有没有人可以解决?
我的执行命令如下。
执行此命令后,我确认挖矿开始。
$ geth --datadir ~/private_net --port 7545 --networkid 1111 console 2>>node.log
$ eth.miner()
但余额不会增加。
$ eth.getBalance(eth.accounts[0])
创世纪.json
ethereum - Clique - 私有区块链的权威共识证明
刚开始建立 POA Clique。很难理解一些概念。根据我的理解,密封器是可以在创世文件中设置的交易验证器(创建块的人)。(我的参考https://github.com/ethereum/EIPs/issues/225)
- 签名者是否只是区块的密封者、验证者和创建者?
- “任何签名者只能从每个 K 中铸造 1 个区块”。问题 - 如果我们总共有 3 个节点(所有签名者),一个签名者只能单独密封/验证/创建一个块?例如签名者 A 密封块 1,签名者 B 密封块 2?两个签名者不能密封一个块?
为了确保只有一个多数链 (50% + 1),签名者只有在最后一个 (len(signers)+1) / 2 个块没有签名的情况下才被允许密封一个新块。因此,如果有 3 个签名者,则每个签名者只能在每个第二个区块(来自 - https://github.com/ethereum/go-ethereum/issues/16406)中签名。假设我有签名者 A、B、C,以下是正确的表示吗?
区块 1 - 由 A 封印
区块 2 - 被 B 封印 - 不能被 A 封印,因为它已经封印了前一个
块 3 - 由 C 密封 - 也可以由 A 密封(A 有偏移以避免赛车块)。B不能封,因为他封了前一个