问题标签 [geth]

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.

0 投票
1 回答
439 浏览

ethereum - Geth + 智能合约功能 = 错误指令

玩以太坊智能合约我遇到了以下问题。合约部署在 Ropsten 上,然后我尝试在 geth 上使用以下代码调用函数“addRecipe”:

该函数如下所示:

我得到了 TX 哈希,但在 Etherscan 中查找交易给出了

你可以在这里查看: https ://ropsten.etherscan.io/tx/0xe5999c2d122e4871e82f5986397dfd39107cee2056a9280132abeaa460c0f66d

向函数添加 'payable' 修饰符或使用以下命令不会产生更好的结果...

整个合同:

0 投票
1 回答
601 浏览

blockchain - 如何在没有 WebAPI 的情况下快速搜索以太坊中的交易历史?

我想在没有像 Etherscan.io 这样的 WebAPI 的情况下快速搜索以太坊中的交易历史。但是我不能。

请告诉我,如何快速搜索 etherscan.io、etherchain.org 和 gastracker.io。

需要的功能

  1. 搜索

    • 对于搜索 100 结果需要 5 秒以下。
  2. 以下5个客户端同时使用搜索。

    • Etherscan.io对 WebAPI 有限制。
  3. 快速同步

    • 像 Etherscan.io 这样的以太坊网络之间的延迟更少。
  4. 没有 etherscan.io、etherchain.org 和 gastracker.io,其他相同的服务。

尝试过的任务

使用 Geth + Web3.js + Node.js + MySQL

这不好。因为,一个 SELECT SQL 有很多时间运行。我自己试着做一个系统。我的交易历史搜索功能有 10 秒,从 5,902,085 块搜索到 4,900,637。(限制 100 个结果。)并且需要很多同步时间,因为应该将交易历史从 Geth 复制到 MySQL(通过 web3.js)。因此,这是不好的。

仅使用 Parity.js

奇偶校验有transaction_filterAPI。但还不够。因为,trace_filter用于从第一个块到 3,000,000 个块的搜索/过滤,需要 10 多分钟才能完成。这不是QUICK

我知道,这个结果取决于服务器规范和奇偶校验启动命令。我使用的服务器具有以下规格:AWS EC2 T2.Medium,使用的命令:docker run -d -p 8545:8545 -p 8080:8080 -p 8180:8180 -v $HOME/eth_parity_data:/root/.local/share/io.parity.ethereum --name eth_parity_node parity/parity:stable --fat-db on --tracing on --rpcaddr=0.0.0.0用于在 Ubuntu 上启动 Parity。这个服务器规格和命令不好吗?

谢谢你。

0 投票
2 回答
2179 浏览

ethereum - Add Peers 不会在 Geth 控制台中添加对等点

我正在尝试添加一个同行。我在 geth 上使用以下命令创建了两个节点。启动节点创建命令是

其他节点创建命令

当我键入命令 admin.peers 它返回一个空列表。有人可以帮我吗?

0 投票
1 回答
5864 浏览

blockchain - 所需的气体超过限额或在 Geth 私有区块链上总是失败交易,但在其他区块链上工作正常

我使用geth. 我还有一个合同,其中有一个函数调用另一个函数,它是第三个合同来设置地址。我可以在本地区块链上调用这个函数,比如 testRPC 和 Ganache 区块链,即使它在 TestNet 中也能工作。但是一旦我使用()设置了私有区块链geth。我收到此错误:

气体估计错误并显示以下消息(见下文)。事务执行可能会失败。是否要强制发送?

所需气体超过限额或交易总是失败

我在来电者帐户中有足够的 ETH,并且

  • 我在来电者帐户中有足够的 ETH,并且
  • GasLimit 足够高
  • 这些函数没有任何循环或花哨的操作,设置地址和一些条件检查
  • 节点是 Ubuntu 16.04
  • geth -v --> 1.8.12-stable
0 投票
1 回答
357 浏览

ubuntu - 在 Ubuntu 18.04 上使用 apt-get 安装早期版本的以太坊

ethereum使用 Ubuntu 18.04 时如何安装早期版本的软件包?

当前安装的版本是1.8.12,我喜欢1.8.8。

0 投票
2 回答
2097 浏览

blockchain - 以太坊 geth 无法连接到 bootnode 以访问私有以太坊网络

以下docker-compose.yml用于启动以太坊geth节点,该节点需要连接到引导节点才能访问私有以太坊网络。

但是运行后docker-compose up,我们看到回显的链配置是默认配置,而不是引导节点正在使用的配置

初始化链配置 config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: Engine: ethash}"

问题:为什么geth不连接到引导节点并且不使用引导节点中的配置genesis.json

码头工人撰写输出:

创世纪.json

0 投票
1 回答
1415 浏览

node.js - Web3.js sendSignedTransaction 给出“错误:无法检查交易收据”

我正在使用 web3js v1.0.0-beta.34在循环中将签名交易发送到 geth 节点Geth/v1.8.13-unstable-2e0391ea/linux-amd64/go1.10.3

问题:在循环的初始迭代中,Node.js 将事务哈希打印到控制台。但是当循环运行了几秒钟以上时,我们开始得到错误:

这个问题的原因可能是什么?

测试.js

0 投票
1 回答
869 浏览

ethereum - geth --targetgaslimit 不起作用?

我的合约创建需要5633321 gas - 超过默认的块 gas 限制。几次前我能够在Ropsten网络上部署它: https ://ropsten.etherscan.io/tx/0xe90e8920018f8b633620c731c68b63f3ce11dc19f59ddb49401c9e2c9cd1f8c2 。

现在我想部署修改后的版本(可能是更新的)geth 版本,从 Remix 连接到 geth 作为 web3 提供程序。

在没有挖掘参数的情况下运行时geth -testnet,Remix IDE 报告:

创建 ... 合约错误:超过区块气体限制

我试图通过以下方式对自己进行交易:

$geth -rpc --nousb --ipcdisable --rpcaddr "127.0.0.1" --rpccorsdomain "*" --syncmode "fast" --rpcapi="db,personal,eth,net,web3,admin" --cache =2048 --testnet --targetgaslimit "5800000" --gasprice "0" --mine --verbosity 4

而且我仍然遇到相同的 Remix IDE 错误。同时在geth日志中我可以看到:

DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=1.128698ms DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=585.129µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=585.857µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=586.8µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=572.322µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=556.395µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=586.05µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=591.607µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=593.849µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=558.404µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=559.293µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=725.188µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=698.486µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=593.769µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=705.957µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=886.8µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=993.159µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=612.746µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=594.387µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=551.487µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=643.653µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=583.393µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=588.098µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=573.148µs DEBUG[07-20|12:32:55] Recalculated downloader QoS values rtt=18.543326462s confidence=0.984 ttl=56.512994931s DEBUG[07-20|12:32:57] Revalidated node b=7 id=38e1eb00a922f0b7 DEBUG[07-20|12:32:59] Transaction pool status report executable=114 queued=0 stales=16 DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=1.029656ms DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=882.256µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=567.244µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=665.415µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=499.283µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=840.601µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=449.378µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=404.487µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=885.109µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=648.022µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=731.928µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=649.778µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=485.086µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=472.941µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=724.858µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=547.733µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=1.340049ms DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=892.869µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=709.442µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=424.299µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=419.544µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=381.663µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=702.104µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=444.091µs

BTW Remix IDE 估计 gas 需求错误: { "Creation": { "codeDepositCost": "4072000", "executionCost": "65552", "totalCost": "4137552" }, 我尝试使用此值部署它并失败: https ://ropsten.etherscan.io/tx/0x092199ab2a8b535aaed5a954ae549ff8dcb78f4985774f6ad2ea6c1143a7c501 。

我应该怎么做才能在 Ropsten 网络上部署我的合约,该网络需要的不仅仅是默认区块气体?

PS。geth1.8.10与 同步--fast,帐户已解锁,帐户有足够的以太币。

聚苯乙烯。据我了解,区块气体限制是矿工之间商定的,不能为单个个人矿工实例设置。所以我想做的就是行不通。但是,我的第一个合约部署交易被挖掘的区块有将近 9.000.000 的气体限制是怎么发生的呢?https://ropsten.etherscan.io/block/3426903

0 投票
1 回答
1049 浏览

docker - Windows 上的 Docker:启动协议栈时出错:监听 unix /root/.ethereum/geth.ipc:绑定:不允许操作

在 Windows 10 系统上,我正在尝试运行一个正在运行的 Docker 容器,geth它侦听端口 8545。这docker-compose.yml已经过测试,可以在 Ubuntu 和 Mac OS X 上完美运行。

docker-compose 版本 1.21.1,构建 7641a569正在 Windows 10 系统上使用。

问题: Docker 执行后抛出错误docker-compose up

致命:启动协议栈时出错:监听 unix /root/.ethereum/geth.ipc:绑定:不允许操作

什么可能导致此错误,我们如何解决它?

码头工人-compose.yml

运行后输出docker-compose up

0 投票
1 回答
704 浏览

python - 以太坊 geth 使用 python 检查交易

我的问题是......我想运行一个像 geth 这样的全节点来将我的不同 eth 地址与 python 的交易保存到数据库中。但我不知道该怎么做。是否有任何特殊的库或 geth 是否有 Json 接口?谢谢你的想法

PS:我知道我也可以使用 ethscan.io,但我不想使用这样的服务。