Code Monkey home page Code Monkey logo

cli-app's People

Contributors

goligo avatar heinrichreimer avatar mark-bradshaw avatar pkallos avatar plenarius avatar tomriedl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli-app's Issues

local POW

Hello,
would it be possible for you to add some local pow processing so that we can connect to any type of nodes (doing pow, or not) and always be successful with any transfer request ?
tks
rgds

Error: Request Error: Invalid transaction hash on address generate and transfer

It appears the issue is still present or happened again in iota.lib.js ~0.4.6 that is currently installed.

iota (http://localhost:14265 ✓) 100ι : address
One minute while we generate the address.
The address is XXXXXXXXXXXXXXXXXXXX
Now we will register that address into the iota tangle.  One moment.
Error: Request Error: Invalid transaction hash

nodeinfo

nodeinfo
appName:                            IRI
appVersion:                         1.4.2.4
jreAvailableProcessors:             2
jreFreeMemory:                      498873440
jreVersion:                         1.8.0_162
jreMaxMemory:                       5176295424
jreTotalMemory:                     1635254272
latestMilestone:                    EEEEIFMPUBAZSMF9NXWVRPLXYWQLQFDKSXPOCSXDMAOINHPDY9ZPPQTAROCWBBIYGOLD9FVNVPVG99999
latestMilestoneIndex:               438518
latestSolidSubtangleMilestone:      EEEEIFMPUBAZSMF9NXWVRPLXYWQLQFDKSXPOCSXDMAOINHPDY9ZPPQTAROCWBBIYGOLD9FVNVPVG99999
latestSolidSubtangleMilestoneIndex: 438518
neighbors:                          7
packetsQueueSize:                   0
time:                               1525442069156
tips:                               5061
transactionsToRequest:              0

In IRI log I can see this:

May 04 15:46:47 CX31E iri[1519]: 05/04 15:46:47.667 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
May 04 15:46:47 CX31E iri[1519]: 05/04 15:46:47.668 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 6
May 04 15:46:48 CX31E iri[1519]: 05/04 15:46:48.874 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
May 04 15:46:48 CX31E iri[1519]: 05/04 15:46:48.875 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 24
May 04 15:46:48 CX31E iri[1519]: 05/04 15:46:48.885 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
May 04 15:46:48 CX31E iri[1519]: 05/04 15:46:48.887 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 14
May 04 15:46:48 CX31E iri[1519]: 05/04 15:46:48.899 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
May 04 15:46:48 CX31E iri[1519]: 05/04 15:46:48.901 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 13
May 04 15:46:48 CX31E iri[1519]: 05/04 15:46:48.911 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
May 04 15:46:48 CX31E iri[1519]: 05/04 15:46:48.912 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 24
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.098 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: belowMaxDepth
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.098 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 1
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.102 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.102 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 12
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.118 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: transactionViewModel==extraTip
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.118 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 43
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.271 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.271 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 12
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.348 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.349 [XNIO-1 task-10] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 2
May 04 15:46:49 CX31E iri[1519]: 05/04 15:46:49.384 [XNIO-1 task-13] ERROR com.iota.iri.service.API - API Exception:
May 04 15:46:49 CX31E iri[1519]: java.lang.RuntimeException: Invalid transaction hash
May 04 15:46:49 CX31E iri[1519]:         at com.iota.iri.TransactionValidator.runValidation(TransactionValidator.java:99) ~[iri-1.4.2.4.jar:na]
May 04 15:46:49 CX31E iri[1519]:         at com.iota.iri.TransactionValidator.validate(TransactionValidator.java:109) ~[iri-1.4.2.4.jar:na]
May 04 15:46:49 CX31E iri[1519]:         at com.iota.iri.service.API.attachToTangleStatement(API.java:992) [iri-1.4.2.4.jar:na]
May 04 15:46:49 CX31E iri[1519]:         at com.iota.iri.service.API.process(API.java:244) [iri-1.4.2.4.jar:na]
May 04 15:46:49 CX31E iri[1519]:         at com.iota.iri.service.API.processRequest(API.java:184) [iri-1.4.2.4.jar:na]
May 04 15:46:49 CX31E iri[1519]:         at com.iota.iri.service.API.access$000(API.java:57) [iri-1.4.2.4.jar:na]
May 04 15:46:49 CX31E iri[1519]:         at com.iota.iri.service.API$1.handleRequest(API.java:142) [iri-1.4.2.4.jar:na]
May 04 15:46:49 CX31E iri[1519]:         at io.undertow.server.Connectors.executeRootHandler(Connectors.java:208) [iri-1.4.2.4.jar:na]
May 04 15:46:49 CX31E iri[1519]:         at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:809) [iri-1.4.2.4.jar:na]
May 04 15:46:49 CX31E iri[1519]:         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_162]
May 04 15:46:49 CX31E iri[1519]:         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_162]
May 04 15:46:49 CX31E iri[1519]:         at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162]
May 04 15:46:51 CX31E iri[1519]: 05/04 15:46:51.471 [pool-3-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 2 , toReply = 0 / totalTransactions = 2426380

Looks like the same issue as #14 that was solved in #17 but still present.

Keep a 'pending transactions' list

Instead of pausing and waiting for a long transaction to complete, put pending transactions into a waiting queue, and remove them on completion.

Show # of pending items on console command line.

Add pending command to view current pending actions.

On command completion display results to screen.

Timeout on every Request

I try to safe some funds from an used adress... but everytime i try this happens.
Any Ideas?

the transfer is made. This can take a few minutes.60
Error: Invalid Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out


nginx/1.10.3 (Ubuntu)

Request Error: COMMAND attachToTangle is not available on this node with [email protected]

Maybe related to issue #1067 for iotaledger/wallet:
After snapshot I tried to send 18 iotas with wallet 2.5.7 and got message
ERROR: PRIVATE KEY REUSE DETECTED (no pending transactions)
So I tried send same with [email protected]: and got totally different Error:
Error: Request Error: COMMAND attachToTangle is not available on this node
tried this with different nodes, always same

See session log:
iota (http://eugeneoldisoft.iotasupport.com:14265 ✓) 18ι : nodeinfo
appName: IRI
appVersion: 1.4.2.1
jreAvailableProcessors: 8
jreFreeMemory: 10014600848
jreVersion: 1.8.0_152
jreMaxMemory: 12882804736
jreTotalMemory: 12882804736
latestMilestone: CDVIOZTYVXZNCNZUJWYHVMRVQNYWIMLEZNFBTDHUEBOSZIMVUWKXRJKFYFYH9ZDOWEDRXSQOQRFUA9999
latestMilestoneIndex: 338717
latestSolidSubtangleMilestone: CDVIOZTYVXZNCNZUJWYHVMRVQNYWIMLEZNFBTDHUEBOSZIMVUWKXRJKFYFYH9ZDOWEDRXSQOQRFUA9999
latestSolidSubtangleMilestoneIndex: 338717
neighbors: 8
packetsQueueSize: 0
time: 1517255848741
tips: 8955
transactionsToRequest: 9

iota (http://eugeneoldisoft.iotasupport.com:14265 ✓) 18ι : balance
One moment while we collect the data.
Your current balance is 18ι.
iota (http://eugeneoldisoft.iotasupport.com:14265 ✓) 18ι : transfer xxx 18
One moment while the transfer is made. This can take a few minutes.
Error: Request Error: COMMAND attachToTangle is not available on this node
iota (http://eugeneoldisoft.iotasupport.com:14265 ✓) 18ι 👍

changing to another node https://iotanode.us:443 it did work with cli, but NOT with light wallet
So how could the enduser understand this behaviour?

(^C again to quit) not working

When pressing ctrl-c repeatedly the prompt "(^C again to quit)" just keeps appearing and the application does not quit.

"address" command causes "Invalid transaction hash" every time

Whenever I enter "address" into iota-cli, I get

iota (http://localhost:14265 ✓) 13Mι : address
One minute while we generate the address.
The address is 99WJLKDMXJULBKIJNGVBKKYPSFYLKMQGUFTYWGKBEZIUCYEXIYNDLJSUKS9QOFIM9GRNTNMG9RBANNZBGG99LAWIZH
Now we will register that address into the iota tangle. One moment.
Error: Request Error: Invalid transaction hash

IRI log file shows

08/09 01:59:49.364 [XNIO-1 task-57] ERROR com.iota.iri.service.API - API Exception:
java.lang.RuntimeException: Invalid transaction hash
at com.iota.iri.TransactionValidator.runValidation(TransactionValidator.java:90) ~[iri-1.3.0.jar:na]
at com.iota.iri.TransactionValidator.validate(TransactionValidator.java:96) ~[iri-1.3.0.jar:na]
at com.iota.iri.service.API.attachToTangleStatement(API.java:762) [iri-1.3.0.jar:na]
at com.iota.iri.service.API.process(API.java:219) [iri-1.3.0.jar:na]
at com.iota.iri.service.API.processRequest(API.java:156) [iri-1.3.0.jar:na]
at com.iota.iri.service.API.access$000(API.java:80) [iri-1.3.0.jar:na]
at com.iota.iri.service.API$1.handleRequest(API.java:144) [iri-1.3.0.jar:na]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:208) [iri-1.3.0.jar:na]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:809) [iri-1.3.0.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]

Selected node should be saved

Actual behavior:

  • The set node with the node command is only selected for the time the application is running
  • If you exit the application and start it again the node is set to the default http://localhost:14265

Better behavior:

  • If you set a node through the node command it should be stored
  • After restarting the application should use the stored node

Node command doesn't accept URLs with hyphens anymore

Since at least c9064f1 URLS with hyphens get truncated, it seems.

> node iota-node.phibit.io
# This may take a few seconds for a remote node.  Did you turn on remote access?
iota (http://iota:14265 disconnected) >

Possibly introduced in 928b032 ?

Might be helpful to start building out unit test, do you have a nodejs framework of preference?

Replay failed transactions

Allow transactions to get replayed 2 additional times to make a best effort at getting them confirmed. If a transaction is waiting more than 10 minutes, replay.

This will follow #7

SyncAll only generates 10 addresses at a time

SyncAll will only generate 10 addresses before you have to go into the config and increase the starting number by 10. This makes the process of syncing a wallet that has hundreds of addresses over time very slow and tedious.

Error on Run

I'm getting this error when trying to run this:

/usr/local/lib/node_modules/iota-cli-app/lib/config.js:83
  get,
     ^

SyntaxError: Unexpected token ,
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/iota-cli-app/index.js:5:16)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)```

healthcheck error

iota (http://localhost:14265 ✓): healthcheck
Free memory: ✓
Node sync: ✓
Number of neighbors (4-9): ✓
C:\Users\admin\Documents\GitHub\cli-app\lib\commands\health.js:38
neighborData.neighbors.filter(
^

TypeError: Cannot read property 'filter' of undefined
at iotajs.api.getNeighbors (C:\Users\admin\Documents\GitHub\cli-app\lib\commands\health.js:38:31)
at C:\Users\admin\Documents\GitHub\cli-app\node_modules\iota.lib.js\lib\api\api.js:353:20
at C:\Users\admin\Documents\GitHub\cli-app\node_modules\iota.lib.js\lib\api\api.js:36:20
at makeRequest.prepareResult (C:\Users\admin\Documents\GitHub\cli-app\node_modules\iota.lib.js\lib\utils\makeRequest.js:130:12)
at exports.XMLHttpRequest.request.onreadystatechange (C:\Users\admin\Documents\GitHub\cli-app\node_modules\iota.lib.js\lib\utils\makeRequest.js:61:25)
at exports.XMLHttpRequest.dispatchEvent (C:\Users\admin\Documents\GitHub\cli-app\node_modules\xmlhttprequest\lib\XMLHttpRequest.js:591:25)
at setState (C:\Users\admin\Documents\GitHub\cli-app\node_modules\xmlhttprequest\lib\XMLHttpRequest.js:610:14)
at IncomingMessage. (C:\Users\admin\Documents\GitHub\cli-app\node_modules\xmlhttprequest\lib\XMLHttpRequest.js:447:13)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

Not connecting to remote nodes

I can't seem to actually connect to any of the nodes listed on iotasupport using the node command. I can connect to those nodes using the gui wallet. The cli returns to the prompt, with the selected addresses replacing the localhost prompt, but with no change to the red "disconnected" status.

image

Crashes when issuing commands while disconnected

iota (http://localhost:14265 disconnected): nodeinfo
Error: Invalid Response: Error: connect ECONNREFUSED 127.0.0.1:14265
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:14)
/usr/local/lib/node_modules/iota-cli-app/lib/commands/nodeinfo.js:13
data.currentNodeInfo = undefined;
^

TypeError: Cannot set property 'currentNodeInfo' of null
at iotajs.api.getNodeInfo (/usr/local/lib/node_modules/iota-cli-app/lib/commands/nodeinfo.js:13:32)
at makeRequest.prepareResult (/usr/local/lib/node_modules/iota-cli-app/node_modules/iota.lib.js/lib/utils/makeRequest.js:189:12)
at exports.XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/iota-cli-app/node_modules/iota.lib.js/lib/utils/makeRequest.js:61:25)
at exports.XMLHttpRequest.dispatchEvent (/usr/local/lib/node_modules/iota-cli-app/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
at setState (/usr/local/lib/node_modules/iota-cli-app/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
at exports.XMLHttpRequest.handleError (/usr/local/lib/node_modules/iota-cli-app/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:532:5)
at ClientRequest.errorHandler (/usr/local/lib/node_modules/iota-cli-app/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:459:14)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at Socket.socketErrorListener (_http_client.js:400:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:62:8)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)

"api" command not working with parameter or passed directly

When starting the iota-cli and using the "api" command, I cannot pass the JSON as a parameter, but need to enter it separately:

iota (http://localhost:14265 ✓): api {"command": "getNodeInfo"}
Enter the command JSON: 

When trying to pass the "api" command directly as a command-line parameter to iota-cli, it does not execute, instead shows disconnection warning:

iota:/root@[23:28] # iota-cli api {"command":"getNodeInfo"} 
Running IOTA CLI v1.0.4

iota (http://localhost:14265 disconnected): 
It looks like you are not connected to an iota node.  Try "node".

iota (http://localhost:14265 disconnected): 

replay throws "Error: Request Error: Invalid trytes input"

When replaying any transaction the application throws an error:
iota (http://localhost:14265 ✓) 7ι : replay NQQQVYWBBMHOODOXXNXJRSNDNZFSRSD9CXKUISXFSHTVISUOWQNYLIRVFEHXRVNMRKAJJDXONBLA99999

Replaying transaction NQQQVYWBBMHOODOXXNXJRSNDNZFSRSD9CXKUISXFSHTVISUOWQNYLIRVFEHXRVNMRKAJJDXONBLA99999. This may take a few minutes.

Error: Request Error: Invalid trytes input

Warn if node is not up to date

When issuing certain commands with an out of sync node, either warn or refuse. For instance, balance command should warn. Transfer should refuse.

Change prompt to not show balance if the node isn't synced.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.