network id specified in truffle config does not match the one returned by network - truffle

I'm trying to run a truffle test on ganache-cli and it keeps saying the network ids do not match even though in my truffle-config.js file I specified the id to be 5777 not 4447
Error: The network id specified in the truffle config (4447) does not match the one returned by the network (5777). Ensure that both the network and the provider are properly configured.
at Object.detectAndSetNetworkId (/Users/rbeit/.npm-global/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/environment.js:94:1)
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at Object.detect (/Users/rbeit/.npm-global/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/environment.js:22:1)
at Object.develop (/Users/rbeit/.npm-global/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/environment.js:71:1)
Truffle v5.0.21 (core: 5.0.21)
Node v12.3.1

!Vande Maataram!
You must have cloned the project directly from the github repository (https://github.com/aelshayeb/blockchain) and started compiling and running this .... try this ... just do it.
->npm uninstall truffle -g
->npm install truffle -g (this and the previous ensures running the most current version, now 5.0.4)
->mkdir metacoin
->cd metacoin
->truffle unbox metacoin (try this)
now open the truffle-config.js in the meta coin folder and uncomment the truffle-config.js: "default values".
now you can use:
*truffle compile,
*truffle migrate,
*truffle test;
but, first check the following things:
1. your blockchain network_id is same as reffered in the truffle-config.js.
2. if you run on private net so, check the hostIP and portnumber and network_id before you set start.
Go on Enjoy Coding!!
||Krinavantovishwamaryam||

Related

Error while depolying contract in near ECONNREFUSED

So I'm fairly new to Near protocol. I created a near app using
npx create-near-app#latest
hello-near was the default name of the near app and folder so i just pressed enter.
npm install -g near-cli
cd hello-near
npm run build:contract
So, everything above ran smoothly. But when I went to deploy it using the command
near dev-deploy build/hello-near.wasm
And gives this output.
Starting deployment. Account id: dev-1660902746796-39871857513719, node: https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file: contract/build/hello_near.wasm
Transaction Id F7FWUEbKFqoWs9yNvk156bdmzWhHfnJ9exhWNHPREMAb
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/F7FWUEbKFqoWs9yNvk156bdmzWhHfnJ9exhWNHPREMAb
Done deploying to dev-1660902746796-39871857513719
The transaction has succeeded. But right after this, it throws a long error :https://pastebin.com/5vZpN1HD
in short, it says ECONNREFUSED 0.0.0.0:443
The problem was with my DNS. segment.io was not getting connected because I had adguardDNS. I changed my DNS to 8.8.8.8 / 8.8.4.4 and that solved the Issue and authentication was successful.

Upgrade network configuration after chaincode modification on hyperledger Fabric blockchain

I am working with this blockchain application for medics traceability (https://github.com/rastringer/medication-blockchain) based on hyperledger fabric blockchain.
It's exactly the same app as this project (https://github.com/hyperledger/education/tree/master/LFS171x/fabric-material/tuna-app) except that this project is for tuna traceability.
I modify the chaincode file (the file is "drug-chaincode.go"), and now apparently I need to reconfigure all my network in "basic-network" folder so that the modification is add, but I don't how I can do this.
I tried to follow this link without results (How to upgrade a chaincode after modification?)
Anyhelp is welcome, thank you in advance ;)
if u r trying to build hyperledger project similar to drug-app. Then do following things:
Delete node_modules:
drug-blockchain/drug-app/node_modules
Then change every parameter which states the drug blockchain, basically u have to change parameters to Yours on following sources:
drug-chaincode.go
startFabric.sh
server.js
routes.js
registerUser.js
registerAdmin.js
package.json
controller.js
recordDrug.js
queryDrug.js
queryAllDrug.js
changeDrugHolder.js
app.ja
index.html
In the end re-run the network:
cd drug-blockchain/drug-app
$./startFabric.sh
$npm install -g
$node registerAdmin.js
$node registerUser.js
$node server.js
if u do change parameters properly, it should work fine, otherwise recheck, there shouldn't be any data of previous drug-blockchain!

hyperledger-fabric "Writing your first Application" query.js step fails

Steps "git clone...", "startFabric.sh" and "npm.install" complete with no errors. "node query.js" results in:
Set wallet path, and associate user PeerAdmin with application
error: [Client.js]: Failed to load user "PeerAdmin" from local key value store. Error: TypeError: this is not a typed array.
at Function.from (native)
at importKey (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:180:26)
at fromString (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/User.js:228:28)
at /home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/Client.js:968:22
error: [Client.js]: Failed to load an instance of requested user "PeerAdmin" from the state store on this Client instance. Error: TypeError: this is not a typed array.
at Function.from (native)
at importKey (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:180:26)
at fromString (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/User.js:228:28)
at /home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/Client.js:968:22
Caught Error [TypeError: this is not a typed array.]
Note: after the git clone step, there is no "chaincode" in fabric-samples/fabcar as stated in the docs, but there is a chaincode/fabcar in fabric-samples. This does not seem to cause a problem.
Note: All steps in "Building Your First Network" complete with no problems.
Hyperledger Fabric 1.0 has been tested against Node.js version >= 6.9 and < 7.x. If you get a similar error, recommend updating the version of Node.js (or use a version manager such as nvm) and re-try. If you have already run npm install with an older version of Node, you should delete the node_modules tree and re-run npm install to be sure you are installing the correct dependencies.

Error while updating business network in CLI tutorial

I am following along the Getting Started with Fabric Command Line and have run into a error I don't understand how to resolve. Any ideas?
In the section entitled "Update the deployed business network" an exception is thrown. The terminal output is below. The command used:
composer network update --archiveFile digitalproperty-network#0.0.7.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
Note that the id is different from the tutorial as the 0.0.7 id was reported during the previous step while creating. The output continued...
Deploying business network from archive digitalproperty-network#0.0.7.bna
Business network definition:
Identifier: digitalproperty-network#0.0.7
Description: Digital Property Network
events.js:160
throw er; // Unhandled 'error' event
^
Error
at ClientDuplexStream._emitStatusIfDone (/home/mnjacobs/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._readsDone (/home/mnjacobs/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:158:8)
at readCallback (/home/mnjacobs/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:217:12)
I've struggled to get the versions to match the tutorials - they seem inconsistent. Notably, the node (v6.9.5) and nodejs (v6.10.1) versions differ even though node is a symbolic link to nodejs and I notice 6.9.5 is in the stack trace. I'm not sure that difference is relevant to the problem.
Other version information:
Ubuntu 14.04.5
Docker version 17.03.1-ce, build c6d412e (manually installed as auto
install was down level)
docker-compose version 1.12.0-rc2, build 08dc2a4
I've seen exactly that error when Hyperledger Fabric isn't running. If docker ps doesn't show anything, run npm run startHLF in the sample-applications/packages/getting-started directory before trying again.

Unable to remove module of node-red

I am having issues with node-red and can no longer run any flows, i am not sure what to do anymore.
i get the following error
Imported unrecognised type: mqtt-env-broker
Flows stopped due to missing node types. Check logs for details.
Tried to remove this module from the palette but get the following error, i am also unable to disable it
Failed to remove: node-red-contrib-mqtt-env
Error: Type in use: mqtt-env-broker
Check the log for more information
I have installed the node-red-admin and tried to remove it from command line, so i issued the following command
sudo node-red-admin remove node-red-contrib-mqtt-env/mqtt-env
i get the following error
404: Cannot DELETE /nodes/node-red-contrib-mqtt-env/mqtt-env
this is what i get when i ran the following command
node-red-admin list
Nodes Types State
node-red-contrib-mqtt-env/mqtt-env mqtt-env in error
mqtt-env out
mqtt-env-broker
node-red-dashboard/ui_audio ui_audio enabled
...
...
node-red/mqtt mqtt in error
mqtt out
mqtt-broker
The flows are stopped because they are trying to use a node type you have not got installed - or in this instance, it appears, is hitting an error when it tries to start
The runtime won't let you remove the node because it is referenced in your flow.
To fix this you need to delete any of the nodes referenced by this module from your flow. The name mqtt-env-broker suggests it is a configuration node rather than a regular flow node. Open the Configuration Nodes sidebar panel (from the drop-down menu) and look for any unknown config nodes. Double click on them and delete them. Once you've removed them, hit deploy and things should start working again.
You should then be able to delete the node module from your runtime.

Resources