nosuchip / truffle-privatekey-provider Goto Github PK
View Code? Open in Web Editor NEWPrivate Key Web3 provider
Private Key Web3 provider
Hello!
I tried to deploy a contract yesterday on Ropsten but the deployment seemed to be stuck. I tried to increase the gas price a couple of times and I've waited more than 600 seconds but nothing happened. When I switched to a HDWalletProvider, the deployment was immediately successful.
Any idea of what is going on?
I am trying to use privatekey provider with truffle to run migrate.
But cannot, always got error:
Error: ProviderSubprovider - specified provider does not have a sendAsync method
my sample code is here: https://github.com/duongvansang/crowdfundsample
It's very simple code with only one smart contract.
everything was fine till last week and now using this package just throws an error
When I am trying to deploy my contracts to ropsten with truffle using truffle deploy --network ropsten --reset
:
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Error: Error: Web3ProviderEngine does not support synchronous requests.
at Object.run (/home/stillfantasy/.nvm/versions/node/v11.0.0/lib/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:92:1)
Truffle v5.0.22 (core: 5.0.22)
Node v11.0.0
here is my truffle.js:
// Allows us to use ES6 in our migrations and tests.
require('babel-register')
var PrivateKeyProvider = require("truffle-privatekey-provider")
var PrivateKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
module.exports = {
networks: {
development: {
host: '127.0.0.1',
port: 7545,
network_id: '*' // Match any network id
},
ropsten: {
provider: function() {
return new PrivateKeyProvider(PrivateKey, "https://ropsten.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxx")
},
network_id: 3,
gas: 5000000,
skipDryRun: true,
gasPrice: 20000000000
}
}
}
And it works fine with truffle-hdwallet-provider, my truffer version is 5.0.22
, and truffle-privatekey-provider is 1.1.0
, please advice
When I deploy smart contract with Truffle 5.0.x I got issue:
Error: Error: Web3ProviderEngine does not support synchronous requests.
at Object.run (/usr/local/share/.config/yarn/global/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:84:1)
at
Truffle v5.0.18 (core: 5.0.18)
Node v8.15.1
It is still ok with truffle v4.1.15
When running my app.js file, everything will run smoothly for about 10 minutes (without making and functions run) then this error will occur and crash it:
web3-provider-engine has some error, that I saw was found in some other truffle npm packages. They were resolved, but not here =[
C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\truffle-privatekey-provider\node_modules\web3-provider-engine\index.js:219
number: ethUtil.toBuffer(jsonBlock.number),
^
TypeError: Cannot read property 'number' of null
at toBufferBlock (C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\truffle-privatekey-provider\node_modules\web3-provider-engine\index.js:219:50)
at C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\truffle-privatekey-provider\node_modules\web3-provider-engine\index.js:60:27
at C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\truffle-privatekey-provider\node_modules\web3-provider-engine\index.js:136:12
at C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\truffle-privatekey-provider\node_modules\web3-provider-engine\index.js:199:9
at C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\async\internal\once.js:12:16
at replenish (C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\async\internal\eachOfLimit.js:61:25)
at C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\async\internal\eachOfLimit.js:71:9
at eachLimit (C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\async\eachLimit.js:43:36)
at C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\async\internal\doLimit.js:9:16
at end (C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\truffle-privatekey-provider\node_modules\web3-provider-engine\index.js:176:5)
at Request._callback (C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\truffle-privatekey-provider\node_modules\web3-provider-engine\subproviders\rpc.js:64:5)
at Request.self.callback (C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\request\request.js:185:22)
at Request.emit (events.js:310:20)
at Request. (C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\request\request.js:1154:10)
at Request.emit (events.js:310:20)
at IncomingMessage. (C:\Users\Pronto\Documents\GitHub\remove-firebase\node_modules\request\request.js:1076:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Pronto\AppData\Roaming\npm-cache_logs\2020-08-22T00_48_56_835Z-debug.log
When I try to deploy contracts using privatekey provider and I check log, there are so many calls
eth_getBlockByNumber
eth_getBlockByNumber
eth_getBlockByNumber
eth_getBlockByNumber
So performance is quite bad, could you double check?
[email protected]
comes with vulnerabilities, as detected by snyk
.
Information Exposure [Medium Severity][https://security.snyk.io/vuln/SNYK-JS-NODEFETCH-2342118] in [email protected]
Introduced by [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected]
This issue was fixed in versions: 2.6.7, 3.1.1
Denial of Service [Medium Severity][https://security.snyk.io/vuln/SNYK-JS-NODEFETCH-674311] in [email protected]
Introduced by [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected]
This issue was fixed in versions: 2.6.1, 3.0.0-beta.9
Please, update.
when using provider for test suite it must be wrapped in a function!
provider: new PrivateKeyProvider(pk, "https://geth-noordung.fairdatasociety.org"),
hangs on prepare suite for truffle test --network noordung
provider: () => { return new PrivateKeyProvider(pk, "https://geth-noordung.fairdatasociety.org") },
doesn't!
What's the reason for the version of web3-provider-engine
to be pinned to web3-one
?
If there isn't one, may I submit a PR with dependencies updated?
Will there be any support for using websocket url in the future ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.