Author

Topic: websocket node access: gauging intrest (Read 218 times)

legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
November 06, 2018, 04:56:00 AM
#5
For more complex projects I'd probably run a node myself, but I'll still keep an eye on this thread to see how it evolves.

FYI:

Code:
{"method": "getlatestblock"} 

returns invalid JSON  Lips sealed

Code:
{u'merkleroot': u'ae60086ad3d9d53c3213a271c1117449f77f70d89ff7536beb194b5009a12543', u'nonce': 1580982470, [...]

(eg. u'merkleroot' should be "merkleroot")

Thanks for notifying me... It's indeed an invalid json, i'll fix it tomorrow morning Smiley

EDIT: had some time, fixed it right away! Thanks for the heads up!
BTW: it's perfectly normal to use your own node, even for smaller projects. As a matter of fact, i'd encourage anybody to use their own node. Using my service requires trust... I could easily modify the respons i send to any query, my node can lag, my node can be the victim of an attack...
That being said: i don't offer wallet services, you can't create desposit addresses, sign transactions,... By keeping these sensitive services away, i kind of mitigate the problem (afaik).

This service is just an easy sollution for anybody who wants medium-complex core functions without running core, probably even from a shared server without any functionality (you can create static pages and use javascript to communicate with an open socket, thus add dynamic functionality without any server side scripts).
legendary
Activity: 3122
Merit: 2178
Playgram - The Telegram Casino
November 06, 2018, 04:51:49 AM
#4
For more complex projects I'd probably run a node myself, but I'll still keep an eye on this thread to see how it evolves.

FYI:

Code:
{"method": "getlatestblock"} 

returns invalid JSON  Lips sealed

Code:
{u'merkleroot': u'ae60086ad3d9d53c3213a271c1117449f77f70d89ff7536beb194b5009a12543', u'nonce': 1580982470, [...]

(eg. u'merkleroot' should be "merkleroot")
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
November 06, 2018, 02:46:34 AM
#3
What stack are your WS implementation ? Do you need help with development ?

I'm actually using websocketd (http://websocketd.com/), so the language of the script itself doesn't really matter Wink
Thanks for your offer to help with the development, but at the moment i can handle it... I'm just gauging intrest to see if i'll only develop the functions i need for myself or if i need to develop the full range of functions.

newbie
Activity: 16
Merit: 0
November 05, 2018, 10:06:43 AM
#2
What stack are your WS implementation ? Do you need help with development ?
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
November 05, 2018, 08:57:07 AM
#1
I'm currently developing websocket access to some of the functions of my full node. For a small fee, a developer, site owner or private person could use a secure websocket connection to execute most of the not-wallet-related node functions. This way, he or she get access to some core functionality without having to maintain a full node, he or she can even use javascript to include functionality on webpages on very limited shared hosting formulas.

In the beginning, i was thinking about creating such a websocket daemon for private use and throw away most of the outdated code on mocacinno.com and use a websocket connection instead... However, i tought by myself: maybe somebody else would be interested in such a websocket connection to?

Without further comments, here's a dev console view of the initial test of my websocket daemon... Be advised, only a very small part of the functionality i want to include is currently included:

https://193.70.78.148:9090/node

You'll need a private key in order to complete the handshake and testdrive the websocket... If you're interested in testing it out, send me a PM and i'll give you a testkey Smiley
I've modified my code for now, anybody connected is now automatically authenticated for the time being Smiley

Currently implemented
Authentication to the websocket:
  • Starting the authentication process
  • Completing the authentication process
  • Querying the authentication status

Blockchain queries:
  • Query the current best block hash
  • Find a block using a blockhash
  • Get the latest block
  • Get blockchain info
  • Get the current block count
  • Query the blockhash for height x

Todo
Blockchain queries:
  • get getblockheader for blockhash
  • get chaintxstats
  • get current difficulty
  • get all the mempool info for a certain tx (ancestors, descendants, entry)
  • list all tx's in the mempool

Mining:
  • get block template (for whatever you'd use it)
  • get mining info
  • get network hash ps
  • submit block

Network:
  • get connection count
  • get net totals
  • get network info

Raw transactions:
  • decode raw transaction
  • decode script
  • get raw transaction
  • send raw transaction

Util:
  • estimate fee
  • estimate smart fee
  • validate address
  • verify message

Custom:
  • analyse unconfirmed transaction
  • Have a timestamped message signed by me (an independant partie)
  • Calculate optimal fee at this point in time
Jump to: