scoin / multichain-node

A simple wrapper for Multichain's JSON RPC api that parses your input.
MIT License
73 stars 54 forks source link

Having issues connecting to multichain using multichain-node #21

Closed hai-pdx closed 6 years ago

hai-pdx commented 6 years ago

I've been scratching my head on this for a few days. Hopefully someone can help.

I installed multichain-node in my project using: npm install multichain-node -save

In my .js code, I'm trying to test the connection. I have:


let multichain = require("multichain-node")({
    port: 2780,
    host: '192.168.110.76',
    user: "multichainrpc",
    pass: "xxxx"
});

multichain.getInfo((err, info) => {
    if(err){
        throw err;
    }
    console.log(info);
})

When I load up the page in my browsers, I'm unable to connect. I get the following error:

screen shot 2017-11-02 at 4 31 37 pm

I triple checked the rpc-port and credentials and they are set correctly. I'm also able connect running curl from the command line.

Any help is much appreciated. Thank you!

scoin commented 6 years ago

Looks like a CORS issue between the multichain server and the React preflight request. You probably want to set up a proxy.