I try this tutorial, but look like that it’s not working correct:
ETH part start’s nice, but stops in XRP part.
I get this log in node-bob-settlement-engine-xrpl.log
2020-03-24T17:28:53.547Z settlement-xrp Generated new XRP testnet account: address=rNMGGCvhYbDDUhCVFvAnZ687FTyEPMgTVv secret=saBTrABr3DnYNgQaPJNkqsj75Z3ta 2020-03-24T17:28:55.310Z settlement-core Started settlement engine server 2020-03-24T17:29:04.170Z settlement-xrp Starting settlement: account=8579cdc0-3bf3-4952-b872-359e90a84aa0 xrp=1 2020-03-24T17:29:04.720Z settlement-xrp Failed to settle: Error fetching payment details: account=8579cdc0-3bf3-4952-b872-359e90a84aa0 xrp=1 Error: Request failed with status code 502 at createError (/usr/local/share/.config/yarn/global/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/share/.config/yarn/global/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/share/.config/yarn/global/node_modules/axios/lib/adapters/http.js:236:11) at IncomingMessage.emit (events.js:323:22) at endReadableNT (_stream_readable.js:1204:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) { config: { url: 'http://localhost:8771/accounts/8579cdc0-3bf3-4952-b872-359e90a84aa0/messages', method: 'post', data: <Buffer 7b 22 74 79 70 65 22 3a 22 70 61 79 6d 65 6e 74 44 65 74 61 69 6c 73 22 7d>, headers: { Accept: 'application/json, text/plain, */*', 'Content-Type': 'application/octet-stream', 'User-Agent': 'axios/0.19.2', 'Content-Length': 25 }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 10000, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus] }, request: ClientRequest { _events: [Object: null prototype] { socket: [Array], abort: [Function], aborted: [Function], error: [Function], timeout: [Array], prefinish: [Function: requestOnPrefinish] }, _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: null, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _readableState: [ReadableState], readable: true, _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, _writableState: [WritableState], writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular], timeout: 10000, [Symbol(asyncId)]: 104, [Symbol(kHandle)]: [TCP], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: Timeout { _idleTimeout: 10000, _idlePrev: [TimersList], _idleNext: [TimersList], _idleStart: 20775, _onTimeout: [Function: bound ], _timerArgs: undefined, _repeat: null, _destroyed: false, [Symbol(refed)]: false, [Symbol(asyncId)]: 112, [Symbol(triggerId)]: 110 }, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0 }, connection: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _readableState: [ReadableState], readable: true, _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, _writableState: [WritableState], writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular], timeout: 10000, [Symbol(asyncId)]: 104, [Symbol(kHandle)]: [TCP], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: Timeout { _idleTimeout: 10000, _idlePrev: [TimersList], _idleNext: [TimersList], _idleStart: 20775, _onTimeout: [Function: bound ], _timerArgs: undefined, _repeat: null, _destroyed: false, [Symbol(refed)]: false, [Symbol(asyncId)]: 112, [Symbol(triggerId)]: 110 }, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0 }, _header: 'POST /accounts/8579cdc0-3bf3-4952-b872-359e90a84aa0/messages HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'Content-Type: application/octet-stream\r\n' + 'User-Agent: axios/0.19.2\r\n' + 'Content-Length: 25\r\n' + 'Host: localhost:8771\r\n' + 'Connection: close\r\n' + '\r\n', _onPendingData: [Function: noopPendingOutput], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object], requests: {}, sockets: [Object], freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'POST', insecureHTTPParser: undefined, path: '/accounts/8579cdc0-3bf3-4952-b872-359e90a84aa0/messages', _ended: true, res: IncomingMessage { _readableState: [ReadableState], readable: false, _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, socket: [Socket], connection: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, headers: [Object], rawHeaders: [Array], trailers: {}, rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 502, statusMessage: 'Bad Gateway', client: [Socket], _consuming: false, _dumped: false, req: [Circular], responseUrl: 'http://localhost:8771/accounts/8579cdc0-3bf3-4952-b872-359e90a84aa0/messages', redirects: [], [Symbol(kCapture)]: false }, aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, _redirectable: Writable { _writableState: [WritableState], writable: true, _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, _options: [Object], _redirectCount: 0, _redirects: [], _requestBodyLength: 25, _requestBodyBuffers: [], _onNativeResponse: [Function], _currentRequest: [Circular], _currentUrl: 'http://localhost:8771/accounts/8579cdc0-3bf3-4952-b872-359e90a84aa0/messages', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], 'content-type': [Array], 'user-agent': [Array], 'content-length': [Array], host: [Array] } }, response: { status: 502, statusText: 'Bad Gateway', headers: { 'content-type': 'application/problem+json', 'content-length': '233', date: 'Tue, 24 Mar 2020 17:29:04 GMT' }, config: { url: 'http://localhost:8771/accounts/8579cdc0-3bf3-4952-b872-359e90a84aa0/messages', method: 'post', data: <Buffer 7b 22 74 79 70 65 22 3a 22 70 61 79 6d 65 6e 74 44 65 74 61 69 6c 73 22 7d>, headers: [Object], transformRequest: [Array], transformResponse: [Array], timeout: 10000, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus] }, request: ClientRequest { _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: null, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Socket], connection: [Socket], _header: 'POST /accounts/8579cdc0-3bf3-4952-b872-359e90a84aa0/messages HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'Content-Type: application/octet-stream\r\n' + 'User-Agent: axios/0.19.2\r\n' + 'Content-Length: 25\r\n' + 'Host: localhost:8771\r\n' + 'Connection: close\r\n' + '\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, method: 'POST', insecureHTTPParser: undefined, path: '/accounts/8579cdc0-3bf3-4952-b872-359e90a84aa0/messages', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, _redirectable: [Writable], [Symbol(kCapture)]: false, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] }, data: { type: 'about:blank', title: 'Error sending message to peer engine', status: 502, detail: 'Error sending message to peer settlement engine. Packet rejected with code: F02, message: ', datetime: '2020-03-24T20:29:04.719047197+03:00' } }, isAxiosError: true, toJSON: [Function] } 2020-03-24T17:29:04.737Z settlement-core Settlement completed: leftover=1 settled=0 amountToSettle=1 account=8579cdc0-3bf3-4952-b872-359e90a84aa0
And account balance after try look’s like this:
$ ilp-cli pay alice --auth alice_password \ > --amount 500 \ > --to http://localhost:9770/accounts/charlie/spsp {"delivered_amount":424495,"destination_asset_code":"XRP","destination_asset_scale":6,"from":"example.alice","in_flight_amount":0,"sent_amount":500,"source_amount":500,"source_asset_code":"ETH","source_asset_scale":6,"to":"example.bob.charlie.tP57c3HETEpqzRQISxYtTfvS"} $ sleep 2 $ ilp-cli accounts balance alice {"asset_code":"ETH","balance":-0.0005} $ ilp-cli accounts balance bob {"asset_code":"ETH","balance":0.0} $ ilp-cli --node http://localhost:8770 accounts balance alice --auth hi_bob {"asset_code":"ETH","balance":0.0} $ ilp-cli --node http://localhost:8770 accounts balance charlie --auth hi_bob {"asset_code":"XRP","balance":-0.575505} $ ilp-cli --node http://localhost:9770 accounts balance bob --auth hi_charlie {"asset_code":"XRP","balance":0.0} $ ilp-cli --node http://localhost:9770 accounts balance charlie --auth hi_charlie {"asset_code":"XRP","balance":0.0}