entangled
entangled copied to clipboard
ciri: can't send transaction message from c-iota-workshop (send_hello)
Describe the bug The first example of c-iota-workshop (hello_world), which just prints out info about the server, runs fine with cIRI:
$ ./bazel-bin/examples/hello_world -h bernardoaraujor.ydns.eu -p 14265
appName cIRI-mainnet
appVersion 0.1.0-alpha
latestMilestone UNVTSIKMIQRVWVXUBTAIXVYIVNHYLFPFKZXQSGDOVKANMKCLSWFDIHVPWGNDBNGNTQMNBWX99KGJA9999
latestMilestoneIndex 1189733
milestoneStratIndex 0
neighbors 1
packetsQueueSize 0
time 1569601997498
tips 2
transactionsToRequest 7
However the second example (send_hello) doesn't work.
Here's the source code. I forked from iota-community to add CLI parameters instead of hardcoded hostname and port: https://github.com/bernardoaraujor/c-iota-workshop/blob/master/examples/e02_send_hello.c
Here's the behaviour when I execute it:
bernardo@bernardo-UX51VZA:~/dev/c-iota-workshop$ ./bazel-bin/examples/send_hello -h bernardoaraujor.ydns.eu -p 14265
send transfer HTTP service error
Transaction failed with error code: 1156
bernardo@bernardo-UX51VZA:~/dev/c-iota-workshop$ ./bazel-bin/examples/send_hello -h bernardoaraujor.ydns.eu -p 14265
send transfer IRI response:
Transaction failed with error code: 1095
And here's the error message on cIRI logs (from error 1156... error 1095 didn't show anything):
2019-09-27 18:50:24: api_http: ERR: cIRI HTTP API currently does not support parsing such large requests.
To Reproduce Steps to reproduce the behavior:
- Clone https://github.com/bernardoaraujor/c-iota-workshop
- Build examples
$ bazel build ... - Execute send_hello example:
$ ./bazel-bin/examples/send_hello -h 51.158.64.80 -p 14265 - Check cIRI logs.
Expected behavior When I point to an IRI full node, I get this response:
$ ./bazel-bin/examples/send_hello -h 185.244.195.45 -p 14265
send transfer OK
bundle hash: ZRKWZLHQSWJKDV9YBGBQZHRXFTPMOLTBBYXQCDJGSAFCJTKFSVSK9AGLVKXXQJYRGAYXGILNCBSWRSSGC
Transaction was sent.
Which is confirmed at: https://thetangle.org/address/TOKLOARHKXQCVPPVVIPIJGLUTLTKFHYGMBBLOXJFYGSARLOTYFFSDZNYCOBOCNPGRMJWZCQBNOROUCE9G
Additional context Philipp Blum (@citrullin) and I will make a presentation of IOTA on the upcoming Yocto Project Summit 2019. We want to do a live demo based on cIRI and the examples from c-iota-workshop. The presentation is scheduled for November 1st. It would be great to have all 6 examples working with cIRI until then.
the error 1156 and 1095 are reported by CClient means something wrong from the IRI.
- 1156: HTTP service error
- 1059: IRI response:
you can use error_2_string to show a readable text in your code.
https://github.com/bernardoaraujor/c-iota-workshop/blob/master/examples/e02_send_hello.c#L100
@thibault-martinez @tsvisabo
The error message is ERR: cIRI HTTP API currently does not support parsing such large requests. from cIRI's http server.
What is the limitation of requests on cIRI?
This seems to be a limitation of libmicrohttpd. A more complex architecture has to be set up to allow bigger payloads. I never like this library 😅
@thibault-martinez Are you able to do this before October 31.? We need a running cIRI in combination with CClient for the Yocto Summit. ^^
I'm not working on cIRI at all at the moment so I can't tell. I'll investigate to understand how long this task could be and I will see if it's doable any time soon.
@thibault-martinez Thanks. I will talk to Lewis about the result then. Would be nice to have a working solution for the Yocto summit. :)
Is there a way to reduce payload size from e02_send_hello.c?
Sorry I don't know, I didn't write it. @Citrullin did ?
@thibault-martinez I don't think you can reduce the size. Just a simple zero value tx with some text. But @oopsmonk is probably better in answering this.
it's just one transaction in the bundle if cIRI cannot handle it that means it cannot process any transaction requests.
@oopsmonk what's the effort estimation to enable support for transaction requests?
@bernardoaraujor the problem is caused by http implementation in cIRI, not related to libmicrohttpd. the error message does not describe the issue correctly. I think @thibault-martinez or @tsvisabo can help to solve it.