elective-stereophonic
elective-stereophonic
[ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core  
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.11.15 | Latest Experimental Nxt Client: Nxt 1.12.0e

Pages: [1] 2 3  All

Author Topic: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core  (Read 9524 times)

verymuchso

  • Hero Member
  • *****
  • Karma: +118/-2
  • Offline Offline
  • Posts: 549
    • View Profile
    • HEAT Ledger

NXT+ PROJECT SITE

http://fimkchat.com/2015/04/nxt-giving-back-in-an-open-source-way/

NXT+ is a third-party extension to NXT (currently based of version 1.5.15) initially created for FIMKrypto then backported to NXT for use in mofowallet.

Typical users of NXT+ would be technology providers who work with NXT and are looking for more or better ways of interfacing with NXT.

Potential users are exchanges, wallet creators, asset exchange automators or observers, payment processors or anyone building a business on NXT.

NXT+ adds an important missing ingredient to NXT which is realtime connectivity. Where other crypto currencies require complex third party services to enable realtime connectivity, with NXT and how it's setup (or maybe a better word would be foreseen  ;)) this can be built right into the core.

I'm a technologist and have gradually become a full-timer in NXT tech.
Hopefully NXT+ can help you with your next or current project I sure would not mind discussing it, I might even learn something from our discussions.

The plan is to keep NXT+ in sync with main NXT and update it whenever a new release comes along.

I'm very busy and have a lot of work, all eyes, help or tips with regard to the project is more than welcome.

Dirk
« Last Edit: September 07, 2015, 03:07:12 pm by verymuchso »
Logged
HEAT: DEX | SDK | HOME

yassin54

  • Hero Member
  • *****
  • Karma: +240/-14
  • Offline Offline
  • Posts: 2503
  • I am Homer, Sorry my english is Bad!!
    • View Profile

Very Nice News!  :)
thanks for all project. ;)

NxtSwe

  • Hero Member
  • *****
  • Karma: +124/-9
  • Offline Offline
  • Posts: 657
    • View Profile

Wow, awsome job!
That's quite the commit you have there (NXT-PLUS in one commit). I browsed through half of it and you seem to have put down quite a bit of work on this modification.
What's the state of the code right now? Alpha/Beta/Stable?

I hope it won't be too much work for you to keep pace with the core devs.
I once ported the NRS client to C#, but so much change after every major version release I could not keep up with the updates.
I hope you have more time to do that kind of tedious and unthankful task.

Keep it up!
Logged
Check out the NxtLib, the .NET Framework API for the Nxt platform.

ThomasVeil

  • Hero Member
  • *****
  • Karma: +183/-11
  • Offline Offline
  • Posts: 1400
    • View Profile

Heh, I don't get it - too techy. Though it sound impressive :D
Is that feature added to the NXT coins, or is it a new core with new chain?
What is a use-case of this connection thing?
Logged
ARDOR-BPV3-837M-QZTQ-9DQ69  oxpal.com

NxtSwe

  • Hero Member
  • *****
  • Karma: +124/-9
  • Offline Offline
  • Posts: 657
    • View Profile

Heh, I don't get it - too techy. Though it sound impressive :D
Is that feature added to the NXT coins, or is it a new core with new chain?
What is a use-case of this connection thing?

It's a modification of the NRS code base, where you can hook in "listeners" of events. And I agree with you, this is a techy thingie.

For example, let's say you are the developer for an exchange that use NXT and you want to know when a new transaction comes in to show it to your customer on your site.
Today you'll have to poll the NRS client, asking it every 10-20 seconds with the "getUnconfirmedTransactions" api function, and filtering out transactions that you already know about.
With NXT PLUS you can subscribe to the "addedUnconfirmedTransactions" event and the NRS code will, in real time let your code know that a new unconfirmed transaction has arrived.

There's lots of technical advantages with the second approach:
- You can show the transaction on your site in real time, instead of having to wait x seconds until your next poll.
- Not as complex code for you to write when you know that the transaction you recieve is indeed a new transaction and thus no special handling is required.

The big benefit comes in when you need to handle blocks, forks, knowing what transactions that got included in the new chain, etc. Those technical advantages you got from using NXT PLUS is really helping you out then.

PS. I have nothing to do with this project, I just found out about it yesterday, but these are the advantages I see.
Logged
Check out the NxtLib, the .NET Framework API for the Nxt platform.

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile

Heh, I don't get it - too techy. Though it sound impressive :D
Is that feature added to the NXT coins, or is it a new core with new chain?
What is a use-case of this connection thing?

It's a modification of the NRS code base, where you can hook in "listeners" of events. And I agree with you, this is a techy thingie.

