BitShares Forum

Other => Graveyard => KeyID => Topic started by: toast on May 03, 2014, 11:36:39 pm

Title: [CLOSED][25,000 bips] bounty: Find node.js rpc library that takes full url
Post 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:
Code: [Select]
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
Title: Re: [25,000 bips] bounty: Find node.js rpc library that takes full url
Post by: gamey on May 04, 2014, 12:28:30 am

What happens if you just append the /rpc to the host ? 
Title: Re: [25,000 bips] bounty: Find node.js rpc library that takes full url
Post by: toast on May 04, 2014, 12:32:39 am
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

Title: Re: [25,000 bips] bounty: Find node.js rpc library that takes full url
Post by: gamey on May 04, 2014, 12:44:30 am


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.
Title: Re: [25,000 bips] bounty: Find node.js rpc library that takes full url
Post by: toast on May 04, 2014, 01:11:59 am
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
Title: Re: [CLOSED][25,000 bips] bounty: Find node.js rpc library that takes full url
Post by: toast on May 10, 2014, 09:10:43 pm
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.