rudrakhp / KYC-chain

A blockchain based KYC registry prototype
MIT License
73 stars 38 forks source link

Unable to excute ,i already tried your previous instructions but it still shows this error #8

Closed dfy-aa closed 5 years ago

dfy-aa commented 5 years ago

/home/dhn99/Documents/KYC-chain-master/root/init.js:9 abiDefinition = JSON.parse(contract.contracts[':kyc'].interface); ^

TypeError: Cannot read property ':kyc' of undefined at Object. (/home/dhn99/Documents/KYC-chain-master/root/init.js:9:46) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

SivaSamrajS commented 5 years ago

Hi,

Can someone know how to solve this issue? I am also getting the same error.

pcakhilnadh commented 5 years ago

Stuck at this error !! @SivaSamrajS you got any solutions ? I've asked this issue in StackOverflow as well. https://stackoverflow.com/questions/55999969/typeerror-cannot-read-property-kyc-of-undefined

Update 1:

When I modified the code to print the object

code = fs.readFileSync('kyc.sol');
//contract = web3.eth.compile.solidity(code); depreciated code
contract = solc.compile(code.toString(),1);
console.log(contracts);

I'm getting the following errors

AssertionError [ERR_ASSERTION]: Invalid callback specified.

Update 2

when I installed web3 and solc using

npm install web3@0.19 npm install solc@0.4.4

The above problem got fixed . Now I', getting following error

TypeError: Cannot read property 'interface' of undefined at Timeout.afterDelay [as _onTimeout] (/Users/pc/Documents/Programs/KYC-chain-master/root/init.js:16:59) at ontimeout (timers.js:458:11) at tryOnTimeout (timers.js:296:5) at Timer.listOnTimeout (timers.js:259:5)

rudrakhp commented 5 years ago

Hi damodharan-c,

I have updated the requirements. Refer README.md.

shahkshitij15 commented 4 years ago

Hi rudra, Everytime I run node init.js I am getting the following error:-

abiDefinition = JSON.parse(contract.contracts[':kyc'].interface); ^

TypeError: Cannot read property ':kyc' of undefined at Timeout.afterDelay [as _onTimeout] (/Users/admin/Desktop/KYC-chain/root/init.js:16:50) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

Can you please help me with this. What should I change in the code or what should I download?

kashyapjoshi25 commented 1 year ago

@shahkshitij15 the same error I'm getting .Have you got any solution for this error??