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 try to connect to mongoDB through docker-compose but i get the same error over and over again although i tried all the solutions from the net. Thank you.
I have my docker-compose.yml as
# Use root/example as user/password credentials
version: '3.1'
services:
mongo:
image: mongo
restart: always
container_name: mongo
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
MONGO_INITDB_DATABASE: test
MONGO_USERNAME: admin
MONGO_PASSWORD: example
volumes:
- ./data:/data/db
- ./mongo-entrypoint.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro
command: mongod
mongo-express:
image: mongo-express
restart: always
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
And I have such a shell script
mongo -- "$MONGO_INITDB_DATABASE" <<EOF
db.createUser({
user: "$MONGO_USERNAME",
pwd: "$MONGO_PASSWORD",
roles: [
{ role: 'readWrite', db: "$MONGO_INITDB_DATABASE" }
]
})
EOF
And I try to connect to database by:
mongoose
.connect("mongodb://admin:example#localhost:27017/test")
.then(() => console.log("connected"))
.catch((e) => console.log("error:", e));
In Linux my friend can connect with the same code pieces but I am getting this error :
running on 3000
error: MongoError: Authentication failed.
at MessageStream.messageHandler (C:\Users\kamad\Desktop\3-2\cs308\proje\backend\node_modules\mongodb\lib\cmap\connection.js:268:20)
at MessageStream.emit (events.js:315:20)
at processIncomingData (C:\Users\kamad\Desktop\3-2\cs308\proje\backend\node_modules\mongodb\lib\cmap\message_stream.js:144:12)
at MessageStream._write (C:\Users\kamad\Desktop\3-2\cs308\proje\backend\node_modules\mongodb\lib\cmap\message_stream.js:42:5)
at writeOrBuffer (internal/streams/writable.js:358:12)
at MessageStream.Writable.write (internal/streams/writable.js:303:10)
at Socket.ondata (internal/streams/readable.js:719:22)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
ok: 0,
code: 18,
codeName: 'AuthenticationFailed'
}
I solved this just by changing the port from 27017 to 27018. Unfortunately, another app of mine was using that port.
There is my solved used :
docker-compose -f stack.yml up --build --force-recreate --renew-anon-volumes -d
stack.yml :
version: "3.5"
services:
mongo:
image: mongo:latest
container_name: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
ports:
- "0.0.0.0:27017:27017"
networks:
- MONGO
volumes:
- MONGO_DATA:/Users/lirui/docker/data/mongo/db
- MONGO_CONFIG:/Users/lirui/docker/data/mongo/configdb
mongo-express:
image: mongo-express:latest
container_name: mongo-express
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: admin
ME_CONFIG_MONGODB_ADMINPASSWORD: admin
ME_CONFIG_MONGODB_SERVER: mongo
ME_CONFIG_MONGODB_PORT: "27017"
ports:
- "0.0.0.0:8088:8081"
networks:
- MONGO
depends_on:
- mongo
networks:
MONGO:
name: MONGO
volumes:
MONGO_DATA:
name: MONGO_DATA
MONGO_CONFIG:
name: MONGO_CONFIG
Replace path with your compute absolute path.
And DO NOT use 'root' to authentication.
use mongosh
shell script can use:
mongosh --port 27017 --authenticationDatabase -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" <<EOF
use admin
db.createUser({
user: process.env.MONGO_USERNAME ,
pwd: process.env.MONGO_PASSWORD ,
roles: [{
role: 'readWrite',
db: process.env.MONGO_INITDB_DATABASE }]
})
EOF
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 created a project that integrates the truffle and react frameworks,Then I configured rinkeby test network of Ethereum in truffle-config.js.But, when I migrate the contract to rinkeby network, something went wrong.
truffle compile
truffle migrate --network rinkeby
Then came some mistakes
TypeError: Cannot read property '_alreadyWrapped' of undefined
at Object.wrap (C:\Users\Lsy\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\provider\wrapper.js:13:1)
at Object.wrap (C:\Users\Lsy\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\provider\index.js:9:1)
at Object.create (C:\Users\Lsy\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\provider\index.js:14:1)
at TruffleConfig.get [as provider] (C:\Users\Lsy\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\config\dist\configDefa
ults.js:189:1)
at Object.detect (C:\Users\Lsy\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\environment\environment.js:19:1)
at C:\Users\Lsy\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:192:1
Truffle v5.1.1 (core: 5.1.1)
Node v12.13.0
The Project directory is shown below:
truffle-config.js
const path = require("path");
const HDWalletProvider = require('#truffle/hdwallet-provider');
const fs = require('fs')
let secrets;
console.log(path.join(__dirname, "secrets.json"));
if (fs.existsSync(path.join(__dirname, "secrets.json"))){
secrets = JSON.parse(fs.readFileSync(path.join(__dirname, "secrets.json"),'utf8'));
}else{
console.log("secrets.json doesn't exist!")
}
module.exports = {
contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
ganache:{
host:"127.0.0.1",
port:7545,
network_id:"*"
},
develop: {
port: 8545
},
rinkeby:{
provider:()=>{
new HDWalletProvider(secrets.mnemonic,"https://rinkeby.infura.io/v3/"+secrets.infuraProjectId);
},
network_id: '4'
}
}
};
This problem has been bothering me for a long time, who can help me! Really Thanks!
You forgot the return statement:
rinkeby: {
provider: () => {
return new HDWalletProvider(secrets.mnemonic,"https://rinkeby.infura.io/v3/"+secrets.infuraProjectId);
},
network_id: 4
}
I wanted to lift my sails aap in production mode.when i run sails lift --prod --verbose, i am getting bunch of errors.
My local.js file looks like this.
/**
* Local environment settings
*
* While you're developing your app, this config file should include
* any settings specifically for your development computer (db passwords, etc.)
* When you're ready to deploy your app in production, you can use this file
* for configuration options on the server where it will be deployed.
*
*
* PLEASE NOTE:
* This file is included in your .gitignore, so if you're using git
* as a version control solution for your Sails app, keep in mind that
* this file won't be committed to your repository!
*
* Good news is, that means you can specify configuration for your local
* machine in this file without inadvertently committing personal information
* (like database passwords) to the repo. Plus, this prevents other members
* of your team from commiting their local configuration changes on top of yours.
*
*
* For more information, check out:
* http://sailsjs.org/#documentation
*/
var config={
development:{
connections: {
mongo: {
adapter: 'sails-mongo',
host: 'localhost',
user: '',
password: '',
database: 'mydata',
schema: true
}
},
mailer:{
hostUrl:'http://localhost:1337/',
emailConfirm:'confirm/',
inviteMoreFriends:'myspace'
},
geoSpatial:{
radiusOfEarth:6375,
radius:3,
maxRecords:20
},
facebook:{
clientID: "CLIENT ID",
clientSecret: "SECRET",
callbackURL: "http://www.EXAMPLE.com:1337/auth/facebook/callback"
}
}
}
module.exports = {
// The `port` setting determines which TCP port your app will be deployed on
// Ports are a transport-layer concept designed to allow many different
// networking applications run at the same time on a single computer.
// More about ports: http://en.wikipedia.org/wiki/Port_(computer_networking)
//
// By default, if it's set, Sails uses the `PORT` environment variable.
// Otherwise it falls back to port 1337.
//
// In production, you'll probably want to change this setting
// to 80 (http://) or 443 (https://) if you have an SSL certificate
port: process.env.PORT || 1337,
// The runtime "environment" of your Sails app is either 'development' or 'production'.
//
// In development, your Sails app will go out of its way to help you
// (for instance you will receive more descriptive error and debugging output)
//
// In production, Sails configures itself (and its dependencies) to optimize performance.
// You should always put your app in production mode before you deploy it to a server-
// This helps ensure that your Sails app remains stable, performant, and scalable.
//
// By default, Sails sets its environment using the `NODE_ENV` environment variable.
// If NODE_ENV is not set, Sails will run in the 'development' environment.
environment: process.env.NODE_ENV || 'development',
development: {
//config is placed as the attributes needed by aws config node module
aws: {
region: 'REGION',
accessKeyId: 'KEY ID',
secretAccessKey: 'SECRET',
cloudFrontCDN: 'EXAMPLE.cloudfront.net'
},
s3: {
Bucket: 'MY_BUCKET',
endpoint: 'ENDPOINT',
imageUrl: 'URL'
},
uploads: {
thumbnails: __dirname + '/../uploads/thumbnails/'
}
},
likeprod: {
//config is placed as the attributes needed by aws config node module
aws: {
region: 'REGION',
accessKeyId: 'KEY ID',
secretAccessKey: 'SECRET',
cloudFrontCDN: 'EXAMPLE.cloudfront.net'
},
s3: {
Bucket: 'MY_BUCKET',
endpoint: 'ENDPOINT',
imageUrl: 'URL'
},
uploads: {
thumbnails: __dirname + '/../uploads/thumbnails/'
}
},
mandrillApiKey:"API_KEY",
twilio:{
accountSid:'SECRET',
authToken:'TOKEN'
},
metaPublic:{
groupBookNumber:'+0123456789'
},
connections:config[process.env.NODE_ENV].connections,
mailer:config[process.env.NODE_ENV].mailer,
geoSpatial:config[process.env.NODE_ENV].geoSpatial,
facebook:config[process.env.NODE_ENV].facebook,
//TODO: refactor the config[environment] as for connections
current: function () {
return sails.config[sails.config.environment]
}
};
when i run sails lift --prod. I am getting this error.
$ sails lift --prod --verbose
info: Starting app...
verbose: Please run `npm install coffee-script` to use coffescript (skipping for now)
verbose: Setting Node environment...
verbose: moduleloader hook loaded successfully.
verbose: Loading app config...
/home/vgulp/Desktop/config/local.js:136
connections:config[process.env.NODE_ENV].connections,
^
TypeError: Cannot read property 'connections' of undefined
at Object.<anonymous> (/home/Desktop/vka/config/local.js:136:45)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /home/Desktop/vka/node_modules/sails/node_modules/include-all/index.js:129:29
at Array.forEach (native)
at requireAll (/home/Desktop/vka/node_modules/sails/node_modules/include-all/index.js:44:9)
at buildDictionary (/home/Desktop/vka/node_modules/sails/node_modules/sails-build-dictionary/index.js:68:14)
at Function.module.exports.aggregate (/home/Desktop/vka/node_modules/sails/node_modules/sails-build-dictionary/index.js:190:9)
at Array.loadOtherConfigFiles [as 0] (/home/Desktop/vka/node_modules/sails/lib/hooks/moduleloader/index.js:102:22)
at /home/Desktop/vka/node_modules/sails/node_modules/async/lib/async.js:459:38
at Array.forEach (native)
at _each (/home/Desktop/vka/node_modules/sails/node_modules/async/lib/async.js:32:24)
at Object.async.auto (/home/Desktop/vka/node_modules/sails/node_modules/async/lib/async.js:430:9)
Can anyone suggest a solution.
[ Edited: the following answer was based on the original question which was completely changed by the author ]
Your sails app need to lift in production mode or you need to specify the port to be used in your config files.
Production mode runs your express server on port 80.
Is your AWS instance setup to lift the app in production mode?
http://sailsjs.org/documentation/anatomy/my-app/config/env/production-js
You don 't have connection specified for production in local.js (As you are running from your Desktop)
As the error rightly says,
connections:config[process.env.NODE_ENV].connections,
^
TypeError: Cannot read property 'connections' of undefined
process.env.NODE_ENV is production when running in --prod
var config = {
development: {
connections: {
mongo: {
adapter: 'sails-mongo',
host: 'localhost',
user: '',
password: '',
database: 'mydata',
schema: true
}
},
mailer: {
hostUrl: 'http://localhost:1337/',
emailConfirm: 'confirm/',
inviteMoreFriends: 'myspace'
},
geoSpatial: {
radiusOfEarth: 6375,
radius: 3,
maxRecords: 20
},
facebook: {
clientID: "CLIENT ID",
clientSecret: "SECRET",
callbackURL: "http://www.EXAMPLE.com:1337/auth/facebook/callback"
}
},
production: {
connections: {
mongo: {
adapter: 'sails-mongo',
host: 'localhost',
user: '',
password: '',
database: 'mydata',
schema: true
}
},
mailer: {
hostUrl: 'http://localhost:1337/',
emailConfirm: 'confirm/',
inviteMoreFriends: 'myspace'
},
geoSpatial: {
radiusOfEarth: 6375,
radius: 3,
maxRecords: 20
},
facebook: {
clientID: "CLIENT ID",
clientSecret: "SECRET",
callbackURL: "http://www.EXAMPLE.com:1337/auth/facebook/callback"
}
}
}