2

I'm developing a web app that uses app engine (java) as a backend. I need the backend to listen for received transactions and broadcast transactions on the bitcoin network. I have bitcoinj set up to handle this functionality but I can't seem to get the blockstore object initialize.

Bitcoinj allows me to use mysql to store blocks. The connection is set up like this:

public static void getBlockStore(){

    int fullStoreDepth = 1000;
    String db = "databasename";
    String un = "root";
    String pw = "";
    String host = "/cloudsql/database-instance-id";//I have also used the ip address, but it didn't work

    try {
        blockStore = new MySQLFullPrunedBlockStore(network, fullStoreDepth, host, db, un, pw);

        logger.info("Blockstore created is " + blockStore);
    } catch (BlockStoreException e) {
        logger.info("Blockstore error " + e);
    }

}

But in the backend I receive a connection error when trying to connect to my database. I don't have or don't know which port to connect to. The other information is all correct. I have tried with another mysql db from godaddy but I got the same error.

How can I get connected to a mysql database either in cloud sql or a normal mysql database?

kreshendo
  • 384
  • 2
  • 18

0 Answers0