ferment
Full Member
 
Offline
Activity: 168
Merit: 100
IDEX - LIVE Real-time DEX
|
 |
December 28, 2013, 03:04:31 PM |
|
@Dev Team
Is there any API to find which blocks an account has forged, and how many fees the account got?
Thanks.
You can walk block chain and compare the "generator" of the block against the account number. Here's some ruby (extracted from my soon to be released ruby client library): #!/usr/bin/env ruby
require "rubygems" require 'json' require 'httparty'
def get(server, cmd, args={}) a = args.map { |k,v| "#{k}=#{v}" }.join("&") url = "http://#{server}:7874/nxt?requestType=#{cmd}&#{a}" JSON.parse(HTTParty.get(URI::escape(url)).body) end
def get_block(id) get("localhost", "getBlock", {"block" => id}) end
account = ARGV[0]
last_block_id = get("localhost", "getState")["lastBlock"] blocks = {} fees = 0 while last_block_id block = get_block(last_block_id) if block["generator"] == account fee = block["totalFee"] puts "#{last_block_id} - #{fee}" fees += fee end last_block_id = block["previousBlock"] end
puts "#{account} earned #{fees} nxt."
Save this as "forged.rb" and "chmod +x".
|
|
|
|
|
davethetrousers
|
 |
December 28, 2013, 03:11:55 PM |
|
Hm, that gave me an idea, I am now testing openjdk-7-jre-headless package on a 512 mb vps
That's what I'm using on my node. It works, but eventually the heap will be full due to leaks. On a 512M, you should keep the max number of connections low. Haven't tried the Oracle SE VM yet. I'll have a go at that later.
|
|
|
|
|
NxtChoice
|
 |
December 28, 2013, 03:14:45 PM |
|
@Dev Team
Is there any API to find which blocks an account has forged, and how many fees the account got?
Thanks.
You can walk block chain and compare the "generator" of the block against the account number. Here's some ruby (extracted from my soon to be released ruby client library): #!/usr/bin/env ruby
require "rubygems" require 'json' require 'httparty'
def get(server, cmd, args={}) a = args.map { |k,v| "#{k}=#{v}" }.join("&") url = "http://#{server}:7874/nxt?requestType=#{cmd}&#{a}" JSON.parse(HTTParty.get(URI::escape(url)).body) end
def get_block(id) get("localhost", "getBlock", {"block" => id}) end
account = ARGV[0]
last_block_id = get("localhost", "getState")["lastBlock"] blocks = {} fees = 0 while last_block_id block = get_block(last_block_id) if block["generator"] == account fee = block["totalFee"] puts "#{last_block_id} - #{fee}" fees += fee end last_block_id = block["previousBlock"] end
puts "#{account} earned #{fees} nxt."
Save this as "forged.rb" and "chmod +x". Thank you ferment! I will have a try and dig it though I'm not familiar with Ruby.
|
|
|
|
|
laowai80
Member

Offline
Activity: 98
Merit: 10
|
 |
December 28, 2013, 03:17:34 PM |
|
Hm, that gave me an idea, I am now testing openjdk-7-jre-headless package on a 512 mb vps
That's what I'm using on my node. It works, but eventually the heap will be full due to leaks. On a 512M, you should keep the max number of connections low. Haven't tried the Oracle SE VM yet. I'll have a go at that later. I never thought about testing it. We have to make it run smooth on 512 Mb, and if -headless JRE helps with garbage collection better, then it should be the default java install for NXT. I'll update my guide with that info, after a few hours of testing.
|
|
|
|
|
|
opticalcarrier
|
 |
December 28, 2013, 03:31:20 PM Last edit: December 28, 2013, 04:03:43 PM by opticalcarrier |
|
All: in the logo voting thread, a candidate very similar to Namecoin's logo appears to be winning This is QBTC's candidate  And namecoin looks like this:  Please take a look at all candidates and vote what you think will best represent NXT. The voted logo will begin to be used on all our sites: www, info, wiki, forums, etc.
|
|
|
|
|
brooklynbtc
Sr. Member
  
Offline
Activity: 336
Merit: 250
AKA jefdiesel
|
 |
December 28, 2013, 03:39:53 PM |
|
Morning all messing with this android app https://nextcoin.org/index.php/topic,797.0.html Says that we can enable aliases as our account? sweet. I updated "jef" to point to my account number, and when I added account "jef" it instantly pointed to my account number and showed my balance. FTW this is great. it looks like you can actually send me coins to "jef" from the app.. if anyone else wants to try, send me your alias in the app and I will send you some coins
|
|
|
|
laowai80
Member

Offline
Activity: 98
Merit: 10
|
 |
December 28, 2013, 03:44:03 PM |
|
Morning all messing with this android app https://nextcoin.org/index.php/topic,797.0.html Says that we can enable aliases as our account? sweet. I updated "jef" to point to my account number, and when I added account "jef" it instantly pointed to my account number and showed my balance. FTW this is great. that sure beats long cryptic bitcoin addresses 
|
|
|
|
|
msin
Legendary
Offline
Activity: 1526
Merit: 1006
|
 |
