BitShares Forum
Other => Graveyard => KeyID => Topic started by: toast on May 03, 2014, 11:36:39 pm
-
Banging my head against a silly task...
https://github.com/nmushegian/dnschain/blob/master/src/lib/nmc.coffee#L33
@peer is defined here:
https://github.com/nmushegian/dnschain/blob/master/src/lib/nmc.coffee#L23
Notice you give a host and a port separately (they are defined here, but there's no way to specify "/rpc"! https://github.com/nmushegian/dnschain/blob/master/src/lib/config.coffee#L57)
Here is how to test the interface with curl:
curl --user user --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": [] }' http://127.0.0.1:9989/rpc
Here's a 5 minute setup guide to have both .p2p and DNSchain running:
https://github.com/nmushegian/dns/blob/master/setup.md
-
What happens if you just append the /rpc to the host ?
-
It doesn't work. Hard to debug because it just gives you 'undefined' for any sort of error. No documentation anywhere. Nodejs is a baby
Sent from my SCH-I535 using Tapatalk
-
Hmmm. Maybe URLs aren't part of json/rpc ? So you need to wrap a http lib (request) around the json-rpc ?
I mean it is remote procedure call.. Nothing there really suggests a URL. All the code I am working on with that has the same approach.
BTW, if you ever think nodejs seems like a good all purpose language to write regular code with nested loops... Think long and hard before you go down that path. I have been using nodejs on a project and it is great for servers, but then we started using it for tools and oh Lord what a headache.
-
It's someone else's tool, it's a DNS server that can look things up on a blockchain. Both the http and non-http json rpc's are served on /rpc, or so says the client.
Here's a 5 minute setup guide to have both .p2p and DNSchain running:
https://github.com/nmushegian/dns/blob/master/setup.md
-
Closing this but giving half the bounty to Derrick S because he did a bit of work towards this and is going to be doing more with us soon.