This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
TypeError: miner.startMining is not a function #2877
Comments
Thanks for opening this issue! Which version of Web3 are you using? and could you provide the whole script? |
the same question: script: const Web3 = require("web3");
const net = require('net');
const {Miner} = require("web3-eth-miner")
const web3 = new Web3(new Web3.providers.IpcProvider('/home/qiubing/桌面/chain_creator_nodejs/sulenn5/data/geth.ipc', net));
// 连接 miner 服务
const miner = new Miner(new Web3.providers.IpcProvider('/home/qiubing/桌面/chain_creator_nodejs/sulenn5/data/geth.ipc', net))
web3.eth.getAccounts()
.then(console.log("success"))
.catch(err=>{
console.log("err!")
process.exit()
})
miner.startMining("1").then(console.log) result: thank you! |
I was using I tried upgrading to the version
|
I also got same error.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
import {Miner} from "web3-eth-miner";
It still throws an error TypeError: miner.startMining is not a function
The text was updated successfully, but these errors were encountered: