I'm trying to deploy a Smart Contract on Polygon mainnet but this happens when I run the migrate command using truffle
> Network name: 'matic'
> Network id: 137
> Block gas limit: 30176202 (0x1cc73ca)
1_initial_migration.js
======================
Deploying 'Animals'
-------------------
*** Deployment Failed ***
"Animals" -- transaction underpriced.
Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan.
Error: *** Deployment Failed ***
"Animals" -- transaction underpriced.
at /Users/nick/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:379:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Migration._deploy (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:68:1)
at Migration._load (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:54:1)
at Migration.run (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:202:1)
at Object.runMigrations (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/index.js:152:1)
at Object.runFrom (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/index.js:117:1)
at Object.runAll (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/index.js:121:1)
at Object.run (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/index.js:86:1)
at runMigrations (/Users/nick/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:78:1)
at Object.module.exports [as run] (/Users/nick/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:44:1)
at Command.run (/Users/nick/node_modules/truffle/build/webpack:/packages/core/lib/command.js:189:1)
Truffle v5.5.1 (core: 5.5.1)
This is my truffle-config.js
matic: {
provider: () => new HDWalletProvider(mnemonic, `https://polygon-mainnet.g.alchemy.com/v2/key`),
network_id: 137,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},
Does anyone know why is this happening?
Related
I installed goQuorum with quorum-wizard with 4 quorum nodes and 4 tessera nodes on IBFT. When I start the network with "./start.sh" I get
Starting Quorum network...
Waiting until all Tessera nodes are running...
Waiting until all Tessera nodes are running...
All Tessera nodes started
Starting Quorum nodes
Successfully started Quorum network.
--------------------------------------------------------------------------------
Tessera Node 1 public key:
BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo=
Tessera Node 2 public key:
QfeDAys9MPDs2XHExtc84jKGHxZg/aj52DTh0vtA3Xc=
Tessera Node 3 public key:
1iTZde/ndBHvzhcl7V68x44Vx7pl8nwx9LqnM/AfJUg=
Tessera Node 4 public key:
oNspPPgszVUFw0qmGFfWwh1uxVUXgvBxleXORHj07g8=
--------------------------------------------------------------------------------
when I run "nmap -p 21000-21100" I get
21000/tcp open irtrans
21001/tcp open unknown
21002/tcp open unknown
21003/tcp open unknown
This is my truffle-config.js
const HDWalletProvider = require("#truffle/hdwallet-provider");
const mnemonic = "not my real mn mon ic num phrase dum get l gg";
module.exports = {
networks: {
rinkeby: {
provider: function() {
return new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/"+mnemonic);
},
network_id: '*',
timeoutBlocks: 100000,
networkCheckTimeout:2000000
},
quorum: {
provider: function() {
return new HDWalletProvider(mnemonic, "http://127.0.0.1:21000/", chainId=10);
},
network_id: '*',
type: 'quorum',
timeoutBlocks: 100000,
networkCheckTimeout:2000000
},
compilers: {
solc: {
version: "0.5.0",
settings: {
optimizer: {
enabled: true, // Default: false
runs: 1000 // Default: 200
},
evmVersion: "homestead" // Default: "byzantium"
}
}
}
};
When I cd in to the directory with the truffle-config.js and I run truffle deploy --reset --network quorum to compile my smart contracts I get the following error.
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
/root/dapp1/Dapp/node_modules/web3-core-helpers/src/errors.js:42
return new Error(message);
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: Invalid JSON RPC response: ""
at Object.InvalidResponse (/root/dapp1/Dapp/node_modules/web3-core-helpers/src/errors.js:42:16)
at XMLHttpRequest.request.onreadystatechange (/root/dapp1/Dapp/node_modules/web3-providers-http/src/index.js:92:32)
at XMLHttpRequestEventTarget.dispatchEvent (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpRequestError (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:379:8)
at ClientRequest.<anonymous> (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:266:37)
at ClientRequest.emit (events.js:315:20)
at Socket.socketOnEnd (_http_client.js:493:9)
at Socket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
at PollingBlockTracker._performSync (/root/dapp1/Dapp/node_modules/eth-block-tracker/src/polling.js:51:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
I can deploy the smart contracts to rinkeby test net within this environment but I can't get smart contracts to deploy to quorum
I am using
Node v14.16.1
Ubuntu 18.04 (64 Bit)
Quorum 21.1.0
Web3.js v1.3.5
Truffle v5.3.4 (core: 5.3.4)
solidity v0.5.0
I've not used truffle with HDWalletProvider, which I believe is from an older version of Truffle. I'm not certain that will set up the node connection.
We would normally set up the configuration like the following in the quorum: {} section:
host: "localhost",
port: 22001,
type: "quorum"
I would suggest using that and see if it works.
Take a look at the truffle docs for working with quorum: https://www.trufflesuite.com/docs/truffle/distributed-ledger-support/working-with-quorum
Did you change from the default ports in the quorum-wizard?
The default for the node 1 RPC is 22000, the 21000 range is for p2p networking.
I would set the host and port per Satpal's answer above, as in the hdwallet documentation here.
I am new to webdriverIO, while trying to run using cucumber framework, even though the execution is happening, I see the steps are retried as if there was a failure
ERROR #wdio/local-runner: Failed launching test session: Error: Couldn't find page handle
at DevToolsDriver.getPageHandle (D:\webdriverio\test2\node_modules\devtools\build\devtoolsdriver.js:143:19) can anyone help how to resolve this?
//----------- Cucumber Config Details -------------//
const path = require("path");
exports.config = {
runner: "local",
headless: false,
specs: ["./test.feature"],
maxInstances: 1,
maxInstancesPerCapability: 10,
capabilities: [
{
browserName: "chrome",
},
],
logLevel: "trace",
outputDir: "./",
bail: 0,
waitforTimeout: 1000,
framework: "cucumber",
specFileRetries: 1,
specFileRetriesDelay: 0,
specFileRetriesDeferred: false,
cucumberOpts: {
require: [path.join(__dirname, "step-definitions", "my-steps.js")],
backtrace: true,
compiler: [],
dryRun: false,
failFast: false,
format: ["pretty"],
snippets: true,
source: true,
profile: [],
strict: false,
tagExpression: "",
timeout: 20000,
ignoreUndefinedDefinitions: false,
scenarioLevelReporter: false,
},
};
//---------- Step definition-------------//
const {Given} = require("#cucumber/cucumber");
Given("I navigate to webdriverIo", async function () {
await browser.url("https://duckduckgo.com");
const inputElem = await browser.$("#search_form_input_homepage");
await inputElem.setValue("WebdriverIO");
const submitBtn = await browser.$("#search_button_homepage");
await submitBtn.click();
console.log(await browser.getTitle()); // outputs: "Title is: WebdriverIO (Software) at DuckDuckGo"
await browser.deleteSession();
});
//-------------- wdio.Log ----------------//]
2021-04-18T01:17:24.886Z INFO #wdio/cli:launcher: Run onPrepare hook
`2021-04-18T01:17:24.893Z INFO #wdio/cli:launcher: Run onWorkerStart hook
2021-04-18T01:17:24.895Z INFO #wdio/local-runner: Start worker 0-0 with arg: .\testRunner.js
2021-04-18T01:17:39.068Z DEBUG #wdio/local-runner: Runner 0-0 finished with exit code 1
2021-04-18T01:17:39.073Z INFO #wdio/cli:launcher: Run onWorkerStart hook
2021-04-18T01:17:39.074Z INFO #wdio/local-runner: Start worker 0-0 with arg: .\testRunner.js
2021-04-18T01:17:51.990Z DEBUG #wdio/local-runner: Runner 0-0 finished with exit code 1
2021-04-18T01:17:51.994Z INFO #wdio/cli:launcher: Run onComplete hook
2021-04-18T01:17:52.033Z INFO #wdio/local-runner: Shutting down spawned worker
2021-04-18T01:17:52.289Z INFO #wdio/local-runner: Waiting for 0 to shut down gracefully
//-------------- wdio-0-0.Log ----------------//
2021-04-18T01:17:40.546Z INFO #wdio/local-runner: Run worker command: run
2021-04-18T01:17:40.555Z DEBUG #wdio/config:ConfigParser: No compiler found, continue without compiling files
2021-04-18T01:17:40.560Z DEBUG #wdio/local-runner:utils: init remote session
2021-04-18T01:17:41.601Z DEBUG #wdio/local-runner:utils: init remote session
2021-04-18T01:17:41.622Z INFO devtools:puppeteer: Initiate new session using the DevTools protocol
2021-04-18T01:17:41.623Z INFO devtools: Launch Google Chrome with flags: --enable-automation --disable-popup-blocking --disable-extensions --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --no-default-browser-check --disable-hang-monitor --disable-prompt-on-repost --disable-client-side-phishing-detection --password-store=basic --use-mock-keychain --disable-component-extensions-with-background-pages --disable-breakpad --disable-dev-shm-usage --disable-ipc-flooding-protection --disable-renderer-backgrounding --force-fieldtrials=*BackgroundTracing/default/ --enable-features=NetworkService,NetworkServiceInProcess --disable-features=site-per-process,TranslateUI,BlinkGenPropertyTrees --window-position=0,0 --window-size=1200,900
2021-04-18T01:17:42.177Z INFO devtools: Connect Puppeteer with browser on port 54789
2021-04-18T01:17:42.722Z INFO devtools: COMMAND
navigateTo("https://duckduckgo.com/")
2021-04-18T01:17:46.810Z INFO devtools: RESULT null
2021-04-18T01:17:46.824Z INFO devtools: COMMAND findElement("css selector", "#search_form_input_homepage")
2021-04-18T01:17:46.833Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-1' }
2021-04-18T01:17:46.862Z INFO devtools: COMMAND elementClear("ELEMENT-1")
2021-04-18T01:17:46.875Z INFO devtools: RESULT null
2021-04-18T01:17:46.892Z INFO devtools: COMMAND elementSendKeys("ELEMENT-1", "WebdriverIO")
2021-04-18T01:17:47.044Z INFO devtools: RESULT null
2021-04-18T01:17:47.051Z INFO devtools: COMMAND findElement("css selector", "#search_button_homepage")
2021-04-18T01:17:47.055Z INFO devtools: RESULT { 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT-2' }
2021-04-18T01:17:47.085Z INFO devtools: COMMAND elementClick("ELEMENT-2")
2021-04-18T01:17:47.438Z INFO devtools: RESULT null
2021-04-18T01:17:51.904Z INFO devtools: COMMAND getTitle()
2021-04-18T01:17:51.907Z INFO devtools: RESULT WebdriverIO at DuckDuckGo
2021-04-18T01:17:51.913Z INFO devtools: COMMAND deleteSession()
2021-04-18T01:17:51.918Z INFO devtools: RESULT null
2021-04-18T01:17:51.935Z ERROR #wdio/local-runner: Failed launching test session: Error: Couldn't find page handle
at DevToolsDriver.getPageHandle (D:\webdriverio\test2\node_modules\devtools\build\devtoolsdriver.js:143:19)
at DevToolsDriver.checkPendingNavigations (D:\webdriverio\test2\node_modules\devtools\build\devtoolsdriver.js:152:25)
at Browser.wrappedCommand (D:\webdriverio\test2\node_modules\devtools\build\devtoolsdriver.js:70:24)
at Browser.wrapCommandFn (D:\webdriverio\test2\node_modules\#wdio\utils\build\shim.js:78:38)
at async Runner.endSession (D:\webdriverio\test2\node_modules\#wdio\runner\build\index.js:340:9)
at async Runner.run (D:\webdriverio\test2\node_modules\#wdio\runner\build\index.js:160:13)
This is probably not the exact solution for your issue but adding it here for others, I receieved this error:
ERROR #wdio/local-runner: Failed launching test session: TypeError: Cannot set property 'failures' of undefined at WdioMochawesomeReporter. ...
Short Answer: Run only files which have tests in them.
This github issue helped me to fix my "specs" regex in wdio.conf.js file.
specs when error occurred: "specs: [ './tests/**/*.js' ]"
it was running some utility files also which did not have any tests in them and hence test runner failed,
specs now (fixed version): "specs: [ './tests/**/*-functional.test.js' ]"
Also, I received this error only when mochawesome reporter added to wdio.cong.js file.
I'm heaving problems with permission on running this CUPS command : cancel -a where -a is the option to cancel all jobs on all printers.
this is all the output in console:
error: Error: spawnSync /home/finsoft EACCES
at Object.spawnSync (internal/child_process.js:1041:20)
at spawnSync (child_process.js:616:24)
at Object.cancelAll (/home/finsoft/ProgettoStampantiLinux/ProgettoStampanti/api/cupsApis.js:155:19)
at /home/finsoft/ProgettoStampantiLinux/ProgettoStampanti/app.js:80:24
at Layer.handle [as handle_request] (/home/finsoft/ProgettoStampantiLinux/ProgettoStampanti/node_modules/express/lib/router/layer.js:95:5)
at next (/home/finsoft/ProgettoStampantiLinux/ProgettoStampanti/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/finsoft/ProgettoStampantiLinux/ProgettoStampanti/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/finsoft/ProgettoStampantiLinux/ProgettoStampanti/node_modules/express/lib/router/layer.js:95:5)
at /home/finsoft/ProgettoStampantiLinux/ProgettoStampanti/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/finsoft/ProgettoStampantiLinux/ProgettoStampanti/node_modules/express/lib/router/index.js:335:12) {
errno: 'EACCES',
code: 'EACCES',
syscall: 'spawnSync /home/finsoft',
path: '/home/finsoft',
spawnargs: [ '-c', 'cancel -u' ]
},
status: null,
signal: null,
output: null,
pid: 9826,
stdout: null,
stderr: null
}
this is my spawnSync function:
cancelAll = function () {
let args = ["-a"];
let cancelAll = spawnSync("cancel", args, { encoding: "utf-8", shell: '/home/finsoft'});
// console.log(cancelAll);
return cancelAll;
};
the option shell:'/home/finsoft' is the path to the shell I want to use.
what I did until now:
1)I tried adding to the root group the user used in the spawnSync, which is finsoft, and i double checked it by running this:
let args = ["-u"];
args.push('finsoft');
let uid = spawnSync('id', args, { encoding: "utf-8"});
console.log(uid);
output of the console.log(uid):
{
status: 0,
signal: null,
output: [ null, '1000\n', '' ],
pid: 8141,
stdout: '1000\n',
stderr: ''
}
the witch correspond to the finsoft uid
2)i changed the permissions of /home/finsoft like this:
sudo chmod 777 /home/finsoft
the result of ls-l:
finsoft#finsoft-20351:/home$ ls -l
total 4
drwxrwxrwx 34 finsoft finsoft 4096 Feb 23 09:11 finsoft
I even tried to specify the option uid:0 in the spawnSync, it should use the root user, and changed the shell path to its default(/bin/sh), so i shouldn't have problems with permissions or other requirements stuff, but that gives a totally different error:
Error: spawnSync /bin/sh EPERM
What else can I try?
var gm = require("gm").subClass({ imageMagick: true });
function conversion(image) {
const image = gm(image);
image.orientation(function(err, value) {
if (err) {
console.log("Error Occurred :",err);
}
}
While accessing image.orientation this is the error which occurs.
Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:154:25)
at writeGeneric (internal/stream_base_commons.js:145:3)
at Socket._writeGeneric (net.js:786:11)
at Socket._write (net.js:798:8)
at doWrite (_stream_writable.js:403:12)
at writeOrBuffer (_stream_writable.js:387:5)
at Socket.Writable.write (_stream_writable.js:318:11)
at gm._spawn (/var/task/node_modules/gm/lib/command.js:253:18)
at gm._exec (/var/task/node_modules/gm/lib/command.js:190:17)
at gm.proto.<computed> [as orientation] (/var/task/node_modules/gm/lib/getters.js:68:12) {
errno: 'EPIPE',
code: 'EPIPE',
syscall: 'write'
}
These are some steps which i have already performed.
i have tried installing both imagemagick and graphicsmagick. https://www.npmjs.com/package/gm
Also there was suggestion to reinstall imagemagick and graphicsmagick and testing after restarting system. it also didn't worked
i am using Ubuntu , npm gm version:"^1.23.1", node version : nodejs12.x
I am trying to autorun phpunit using gulp. When phpunit fails a test I see the following error in terminal (all passed tests do not cause the error):
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
events.js:188
throw err;
^
Error: Unhandled "error" event. (1)
at Domain.emit (events.js:186:19)
at Stream.emit (events.js:181:14)
at Stream.onerror (/var/www/html/wptest2/node_modules/readable-stream/lib/_stream_readable.js:640:52)
at emitOne (events.js:116:13)
at Stream.emit (events.js:211:7)
at next (/var/www/html/wptest2/node_modules/map-stream/index.js:74:19)
at /var/www/html/wptest2/node_modules/map-stream/index.js:84:7
at /var/www/html/wptest2/node_modules/gulp-phpunit/index.js:341:17
at /var/www/html/wptest2/node_modules/shelljs/src/exec.js:204:9
at ChildProcess.exithandler (child_process.js:282:5)
Gulpfile.js:
var gulp = require('gulp'),
connect = require('gulp-connect-php'),
gulpPhpunit = require('gulp-phpunit');
gulp.task('gulpPhpunit', function(done) {
var options = {debug: false};
gulp.src('phpunit.xml')
.pipe(gulpPhpunit('./vendor/bin/phpunit', options));
done();
});
gulp.task("default", gulp.series('gulpPhpunit'));
Does anyone know how to solve this?