For example, let's say you are the developer for an exchange that use NXT and you want to know when a new transaction comes in to show it to your customer on your site.
Today you'll have to poll the NRS client, asking it every 10-20 seconds with the "getUnconfirmedTransactions" api function, and filtering out transactions that you already know about.
With NXT PLUS you can subscribe to the "addedUnconfirmedTransactions" event and the NRS code will, in real time let your code know that a new unconfirmed transaction has arrived.

There's lots of technical advantages with the second approach:
- You can show the transaction on your site in real time, instead of having to wait x seconds until your next poll.
- Not as complex code for you to write when you know that the transaction you recieve is indeed a new transaction and thus no special handling is required.

The big benefit comes in when you need to handle blocks, forks, knowing what transactions that got included in the new chain, etc. Those technical advantages you got from using NXT PLUS is really helping you out then.

PS. I have nothing to do with this project, I just found out about it yesterday, but these are the advantages I see.
why polling at 20 seconds?
access to localhost is very fast, you can poll multiple times per second without any problems
still a push type of interface would have good use cases
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

NxtSwe

  • Hero Member
  • *****
  • Karma: +124/-9
  • Offline Offline
  • Posts: 657
    • View Profile

why polling at 20 seconds?
access to localhost is very fast, you can poll multiple times per second without any problems
still a push type of interface would have good use cases

Bah you ruined my example! :P
Logged
Check out the NxtLib, the .NET Framework API for the Nxt platform.

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile

why polling at 20 seconds?
access to localhost is very fast, you can poll multiple times per second without any problems
still a push type of interface would have good use cases

Bah you ruined my example! :P
sorry, just trying to be accurate.
Not sure if it can be used to create notifications for specific transactions that pass a filter. If so, then it would be a locally running alert service for things like getting a transaction (or a dividend via built in dividend command), etc
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

NxtSwe

  • Hero Member
  • *****
  • Karma: +124/-9
  • Offline Offline
  • Posts: 657
    • View Profile

why polling at 20 seconds?
access to localhost is very fast, you can poll multiple times per second without any problems
still a push type of interface would have good use cases

Bah you ruined my example! :P
sorry, just trying to be accurate.
Not sure if it can be used to create notifications for specific transactions that pass a filter. If so, then it would be a locally running alert service for things like getting a transaction (or a dividend via built in dividend command), etc

It looks like it can:
Quote
addedUnconfirmedTransactions-FIM-5PGB-BFNZ-KCSF-9XJWB Forwards event ADDED_UNCONFIRMED_TRANSACTIONS but only for transactions that have the added account as recipient or sender.
http://fimkrypto.github.io/nxt-plus-site/2015/03/30/realtime-network-events.html
Logged
Check out the NxtLib, the .NET Framework API for the Nxt platform.

verymuchso

  • Hero Member
  • *****
  • Karma: +118/-2
  • Offline Offline
  • Posts: 549
    • View Profile
    • HEAT Ledger

Heh, I don't get it - too techy. Though it sound impressive :D
Is that feature added to the NXT coins, or is it a new core with new chain?
What is a use-case of this connection thing?

It's a modification of the NRS code base, where you can hook in "listeners" of events. And I agree with you, this is a techy thingie.

For example, let's say you are the developer for an exchange that use NXT and you want to know when a new transaction comes in to show it to your customer on your site.
Today you'll have to poll the NRS client, asking it every 10-20 seconds with the "getUnconfirmedTransactions" api function, and filtering out transactions that you already know about.
With NXT PLUS you can subscribe to the "addedUnconfirmedTransactions" event and the NRS code will, in real time let your code know that a new unconfirmed transaction has arrived.

There's lots of technical advantages with the second approach:
- You can show the transaction on your site in real time, instead of having to wait x seconds until your next poll.
- Not as complex code for you to write when you know that the transaction you recieve is indeed a new transaction and thus no special handling is required.

The big benefit comes in when you need to handle blocks, forks, knowing what transactions that got included in the new chain, etc. Those technical advantages you got from using NXT PLUS is really helping you out then.

PS. I have nothing to do with this project, I just found out about it yesterday, but these are the advantages I see.
why polling at 20 seconds?
access to localhost is very fast, you can poll multiple times per second without any problems
still a push type of interface would have good use cases

Constantly polling localhost multiple times per second sure leads to a hot CPU, but what API to use? You need unconfirmed txns, confiremed txns and then they are constantly switched about from confirmed to unconfiremed when your node is switching forks. So when polling you basically need to constantly poll txns, unconfirmed txns, and blocks, thats already 3 API calls.

As NxtSwe says a push based arcitecture allows for much cleaner code, I was able to throw out roughly half the code of mofowallet simply by switching to an event based system. Plus it leads to the situation where each piece of data in mofowallet now is updated in realtime without the need to write any polling code.

