Author Topic: [CLOSED][25,000 bips] bounty: Find node.js rpc library that takes full url  (Read 2584 times)

0 Members and 1 Guest are viewing this topic.

Offline toast

  • Moderator
  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
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.
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline toast

  • Moderator
  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
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
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile


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.
I speak for myself and only myself.

Offline toast

  • Moderator
  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
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

Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile

What happens if you just append the /rpc to the host ? 
I speak for myself and only myself.

Offline toast

  • Moderator
  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
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
« Last Edit: May 10, 2014, 09:09:57 pm by toast »
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.