Jean-Luc
|
|
February 18, 2014, 04:43:16 PM |
|
Question about the java API. Are there any plans to extract the functionality of the handlers in in nxt.http into java interfaces. My use case is to create a payment transaction but i dont want to go through the HTTP layer. Currently to send money from the java api you would have to duplicate all the steps taken in for instance nxt.http.SendMoney.
The Java API is still a work in progress, in fact I am just in the middle of another refactoring for 0.8.0. I am switching to embedded jetty, so Nxt will no longer be a servlet. I will also improve the API while at it. For the SendMoney example, what kind of an API would you find useful? Right now the steps you would need to duplicate are not that many, basically you need to do: Transaction transaction = Transaction.newTransaction(Convert.getEpochTime(), deadline, publicKey, recipient, amount, fee, referencedTransaction); transaction.sign(secretPhrase);
Blockchain.broadcast(transaction);
The rest is validating the user input and returning error messages, which is application specific. If you submit an invalid transaction, it will not be accepted, and a lot of validation is done immediately when the Transaction object is constructed (such as for non-negative amount and fee, deadline, timestamp). Other validations, such as the account having enough funds are only done when the Transaction is about to be included in a block (because the account balance may have changed in the meantime).
|
|
|
|
Damelon
Legendary
Offline
Activity: 1092
Merit: 1010
|
|
February 18, 2014, 04:43:24 PM |
|
Does it for me Doing an article on Offspring today
|
|
|
|
Jean-Luc
|
|
February 18, 2014, 04:47:57 PM |
|
Cool to see another web client, however it seems to be using api calls that will be removed soon (getInitialData / processNewData)
I will not remove those if other clients are relying on them. But those are not API calls, those are user interface calls. In 0.8.0 you would be able to selectively enable/disable the http API and the UI, so don't bundle them together. And they will be on different ports.
|
|
|
|
Anon136
Legendary
Offline
Activity: 1722
Merit: 1217
|
|
February 18, 2014, 04:50:27 PM |
|
NOTE: Voting System ... works only on testnet for now.
whats the voting algo like? 1 nxt 1 vote + tx fee?
|
Rep Thread: https://bitcointalk.org/index.php?topic=381041If one can not confer upon another a right which he does not himself first possess, by what means does the state derive the right to engage in behaviors from which the public is prohibited?
|
|
|
wesleyh
|
|
February 18, 2014, 04:52:35 PM |
|
Cool to see another web client, however it seems to be using api calls that will be removed soon (getInitialData / processNewData)
I will not remove those if other clients are relying on them. But those are not API calls, those are user interface calls. In 0.8.0 you would be able to selectively enable/disable the http API and the UI, so don't bundle them together. And they will be on different ports. Hmm, I had this in my client first, but cfb told me it would be removed because it takes too much resources. Which is why I switched to the official API.
|
|
|
|
CommanderVenus
|
|
February 18, 2014, 05:22:55 PM |
|
Are we stuck on block 69524 or is my server just not working correctly?
|
|
|
|
Anon136
Legendary
Offline
Activity: 1722
Merit: 1217
|
|
February 18, 2014, 05:26:12 PM |
|
Are we stuck on block 69524 or is my server just not working correctly?
im on 69526
|
Rep Thread: https://bitcointalk.org/index.php?topic=381041If one can not confer upon another a right which he does not himself first possess, by what means does the state derive the right to engage in behaviors from which the public is prohibited?
|
|
|
CommanderVenus
|
|
February 18, 2014, 05:27:38 PM |
|
Are we stuck on block 69524 or is my server just not working correctly?
im on 69526 There we go, the block just took 18 minutes. Oops.
|
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 18, 2014, 05:36:28 PM |
|
NOTE: Voting System ... works only on testnet for now.
whats the voting algo like? 1 nxt 1 vote + tx fee? It is fully depend on the one interpreting the results. It the most beautiful solution they could have come up with.
|
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 18, 2014, 05:39:07 PM |
|
Anon136's video described it as the chain that had the most stake involved in forging the blocks was the 'correct' one, even though there may be a longer chain. It's slang. "Longer chain" == "chain with the most stake involved". @Anon136 If so, could we stick to the 'longer chain' theme? It's just because it makes more sense to most people (even those that are familiar with graph theory).
|
|
|
|
martismartis
Legendary
Offline
Activity: 1162
Merit: 1005
|
|
February 18, 2014, 05:39:18 PM |
|
Crimi666 While I'm not registered in nextcoing.org and read you had problems with www.peerexplorer.com and looking for person, who took 4100 NXT, maybe this will help you : http://nextcoins.ru/share/Look for "Aлeкcaндp Кopoлeв 13117504042955556224 3 NXT 28 янвapя в 12:05" Maybe some russians could help you. Good luck
|
|
|
|
wesh
Newbie
Offline
Activity: 34
Merit: 0
|
|
February 18, 2014, 05:40:03 PM |
|
Hello, I have been running my VPS for more than 3 weeks now without earning any nxt !. I do have some nxt in my account and have aroud 600 unconfirmed transaction!! what do I have to do ? thank for your help in advance
|
|
|
|
Anon136
Legendary
Offline
Activity: 1722
Merit: 1217
|
|
February 18, 2014, 05:40:48 PM |
|
NOTE: Voting System ... works only on testnet for now.
whats the voting algo like? 1 nxt 1 vote + tx fee? It is fully depend on the one interpreting the results. It the most beautiful solution they could have come up with. sounds good to me!
|
Rep Thread: https://bitcointalk.org/index.php?topic=381041If one can not confer upon another a right which he does not himself first possess, by what means does the state derive the right to engage in behaviors from which the public is prohibited?
|
|
|
Anon136
Legendary
Offline
Activity: 1722
Merit: 1217
|
|
February 18, 2014, 05:42:02 PM |
|
Anon136's video described it as the chain that had the most stake involved in forging the blocks was the 'correct' one, even though there may be a longer chain. It's slang. "Longer chain" == "chain with the most stake involved". @Anon136 If so, could we stick to the 'longer chain' theme? It's just because it makes more sense to most people (even those that are familiar with graph theory). i mean it works as slang but it is technically incorrect since its trivially easy to make a chain as long as you want. you could make a 1 million block long chain on my desktop computer in minutes if you wanted.
|
Rep Thread: https://bitcointalk.org/index.php?topic=381041If one can not confer upon another a right which he does not himself first possess, by what means does the state derive the right to engage in behaviors from which the public is prohibited?
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 18, 2014, 05:42:05 PM |
|
Technical question:
When a node gets somebody's private key, it starts forging. That's for sure.
What happens if somebody else sends his private key to that very node? Will it start forging for that account, too? Will is stop forging for the first account? And last but not least, how many accounts can a node forge for?
|
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 18, 2014, 05:43:33 PM |
|
Anon136's video described it as the chain that had the most stake involved in forging the blocks was the 'correct' one, even though there may be a longer chain. It's slang. "Longer chain" == "chain with the most stake involved". @Anon136 If so, could we stick to the 'longer chain' theme? It's just because it makes more sense to most people (even those that are familiar with graph theory). i mean it works as slang but it is technically incorrect since its trivially easy to make a chain as long as you want. you could make a 1 million block long chain on my desktop computer in minutes if i wanted. Err, so, what? Sorry, but it's a bit confusing if you don't know what's right and what's wrong. In plain english: what's the right way of finding consensus in NXT?
|
|
|
|
Anon136
Legendary
Offline
Activity: 1722
Merit: 1217
|
|
February 18, 2014, 05:47:34 PM |
|
Anon136's video described it as the chain that had the most stake involved in forging the blocks was the 'correct' one, even though there may be a longer chain. It's slang. "Longer chain" == "chain with the most stake involved". @Anon136 If so, could we stick to the 'longer chain' theme? It's just because it makes more sense to most people (even those that are familiar with graph theory). i mean it works as slang but it is technically incorrect since its trivially easy to make a chain as long as you want. you could make a 1 million block long chain on my desktop computer in minutes if i wanted. Err, so, what? Sorry, but it's a bit confusing if you don't know what's right and what's wrong. In plain english: what's the right way of finding consensus in NXT? sorry idk how to explain it any better than i did in the video
|
Rep Thread: https://bitcointalk.org/index.php?topic=381041If one can not confer upon another a right which he does not himself first possess, by what means does the state derive the right to engage in behaviors from which the public is prohibited?
|
|
|
Anon136
Legendary
Offline
Activity: 1722
Merit: 1217
|
|
February 18, 2014, 05:48:54 PM |
|
Anon136's video described it as the chain that had the most stake involved in forging the blocks was the 'correct' one, even though there may be a longer chain. It's slang. "Longer chain" == "chain with the most stake involved". @Anon136 If so, could we stick to the 'longer chain' theme? It's just because it makes more sense to most people (even those that are familiar with graph theory). i mean it works as slang but it is technically incorrect since its trivially easy to make a chain as long as you want. you could make a 1 million block long chain on my desktop computer in minutes if i wanted. In plain english: what's the right way of finding consensus in NXT? by looking for the chain that demonstrates the greatest stake participation without claiming to be from the future.
|
Rep Thread: https://bitcointalk.org/index.php?topic=381041If one can not confer upon another a right which he does not himself first possess, by what means does the state derive the right to engage in behaviors from which the public is prohibited?
|
|
|
|
verymuchso
Sr. Member
Offline
Activity: 421
Merit: 250
HEAT Ledger
|
|
February 18, 2014, 05:51:39 PM |
|
Question about the java API. Are there any plans to extract the functionality of the handlers in in nxt.http into java interfaces. My use case is to create a payment transaction but i dont want to go through the HTTP layer. Currently to send money from the java api you would have to duplicate all the steps taken in for instance nxt.http.SendMoney.
The Java API is still a work in progress, in fact I am just in the middle of another refactoring for 0.8.0. I am switching to embedded jetty, so Nxt will no longer be a servlet. I will also improve the API while at it. For the SendMoney example, what kind of an API would you find useful? Right now the steps you would need to duplicate are not that many, basically you need to do: Transaction transaction = Transaction.newTransaction(Convert.getEpochTime(), deadline, publicKey, recipient, amount, fee, referencedTransaction); transaction.sign(secretPhrase);
Blockchain.broadcast(transaction);
The rest is validating the user input and returning error messages, which is application specific. If you submit an invalid transaction, it will not be accepted, and a lot of validation is done immediately when the Transaction object is constructed (such as for non-negative amount and fee, deadline, timestamp). Other validations, such as the account having enough funds are only done when the Transaction is about to be included in a block (because the account balance may have changed in the meantime). Hi! You are right the steps to send money are very limited indeed, i already went ahead and did things that way. Looking at it now i no longer think there should be a higher level api apart from what is provided. While i have your attention might i point you to the following.. Currently there is no way for java clients to get notified of progress during startup (nxt.Nxt.init()) Ideally there would be a listener you could register or some sort of progress monitor. In eclipse you have the IProgressMonitor interface, such an interface would be perfect, i included a simplified example. public interface IProgressMonitor { public void beginTask(String name, int totalWork); public void done(); public void worked(int work); } The monitor would be provided by the user and is passed to the various startup methods. When reading the blockchain (for instance) you would call monitor.beginTask("Read blockchain", totalNumberOfBlocks) and then on each (or each 5th, 10th etc.) block read you call monitor.worked(numberOfBlocksRead). At the end you would call monitor.done(). > I am switching to embedded jetty That's how we have done it from the start. But what is wrong with the servlet, should you not stay far from jetty and focus solely on nxt core? Nice to meet you btw.. You did a nice job on the refactorings.
|
|
|
|
|