What is not in the docs is there are also peer events available. I've copied the part from mofowallet that uses it for any one interested..

http://paste.ubuntu.com/10716694/
Logged
HEAT: DEX | SDK | HOME

verymuchso

  • Hero Member
  • *****
  • Karma: +118/-2
  • Offline Offline
  • Posts: 549
    • View Profile
    • HEAT Ledger
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #10 on: April 01, 2015, 07:21:35 am »

What's the state of the code right now? Alpha/Beta/Stable?

We are using this code in production and are actively working on it for use in mofowallet.
The same code is used in FIMK which is also actively being worked on. I figured now that we made this it might help others to.

We have NXT+ running on our servers so you dont need to compile it to try it out.
See this little sample of connecting to the sockets from javascripts it contains everything needed. http://jsfiddle.net/dirkdiggler/o1z94adn/

The FIMKSocket lib is just a reference wrapper created for the samples, it can be found here https://gist.github.com/fimkrypto/916fc1da11dd2877ab18
Logged
HEAT: DEX | SDK | HOME

coinomat

  • Hero Member
  • *****
  • Karma: +214/-18
  • Offline Offline
  • Posts: 1520
    • View Profile
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #11 on: April 01, 2015, 07:38:54 am »

very interesting stuff, especially real-time websocket connectivity.
Logged
Time to go further

semibaron

  • Sr. Member
  • ****
  • Karma: +16/-7
  • Offline Offline
  • Posts: 333
    • View Profile
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #12 on: April 01, 2015, 09:29:18 am »

Heh, I don't get it - too techy. Though it sound impressive :D
Is that feature added to the NXT coins, or is it a new core with new chain?
What is a use-case of this connection thing?

It's a modification of the NRS code base, where you can hook in "listeners" of events. And I agree with you, this is a techy thingie.

For example, let's say you are the developer for an exchange that use NXT and you want to know when a new transaction comes in to show it to your customer on your site.
Today you'll have to poll the NRS client, asking it every 10-20 seconds with the "getUnconfirmedTransactions" api function, and filtering out transactions that you already know about.
With NXT PLUS you can subscribe to the "addedUnconfirmedTransactions" event and the NRS code will, in real time let your code know that a new unconfirmed transaction has arrived.

There's lots of technical advantages with the second approach:
- You can show the transaction on your site in real time, instead of having to wait x seconds until your next poll.
- Not as complex code for you to write when you know that the transaction you recieve is indeed a new transaction and thus no special handling is required.

The big benefit comes in when you need to handle blocks, forks, knowing what transactions that got included in the new chain, etc. Those technical advantages you got from using NXT PLUS is really helping you out then.

PS. I have nothing to do with this project, I just found out about it yesterday, but these are the advantages I see.
why polling at 20 seconds?
access to localhost is very fast, you can poll multiple times per second without any problems
still a push type of interface would have good use cases

Constantly polling localhost multiple times per second sure leads to a hot CPU, but what API to use? You need unconfirmed txns, confiremed txns and then they are constantly switched about from confirmed to unconfiremed when your node is switching forks. So when polling you basically need to constantly poll txns, unconfirmed txns, and blocks, thats already 3 API calls.

As NxtSwe says a push based arcitecture allows for much cleaner code, I was able to throw out roughly half the code of mofowallet simply by switching to an event based system. Plus it leads to the situation where each piece of data in mofowallet now is updated in realtime without the need to write any polling code.

What is not in the docs is there are also peer events available. I've copied the part from mofowallet that uses it for any one interested..

http://paste.ubuntu.com/10716694/


If it is so awesome, why don't make this the standard approach in NRS?
Logged

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #13 on: April 01, 2015, 09:36:14 am »

Heh, I don't get it - too techy. Though it sound impressive :D
Is that feature added to the NXT coins, or is it a new core with new chain?
What is a use-case of this connection thing?

It's a modification of the NRS code base, where you can hook in "listeners" of events. And I agree with you, this is a techy thingie.

For example, let's say you are the developer for an exchange that use NXT and you want to know when a new transaction comes in to show it to your customer on your site.
Today you'll have to poll the NRS client, asking it every 10-20 seconds with the "getUnconfirmedTransactions" api function, and filtering out transactions that you already know about.
With NXT PLUS you can subscribe to the "addedUnconfirmedTransactions" event and the NRS code will, in real time let your code know that a new unconfirmed transaction has arrived.

There's lots of technical advantages with the second approach:
- You can show the transaction on your site in real time, instead of having to wait x seconds until your next poll.
- Not as complex code for you to write when you know that the transaction you recieve is indeed a new transaction and thus no special handling is required.

