-
Notifications
You must be signed in to change notification settings - Fork 199
"ERROR: Bad Request" when trying to transact with deployed SimpleStorage contract #39
Comments
@raymond00000 I've yet to look into these issues, but from your screens above: |
Yes, I also found I input wrong and retried, but I didn't take a new pic. But there was same error. Dear @fixanoid , can you look into this issue, and provide a set of correct input that can be "transacted" successfully? Many thanks for your help. |
FWIW, I tried without putting anything in the PrivateFor field, too. Same issue. |
(Actually, I also tested a bit more, and in the "API" menu of cakeshop, I got this contract lookup request sample: curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"id":"0xce4815e2c820a8e273206d43d77a7da481c03d61"}' 'http://localhost:8080/cakeshop/api/contract/get' But there was very slow and finally returned error: { |
Gentlemen, if you could please clarify a thing for me:
Thanks! |
We used pre-release version, I just tried the Cakeshop v0.9.1, it works fine. "Did the issue occur while working with a private instance of contract or public?" How can I check this info? Sorry, and thanks for help. |
But i tested with Cakeshop v0.9.1. It ran the simple storage example, and it seems all users can read the same storage value. It was fine to enter anything to the privatefor field to change the value. |
This issue is now resolved, please pull and rebuild or download new release from: https://github.com/jpmorganchase/cakeshop/releases Please validate. Thank you! |
I tried the new "fixed" version (downloaded from release page, "updated 14 July"), but I still got an error like below: The console log is: [DEBUG] 2017-07-17 09:28:53.241 [StreamLogAdapter] geth - I0717 09:28:53.241678 internal/ethapi/api.go:1263] Tx(e30e78265f540349f06fda40567cfbd380270b229644e426c8c376cfd1129cf3) to: &0000000000000000000000000000000000000020 |
Hi - please can your try deploy the contract as a public contract and then send the set() tx as a public tx (i.e. in both cases do not populate the privateFor array). This looks like a constellation connectivity issue so want to confirm that. Thanks. |
sure i can try it, but how to "deploy the contract as a public contract "? Thanks. |
Just don't populate the privateFor field. |
@raymond00000, theres a lot of work left to be done on our: the Cakeshop API/UI errors should be clearer and I'll work on improving that in the next few weeks. In the mean time, there are some rules for using Cakeshop/Quorum when working with contracts:
|
Hi @fixanoid Thanks for update. I was working on other tasks, I will resume trying Cakeshop now. I think the simplest test case is: private transaction from node 1 to node7 with default private contract: SimpleStorage. I tried to match the parameters: But still, I got error, I just would like to know what are the correct value that I can run the transact operation of "SimpleStorage" successfully on cakeshop? Or reply a "Not now" so I will stop trying until the bug is fixed. Many thanks for clarification. |
@raymond00000 Hey, I'm around and the functionality in question works fine on my PC. That said, you need to clarify a whole bunch of things for me before I can give you the right answer. Some setup questions:
Most of these questions could be answered by looking into the dashboard |
thanks for reply. What I did is: Download latest version released 14 july. Select the: simpleContract. Please kindly let me know any extra steps I missed. |
I see. With the setup you made, you are running a single node that is not connected to any other nodes. In such setup, you are not going to be able to create a private contract -- for that, you need at least 2 nodes. As I reported above, the errors are very confusing right now, so when you submit a key constellation knows nothing about, you get a generic error -- that the case you've ran into. To test out being able to create and communicate via a private contract, you need to spin up multiple cakeshop nodes. Here's how you would set it up on a single machine:
This is a pretty lengthy thing, @tylobban may be a video would be useful for something like this might be in order? |
@fixanoid Thanks a lot, I will try tmr, as it is mid-night already. I will update after trying. @tylobban It will be excellent if there is a video to follow, will be very helpful to beginners. Thanks in advance. Besides, I guess one issue is about Quickstart section, to me, it seems hint this: just run cakeshop.jar and everything is ready. Thanks a lot. |
@fixanoid I tried to follow the step, but on this step: edit applications.properties for every setup directory and change these props to be different for every node (I generally just increase the last digit by 1): geth.url, geth.node.port, and a system variable: geth.constellaiton.url (notice misspelling, constellation URL should be of as such: -Dgeth.constellaiton.url=http://127.0.0.1:9000) I cannot find the system variable, inside "applications.properties", or "printenv". Thanks. |
still cannot find geth.constellaiton.url, I guess I just one step away from successful deployment, much appreciated for help, plz. |
Hi , Error: Non-200 status code: &{Status:400 Bad Request StatusCode:400 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Date:[Tue, 17 Apr 2018 09:46:08 GMT] Server:[Warp/3.2.12]] Body:0xc42776efc0 ContentLength:-1 TransferEncoding:[chunked] Close:false Uncompressed:false Trailer:map[] Request:0xc424d851d0 TLS:} Could you please provide any solution for this. Thanks in advance. |
Description of problem
Deployed a copy of SimpleStorage contract, but was unable to write a value with set() method. Browser throws an error that says "ERROR: Bad Request".
Note: I was able to manually run the set() method (setting value to 99) within geth (noting the contract address and ABI from info supplied in Cakeshop):
var address = "0x341ed42cdfb13b897a198cd1c87ddf070e25e6a1";
var abi = [{"constant":true,"inputs":[],"name":"storedData","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initVal","type":"uint256"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"message","type":"string"},{"indexed":false,"name":"newVal","type":"uint256"}],"name":"Change","type":"event"}];
var storage = eth.contract(abi).at(address);
storage.set(99,{from:eth.coinbase});
Expected behavior
Set variable to int.
Actual behavior
Variable remains set to 0.
Steps to reproduce the behavior
Deploy SimpleStorage contract
Enter value for set and press Transact
System information
Cakeshop version or commit hash: Cakeshop 0.10.0 Build ce816b1
Cakeshop runtime configuration: Attached to 7nodes example
Geth/Quorum version testing against: 1.5.0-unstable
Cakeshop OS & Version: Linux
Browser OS & Version: Linux (Ubuntu 16.04 LTS) Chrome 57.0.2987.133 (64-bit)
Backtrace/logs
Console outputs:
[WARN ] 2017-07-05 15:28:02.295 [qtp133124661-187] BaseController - Caught exception: Too few arguments: 0 < 1
com.jpmorgan.cakeshop.error.ABIException: Too few arguments: 0 < 1
at com.jpmorgan.cakeshop.model.ContractABI$Entry$Param.encodeList(ContractABI.java:146) ~[cakeshop-abi-0.10.0.jar!/:?]
at com.jpmorgan.cakeshop.model.ContractABI$Function.encode(ContractABI.java:333) ~[cakeshop-abi-0.10.0.jar!/:?]
at com.jpmorgan.cakeshop.model.ContractABI$Function.encodeAsHex(ContractABI.java:329) ~[cakeshop-abi-0.10.0.jar!/:?]
at com.jpmorgan.cakeshop.model.TransactionRequest.toGethArgs(TransactionRequest.java:65) ~[classes!/:?]
at com.jpmorgan.cakeshop.service.impl.ContractServiceImpl.transact(ContractServiceImpl.java:301) ~[classes!/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) ~[spring-aop-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ~[spring-aop-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at com.sun.proxy.$Proxy112.transact(Unknown Source) ~[?:?]
at com.jpmorgan.cakeshop.controller.ContractController$1.call(ContractController.java:180) ~[classes!/:?]
at com.jpmorgan.cakeshop.controller.ContractController$1.call(ContractController.java:172) ~[classes!/:?]
at org.springframework.web.context.request.async.WebAsyncManager$4.run(WebAsyncManager.java:317) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_131]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
The text was updated successfully, but these errors were encountered: