Bitcoin Forum
December 08, 2019, 06:44:04 PM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: websocket node access: gauging intrest  (Read 77 times)
mocacinno
Legendary
*
Offline Offline

Activity: 1792
Merit: 1850


https://unblur.ninja =>lightning network testsite


View Profile WWW
November 05, 2018, 01:57:07 PM
Last edit: November 06, 2018, 09:57:24 AM by mocacinno
Merited by HeRetiK (1)
 #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

1575830644
Hero Member
*
Offline Offline

Posts: 1575830644

View Profile Personal Message (Offline)

Ignore
1575830644
Reply with quote  #2

1575830644
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1575830644
Hero Member
*
Offline Offline

Posts: 1575830644

View Profile Personal Message (Offline)

Ignore
1575830644
Reply with quote  #2

1575830644
Report to moderator
1575830644
Hero Member
*
Offline Offline

Posts: 1575830644

View Profile Personal Message (Offline)

Ignore
1575830644
Reply with quote  #2

1575830644
Report to moderator
1575830644
Hero Member
*
Offline Offline

Posts: 1575830644

View Profile Personal Message (Offline)

Ignore
1575830644
Reply with quote  #2

1575830644
Report to moderator
Kouiao
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
November 05, 2018, 03:06:43 PM
 #2

What stack are your WS implementation ? Do you need help with development ?
mocacinno
Legendary
*
Offline Offline

Activity: 1792
Merit: 1850


https://unblur.ninja =>lightning network testsite


View Profile WWW
November 06, 2018, 07: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.


HeRetiK
Legendary
*
Offline Offline

Activity: 1316
Merit: 1187


the forkings will continue until morale improves


View Profile
November 06, 2018, 09:51:49 AM
Merited by mocacinno (1)
 #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")

mocacinno
Legendary
*
Offline Offline

Activity: 1792
Merit: 1850


https://unblur.ninja =>lightning network testsite


View Profile WWW
November 06, 2018, 09:56:00 AM
Last edit: November 06, 2018, 10:46:21 AM by mocacinno
 #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).

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!