等待内存池中的交易

Awaiting transaction in the mempool

我正在尝试学习 Brownie 上的 Curve 教程。成功安装 Ganache 和 Brownie 后,我尝试通过在命令行中键入 brownie bake token(在项目文件夹中)来使用 https://github.com/brownie-mix 中的令牌模板。在我的目录中重新创建了令牌项目的结构。输入 brownie console 后,我得到 brownie environment is ready 的回复。然后我尝试使用 Token.deploy("Test Token", "TST", 18, 1e21, {'from': accounts[0]}) 部署代币合约,这个命令的结果是消息“Awaiting transaction in the mempool”——这条消息已经挂了 30 多分钟我想知道我应该如何调试它?什么会导致令牌没有正确部署的情况?

也许我可以帮助你。 我们走吧。 你的问题是 gas_price,在最近的 eth 版本中,gas 总是必需的。

我用这种方式解决了我的问题...

from brownie import accounts, config, SimpleStorage
from brownie.network import gas_price
from brownie.network.gas.strategies import LinearScalingStrategy

gas_strategy = LinearScalingStrategy("60 gwei", "70 gwei", 1.1)

gas_price(gas_strategy)

def deploy_simple_storage():
    account = accounts[0]
    simple_storage = SimpleStorage.deploy({
        "from": account,
        "gas_price": gas_strategy
        })

    # Transact
    # Call
    print(simple_storage)


def main():
    deploy_simple_storage()

我不知道是否需要所有这些来解决您的问题,但我需要。尝试导入 gas_price 并在 "from": account.

之后调用它

如果有人有更好的解决方案,请告诉我。

字体: https://eth-brownie.readthedocs.io/en/stable/config.html https://github.com/batprem/pynft