December 28, 2013, 03:45:39 PM |
|
Jean Luc Picard of the USS Enterprise....  I had to do it...it was just too tempting Edit: USS Nxterprise boldly go where no Crypto has gone before. In a hindsight, I have really picked up an appropriate pseudonym. I never imagined I will make the progress from a forum Newbie to a Captain that fast. I hereby appoint CfB as my First Officer. Now that the USS NRS Enterprise has been making successful test flights, we have to get ready for our first trip outside the solar system, scheduled for Jan 03. I am now proof-reading the code for any visible bugs. The memory leak has been fixed and I hope version 0.4.8 should have lower memory consumption and not require periodic restart. Next, there are some minor thread safety bugs I noticed that I will fix. I can also think of some optimization in the peer networking code, right now we create a lot of temporary byte[] and char[] that put extra load on the garbage collector and increase the memory usage too, but this is not urgent. I need to do some refactoring of the code, because now everything is in one huge file. The parts that are to remain closed source will have to be factored out, as much as possible, in separate classes, so that they can be distributed in compiled form, still allowing one to work on the base open source part without having the complete source. I also need to pick up a repository where we should host the source code, and prepare it for the Jan 03 launch. Probably github, but I need to investigate the alternatives. Good to have you on board! I highly recommend Github as a repository, well known and respected with the largest user base. Keep up the good work.
|
|
|
|
|
brooklynbtc
Sr. Member
  
Offline
Activity: 336
Merit: 250
AKA jefdiesel
|
 |
December 28, 2013, 03:50:35 PM |
|
Nxt Android client update
So cool!
I made a wallet for my 2 year old daughter, you can send her nxt to "trixie"
and one for my father in-law "richardrutowicz"
Awesome and easy
and just for geekyness running off raspnxt.hopto.org
|
|
|
|
ferment
Full Member
 
Offline
Activity: 168
Merit: 100
IDEX - LIVE Real-time DEX
|
 |
December 28, 2013, 03:56:00 PM |
|
Thank you ferment! I will have a try and dig it though I'm not familiar with Ruby.
Feel free to PM if you need me to decode idiomatic ruby syntax in there. I tried to keep it straightforward.
|
|
|
|
brooklynbtc
Sr. Member
  
Offline
Activity: 336
Merit: 250
AKA jefdiesel
|
 |
December 28, 2013, 04:00:24 PM |
|
even sent some coins through the app, from grandpa to trixie, using the raspberry pi server.
man now its time to double down and buy some more of this
|
|
|
|
|
newcn
|
 |
December 28, 2013, 04:04:41 PM |
|
yes it is a really problem i hope developer can solve it. several my aliases transactions have done and the record is listed in the account. but i cant find any alias in my account. it seems just the transaction not happpened but the fee is gone.
all the aliases show in the account, good team,so quick. thx for the confirmation tillou. I would be perfect if the aliases are shown in alphabetical order
|
BTC:1NzzfeHCgN8fF6mSG1UeBFCVd2cxKbGyHk NXT:13187911577562526278
|
|
|
|
opticalcarrier
|
 |
December 28, 2013, 04:05:07 PM |
|
Hm, that gave me an idea, I am now testing openjdk-7-jre-headless package on a 512 mb vps
That's what I'm using on my node. It works, but eventually the heap will be full due to leaks. On a 512M, you should keep the max number of connections low. Haven't tried the Oracle SE VM yet. I'll have a go at that later. I never thought about testing it. We have to make it run smooth on 512 Mb, and if -headless JRE helps with garbage collection better, then it should be the default java install for NXT. I'll update my guide with that info, after a few hours of testing. Nice work please keep us vps managers posted on whats best
|
|
|
|
|
msin
Legendary
Offline
Activity: 1526
Merit: 1006
|
 |
December 28, 2013, 04:05:32 PM |
|
even sent some coins through the app, from grandpa to trixie, using the raspberry pi server.
man now its time to double down and buy some more of this
Wow, that is seriously awesome.
|
|
|
|
|
BitcoinForumator
Legendary
Offline
Activity: 1120
Merit: 1000
|
 |
December 28, 2013, 04:09:08 PM |
|
even sent some coins through the app, from grandpa to trixie, using the raspberry pi server.
man now its time to double down and buy some more of this
Wow, that is seriously awesome. What is the full name of the app on the Android Play Store?
|
|
|
|
|
|
|
starik69
Legendary
Offline
Activity: 1367
Merit: 1000
|
 |
December 28, 2013, 04:17:17 PM |
|
Forwarding through the alias system? How it is possible?
|
|
|
|
|
brooklynbtc
Sr. Member
  
Offline
Activity: 336
Merit: 250
AKA jefdiesel
|
 |
December 28, 2013, 04:21:39 PM |
|
Forwarding through the alias system? How it is possible?
when you create an alias, or change an alias you own, you can specify the URI https://localhost:7875/alias.htmlin this box put the account number you want it to forward to and its that easy BUT using this is up to the CLIENT DEVELOPER currently, this NxtClient for android is using it..
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
 |
December 28, 2013, 04:28:14 PM |
|
I repost this from https://nextcoin.org/index.php/topic,797.msg14049.html#msg14049 coz it's importantAccount Alias You can name your account with a alias. The rule is: Alias:yueye Url: nxt:5693933960808456307
This way is slightly incorrect. " nxt:" URI scheme tells that "5693933960808456307" is an alias, not an account id. U should choose other notation coz aliases pointing to other aliases will be used in future not announced yet features. I would advise to switch to other notation (for example, just "5693933960808456307") before it becomes widespread and lead to problems with standardization.
|
|
|
|
|
|
BloodyRookie
|
 |
December 28, 2013, 04:40:53 PM |
|
An account can only forge a block once a day, right?
|
Nothing Else Matters NEM: NALICE-LGU3IV-Y4DPJK-HYLSSV-YFFWYS-5QPLYE-ZDJJ NXT: 11095639652683007953
|
|
|
|