I'm trying to use jscon-rpc but I dont get any response. After installing geth and loading the rinkeby test net does the ethereum node start ? I used "localhost" as the IP and "8545" as the port number. Have I missed out on anything? Please help
String callGeth(String inputJSON)
{
HTTPClient http;
http.begin("http://IP address of my PC(have geth running) :8545/");
http.addHeader("Content-Type", "application/json");
int httpCode = http.POST(inputJSON);
String JSONResult = http.getString();
Serial.println(JSONResult);
http.end();
return JSONResult;
}
StaticJsonBuffer<1000> JSONbuffer;
JsonObject& gethQueryJSON = JSONbuffer.createObject();
gethQueryJSON["jsonrpc"] = "2.0";
gethQueryJSON["method"] = "eth_call";
JsonArray& gethQueryParams = gethQueryJSON.createNestedArray("params");
JsonObject& gethCallParams = JSONbuffer.createObject();
gethCallParams["to"] = "0xC2eafE628dB80634Fdd657965B38136Ec6F3338A";
gethCallParams["data"] = "0x9de4d683";
gethQueryParams.add(gethCallParams);
gethQueryParams.add("account3");
gethQueryJSON["id"] = 1;
String gethStringJSON;
gethQueryJSON.printTo(gethStringJSON);
Serial.println("First Geth query JSON message isLightTurnedOn function: ");
Serial.println(gethStringJSON);
String gethResult = callGeth(gethStringJSON);
Serial.println(gethResult);
geth
on an Arduino?