The big benefit comes in when you need to handle blocks, forks, knowing what transactions that got included in the new chain, etc. Those technical advantages you got from using NXT PLUS is really helping you out then.

PS. I have nothing to do with this project, I just found out about it yesterday, but these are the advantages I see.
why polling at 20 seconds?
access to localhost is very fast, you can poll multiple times per second without any problems
still a push type of interface would have good use cases

Constantly polling localhost multiple times per second sure leads to a hot CPU, but what API to use? You need unconfirmed txns, confiremed txns and then they are constantly switched about from confirmed to unconfiremed when your node is switching forks. So when polling you basically need to constantly poll txns, unconfirmed txns, and blocks, thats already 3 API calls.

As NxtSwe says a push based arcitecture allows for much cleaner code, I was able to throw out roughly half the code of mofowallet simply by switching to an event based system. Plus it leads to the situation where each piece of data in mofowallet now is updated in realtime without the need to write any polling code.

What is not in the docs is there are also peer events available. I've copied the part from mofowallet that uses it for any one interested..

http://paste.ubuntu.com/10716694/


If it is so awesome, why don't make this the standard approach in NRS?
compatibility issues
websockets is browser version specific, at least that is what I understand
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

verymuchso

  • Hero Member
  • *****
  • Karma: +118/-2
  • Offline Offline
  • Posts: 549
    • View Profile
    • HEAT Ledger
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #14 on: April 01, 2015, 10:43:09 am »

If it is so awesome, why don't make this the standard approach in NRS?
compatibility issues
websockets is browser version specific, at least that is what I understand

Thats not really an issue, websocket support is available in all modern browsers there might be a tiny percentage of old browsers that dont support it but there are even solutions for those.

What is a bigger compatibility issue imo is that NRS/HTML/Wesley/Supernet client? is basically unusable on mobile devices (which is 50+% of all browsers).
When creating mofowallet I figured that was a biggger compatibility issue to fix first.

This gives a good overview of browser compatibility http://caniuse.com/#search=websocket
Logged
HEAT: DEX | SDK | HOME

ThomasVeil

  • Hero Member
  • *****
  • Karma: +183/-11
  • Offline Offline
  • Posts: 1400
    • View Profile
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #15 on: April 01, 2015, 02:22:26 pm »

Thanks for the explanation NXTswe. Interesting tech.
Logged
ARDOR-BPV3-837M-QZTQ-9DQ69  oxpal.com

verymuchso

  • Hero Member
  • *****
  • Karma: +118/-2
  • Offline Offline
  • Posts: 549
    • View Profile
    • HEAT Ledger
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #16 on: April 01, 2015, 05:15:41 pm »

very interesting stuff, especially real-time websocket connectivity.

Indeed it is interesting :D let me know if you have any trouble using it.
Logged
HEAT: DEX | SDK | HOME

m19

  • Jr. Member
  • **
  • Karma: +10/-0
  • Offline Offline
  • Posts: 65
    • View Profile
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #17 on: April 01, 2015, 06:22:27 pm »

Great! Funny thing, one day before you committed the changes to Github I was manually porting the FIMK websocket code to my local NXT repository. Had some errors and wanted to continue today, but now it's all there already!
Awesome work guys.

I'd also argue stuff like this should be in the core. "Pulling" data is not really 2015 anymore. With websockets + longpolling you'd probably have compatibility for 99% of the users.
Logged

verymuchso

  • Hero Member
  • *****
  • Karma: +118/-2
  • Offline Offline
  • Posts: 549
    • View Profile
    • HEAT Ledger
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #18 on: April 01, 2015, 06:25:24 pm »

Funny thing, one day before you committed the changes to Github I was manually porting the FIMK websocket code to my local NXT repository. Had some errors and wanted to continue today, but now it's all there already!

Lol that sure is a coincidence, wanted to open source it earlier but as always to much to do and to little time.
You will be pushing back the improvements you make right?
Logged
HEAT: DEX | SDK | HOME

m19

  • Jr. Member
  • **
  • Karma: +10/-0
  • Offline Offline
  • Posts: 65
    • View Profile
Re: [ANN] NXT+ - Adds Realtime Websockets + Blogging framework to NXT core
« Reply #19 on: April 01, 2015, 06:29:52 pm »

Funny thing, one day before you committed the changes to Github I was manually porting the FIMK websocket code to my local NXT repository. Had some errors and wanted to continue today, but now it's all there already!

Lol that sure is a coincidence, wanted to open source it earlier but as always to much to do and to little time.
You will be pushing back the improvements you make right?

I will, but don't expect anything. My java knowledge is limited, probably why I got the errors :)
Logged
Pages: [1] 2 3  All
 

elective-stereophonic
elective-stereophonic
assembly
assembly