Closed maxsam4 closed 6 years ago
Hey, are you passing the correct path
Yes, I am. The only thing different from documentation of aion is that I am on Ubuntu bionic rather than xenial.
Are you able to deploy the contract?
The contacts didn't compile so I didn't try deploying. Build folder was empty after trying to compile.
Also, iirc, in the default aion config, rpc was disabled. Had to enable it.
Error Plugin: @titan-suite/cli: files attribute must be specified in /usr/local/lib/node_modules/@titan-suite/cli/package.json
This seems to be of interest. You might wanna focus on it first.
The build folder is created only after deploying. I've just tested the command on a fresh install on a new system without getting an error. What version of node and npm are you running?
The build folder is created only after deploying. I've just tested the command on a fresh install on a new system without getting an error. What version of node and npm are you running?
They are mentioned in the opening post. I'll try deploying and a few other things later today, and get back to you.
Meanwhile, why do you need aion node to be running for compilation and why are build files not generated on compilation?
Deploying didn't work either. Here are the logs
aion dApp/titan-default$ titan deploy contracts/Example.sol (node:3689) Error Plugin: @titan-suite/cli: files attribute must be specified in /usr/local/lib/node_modules/@titan-suite/cli/package.json module: @oclif/config@1.7.6 plugin: @titan-suite/cli root: /usr/local/lib/node_modules/@titan-suite/cli See more details with DEBUG= (node:3689) Error Plugin: @oclif/plugin-help: files attribute must be specified in /usr/local/lib/node_modules/@titan-suite/cli/node_modules/@oclif/plugin-help/package.json module: @oclif/config@1.7.6 plugin: @oclif/plugin-help root: /usr/local/lib/node_modules/@titan-suite/cli/node_modules/@oclif/plugin-help See more details with DEBUG= ? Choose a contract to deploy (Use arrow keys) (node:3689) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined at ListPrompt.getCurrentValue (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/inquirer/lib/prompts/list.js:121:53) at MapSubscriber._next (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/rxjs/internal/operators/map.js:49:35) at MapSubscriber.Subscriber.next (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/rxjs/internal/Subscriber.js:68:18) at TakeSubscriber._next (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/rxjs/internal/operators/take.js:54:30) at TakeSubscriber.Subscriber.next (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/rxjs/internal/Subscriber.js:68:18) at Interface.handler (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/rxjs/internal/observable/fromEvent.js:22:28) at emitOne (events.js:121:20) at Interface.emit (events.js:211:7) at Interface._onLine (readline.js:282:10) at Interface._line (readline.js:631:8) (node:3689) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:3689) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
and
aion dApp/titan-default$ titan deploy (node:3717) Error Plugin: @titan-suite/cli: files attribute must be specified in /usr/local/lib/node_modules/@titan-suite/cli/package.json module: @oclif/config@1.7.6 plugin: @titan-suite/cli root: /usr/local/lib/node_modules/@titan-suite/cli See more details with DEBUG= (node:3717) Error Plugin: @oclif/plugin-help: files attribute must be specified in /usr/local/lib/node_modules/@titan-suite/cli/node_modules/@oclif/plugin-help/package.json module: @oclif/config@1.7.6 plugin: @oclif/plugin-help root: /usr/local/lib/node_modules/@titan-suite/cli/node_modules/@oclif/plugin-help See more details with DEBUG= TypeError: Cannot read property 'endsWith' of undefined at contractPath (/usr/local/lib/node_modules/@titan-suite/cli/lib/utils/index.js:34:35) at Object.exports.readContract (/usr/local/lib/node_modules/@titan-suite/cli/lib/utils/index.js:38:47) at Deploy.
(/usr/local/lib/node_modules/@titan-suite/cli/lib/commands/deploy.js:74:33) at Generator.next ( ) at /usr/local/lib/node_modules/@titan-suite/cli/node_modules/tslib/tslib.js:107:75 at new Promise ( ) at Object.__awaiter (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/tslib/tslib.js:103:16) at Deploy.run (/usr/local/lib/node_modules/@titan-suite/cli/lib/commands/deploy.js:72:24) at Deploy._run (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/@oclif/command/lib/command.js:29:31) at
Can you try updating npm to the latest and try again? You could test this in a docker container if you don't want to modify your global npm package.
Tried using node 10 with nvm but it didn't help. Then, I edited the package.json files that were throwing the error to add the files array as in this repo's package.json. It subdued all the errors but it still didn't compile the contracts. It was like nothing was happening when I tried compiling.
Meanwhile, why do you need aion node to be running for compilation and why are build files not generated on compilation?
AION uses Solidity version 0.4.9
and a fork of web3@0.20.x
which used to compile using web3.eth.compile.solidity
instead of solc
. They are working on upgrading their library to be compatible with web3v1.0.
It subdued all the errors but it still didn't compile the contracts. It was like nothing was happening when I tried compiling
This is strange, let's take a different approach. Try cloning this repo, then
yarn
test/contracts
folder./bin/run compile -d test/contracts/YourContract.sol
from the project rootThen let me know what happens
Then let me know what happens
Same thing. Compilation does nothing, when I try to deploy, it says select a contract but there is no contract to select from. Error pops up when i press enter
$ ./bin/run compile -d test/contracts/Example.sol
$ ./bin/run deploy test/contracts/Example.sol
? Choose a contract to deploy (Use arrow keys)
(node:7384) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined
at ListPrompt.getCurrentValue (/home/max/aion/cli/node_modules/inquirer/lib/prompts/list.js:121:53)
at MapSubscriber._next (/home/max/aion/cli/node_modules/rxjs/internal/operators/map.js:49:35)
at MapSubscriber.Subscriber.next (/home/max/aion/cli/node_modules/rxjs/internal/Subscriber.js:68:18)
at TakeSubscriber._next (/home/max/aion/cli/node_modules/rxjs/internal/operators/take.js:54:30)
at TakeSubscriber.Subscriber.next (/home/max/aion/cli/node_modules/rxjs/internal/Subscriber.js:68:18)
at Interface.handler (/home/max/aion/cli/node_modules/rxjs/internal/observable/fromEvent.js:22:28)
at Interface.emit (events.js:187:15)
at Interface.EventEmitter.emit (domain.js:442:20)
at Interface._onLine (readline.js:290:10)
at Interface._line (readline.js:638:8)
(node:7384) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7384) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
btw, here is the titanrc file I am using
module.exports = {
"host": "http://127.0.0.1",
"port": 8545,
"defaultAccount": "",
"password": "PLAT4life"
}
I don't exactly remember where I got it from. I don't even remember setting a password to be honest. I am running a local private node. removing the default password changes nothing.
What does your contract look like?
I ran yarn test and all tests failed
titan$ yarn test
yarn run v1.9.4
$ titan test
a] Compile and deploy
1) should compile contract
2) should deploy contract
b] Test contract function
3) should return 10
0 passing (1s)
3 failing
1) a] Compile and deploy
should compile contract:
TypeError: Cannot read property 'info' of undefined
at Context.it (test/testExample.js:28:19)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
2) a] Compile and deploy
should deploy contract:
Error: the string "unlock fail" was thrown, throw an Error :)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
3) b] Test contract function
should return 10:
TypeError: Cannot read property 'add' of undefined
at Context.it (test/testExample.js:48:24)
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Have you been able to connect to your node and deploy contracts there through other means?
What happens when you do titan console
or even ./bin/run console
?
What happens when you do
titan console
or even./bin/run console
?
$ titan console
(node:11966) Error Plugin: @titan-suite/cli: files attribute must be specified in /usr/local/lib/node_modules/@titan-suite/cli/package.json
module: @oclif/config@1.7.6
plugin: @titan-suite/cli
root: /usr/local/lib/node_modules/@titan-suite/cli
See more details with DEBUG=*
(node:11966) Error Plugin: @oclif/plugin-help: files attribute must be specified in /usr/local/lib/node_modules/@titan-suite/cli/node_modules/@oclif/plugin-help/package.json
module: @oclif/config@1.7.6
plugin: @oclif/plugin-help
root: /usr/local/lib/node_modules/@titan-suite/cli/node_modules/@oclif/plugin-help
See more details with DEBUG=*
console@http://127.0.0.1:8545$ web3.version.ethereum
'0'
console@http://127.0.0.1:8545$ web3.isConnected()
true
console@http://127.0.0.1:8545$ web3.currentProvider
HttpProvider { host: 'http://127.0.0.1:8545', timeout: 0 }
console@http://127.0.0.1:8545$ web3.eth.getCompilers()
[ 'solidity' ]
console@http://127.0.0.1:8545$ web3.eth.compile.solidity("contract Test { uint8 a; }")
Error: Internal error
at Object.InvalidResponse (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/aion-web3/lib/web3/errors.js:38:16)
at RequestManager.send (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/aion-web3/lib/web3/requestmanager.js:61:22)
at Object.send [as solidity] (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/aion-web3/lib/web3/method.js:145:58)
console@http://127.0.0.1:8545$ web3.eth.compile.solidity("contract Test { uint8 a; }")
{}
console@http://127.0.0.1:8545$ web3.eth.compile.solidity("contract Test { uint8 a; }")
{}
console@http://127.0.0.1:8545$ web3.eth.compile.solidity("contract Test { uint8 a; }")
{}
console@http://127.0.0.1:8545$ web3.eth.compile.solidity("contract Test { uint8 a; }")
Error: Internal error
at Object.InvalidResponse (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/aion-web3/lib/web3/errors.js:38:16)
at RequestManager.send (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/aion-web3/lib/web3/requestmanager.js:61:22)
at Object.send [as solidity] (/usr/local/lib/node_modules/@titan-suite/cli/node_modules/aion-web3/lib/web3/method.js:145:58)
console@http://127.0.0.1:8545$
If I try to compile one after another without any break, I get empty response from web3. If I wait a few seconds between the commands, I get that error. Tried with titan console and the console.js file in the aion node's web3 folder. same result. Seems like it's an issue with the node/aion's web3. commands like web3.currentProvider show that the node is connected to the console. Tried blockNumber as well and it's working.
aion-127.0.0.1:8545> web3.eth.blockNumber
948
Could this be related to https://github.com/aionnetwork/aion/issues/628?
Seems like it is.
Have you tried it on 16.04? This may be an issue with the AION node and not the cli?
Closing this due to inactivity.
OS : Ubuntu 18.04 LTS
Node : v8.10.0
Npm : 3.5.2
Commands run ./aion.sh
titan init
titan unpack
titan compile -d path/to/contracts/Example.sol
Error
Error with debug
I have tried reinstalling Titan CLI and Aion node but it didn't help.