Error trying to run the client
hernandp opened this issue · comments
I followed your instructions for a first experimentation with Machinomy at https://machinomy.com/ but client.js throw an error:
sender address 0x19478216c30c1dd68dea03b138bf466919ae369d
info:ChannelEthContract Creating channel. Value: 10000 / Settlement: 172800 +0ms
Error: insufficient funds for gas * price + value
at /Users/coinfabrik/src/machinomy/node_modules/web3-provider-engine/subproviders/provider.js:19:36
at XMLHttpRequest.request.onreadystatechange (/Users/coinfabrik/src/machinomy/node_modules/web3/lib/web3/httpprovider.js:128:7)
at XMLHttpRequestEventTarget.dispatchEvent (/Users/coinfabrik/src/machinomy/node_modules/xhr2/lib/xhr2.js:64:18)
at XMLHttpRequest._setReadyState (/Users/coinfabrik/src/machinomy/node_modules/xhr2/lib/xhr2.js:354:12)
at XMLHttpRequest._onHttpResponseEnd (/Users/coinfabrik/src/machinomy/node_modules/xhr2/lib/xhr2.js:509:12)
at IncomingMessage.<anonymous> (/Users/coinfabrik/src/machinomy/node_modules/xhr2/lib/xhr2.js:469:24)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
Any help is appreciated, thanks. Maybe this is related to Infura ?
Looks like the account doesn't have any Ether? If that's your problem, you can go here:
http://faucet.ropsten.be:3001/
Got it. Instructions were pointing provider to Rinkeby. Feeding address with some ETH cleared the error. But now this is where it's stopping:
sender address 0x19478216c30c1dd68dea03b138bf466919ae369d
info:ChannelEthContract Creating channel. Value: 10000 / Settlement: 172800 +0ms
info:ChannelEthContract Fetching state for channel 0x35e289c8036f48189bd9b59b81a51f5d00000000000000000000000000000000 +31s
TypeError: this.channelsDao.firstById is not a function
at ChannelContract.getContractByChannelId (/Users/coinfabrik/src/machinomy/packages/machinomy/lib/ChannelContract.js:67:48)
at ChannelContract.channelById (/Users/coinfabrik/src/machinomy/packages/machinomy/lib/ChannelContract.js:60:37)
at ChannelManager.channelById (/Users/coinfabrik/src/machinomy/packages/machinomy/lib/ChannelManager.js:105:55)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Can confirm this error, which I think is new since the update to support ERC-20s.
Further errors are shown, in this case from a fresh Linux box.
hernandp@hernandp-virtual-machine:~/machinomy$ DEBUG=* node packages/examples/src/client.js
sender address 0x19478216c30c1dd68dea03b138bf466919ae369d
info:ChannelEthContract Fetching state for channel 0x3660102c7a1d4ea38013e5d6ec3cff5b00000000000000000000000000000000 +0ms
info:ChannelEthContract Fetching state for channel 0x3660102c7a1d4ea38013e5d6ec3cff5b00000000000000000000000000000000 +2s
info:ChannelEthContract Fetching state for channel 0x3660102c7a1d4ea38013e5d6ec3cff5b00000000000000000000000000000000 +2s
info:ChannelEthContract Fetching state for channel 0x3660102c7a1d4ea38013e5d6ec3cff5b00000000000000000000000000000000 +2s
info:Client Attempting to send payment to https://hub.playground.machinomy.com/payments/accept. Sender: 0x19478216c30c1dd68dea03b138bf466919ae369d / Receiver: 0xf4222acef04d86f7304b8364734f22c00108d0cd / Amount: 1000 +0ms
{ FetchError: invalid json response body at https://hub.playground.machinomy.com/payments/accept reason: Unexpected token < in JSON at position 0
at /home/hernandp/machinomy/node_modules/node-fetch/lib/index.js:254:32
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
message: 'invalid json response body at https://hub.playground.machinomy.com/payments/accept reason: Unexpected token < in JSON at position 0',
type: 'invalid-json' }
Let me know if you want any additional detail.
@hernandp Working on the fix. Currently it looks like this image:
Fixed in Machinomy v1.12.5 and e03ab37
Client.js now works as expected. Thank you very much.
Fixed.