Author Topic: API Request  (Read 998 times)

warmach on: July 12, 2015, 03:07:56 PM

  • Senior Fimker
  • ***
  • Posts: 225
    • View Profile
I've been looking through the NXT api wiki and there is something that I think would be helpful to add.

1.  List of forged blocks for an account

2.  The list of lessees for an account at a particular block.  This could be included in #1 api response.


I am working on a forging pool and I haven't found yet an API call that gives me either of these.  I am forced to read the trace file created by FIM for my forging account.  While this is workable, it is not ideal for a long term solution.  From the Mofo front end, it seems most of this information already exists and is readily accessible to Mofo.  Can we just get this available in the API?
Warmach's Forging Pool
http://fim.warmach.info/pool/
May the forge be with you...

Dirk Diggler #1 on: July 12, 2015, 09:25:08 PM

  • FIMK Staff
  • *****
  • Posts: 486
    • View Profile
    • Krypto Fin ry
1. https://github.com/fimkrypto/fimk/blob/master/src/java/nxt/http/GetAccountBlocks.java

2. https://github.com/fimkrypto/fimk/blob/master/src/java/nxt/http/GetAccountLessors.java

Those are the api (java) implementations, but perhaps they can serve to know what arguments they expect.
To use them call them with a lower first char, so requestType=getAccountBlocks for instance.

Lessors can indeed be seen in mofowallet https://www.mofowallet.com/launch.html#/accounts/FIM-7H5M-BMAN-4NVC-82J2S/leasing/latest
FIMK Developer | GPG fingerprint: CEF2 7C39 43BE 6800 504E  71BC 7E87 A7B0 AC34 E2D5 | mofowallet.com | blog

warmach #2 on: July 12, 2015, 09:33:25 PM

  • Senior Fimker
  • ***
  • Posts: 225
    • View Profile
1. https://github.com/fimkrypto/fimk/blob/master/src/java/nxt/http/GetAccountBlocks.java

2. https://github.com/fimkrypto/fimk/blob/master/src/java/nxt/http/GetAccountLessors.java

Those are the api (java) implementations, but perhaps they can serve to know what arguments they expect.
To use them call them with a lower first char, so requestType=getAccountBlocks for instance.

Lessors can indeed be seen in mofowallet https://www.mofowallet.com/launch.html#/accounts/FIM-7H5M-BMAN-4NVC-82J2S/leasing/latest

Thanks Dirk!

I feel like such a goof!  I knew it had be in there.  Afterall, I hadn't seen any people complaining in FIM or NXT forums about it not being there...

Warmach's Forging Pool
http://fim.warmach.info/pool/
May the forge be with you...

warmach #3 on: July 13, 2015, 02:32:13 AM

  • Senior Fimker
  • ***
  • Posts: 225
    • View Profile

2. https://github.com/fimkrypto/fimk/blob/master/src/java/nxt/http/GetAccountLessors.java


For this API call, NXT documentation says that by default, only 1441 blocks back are available.  I modified the value to 14410 and restarted the server.  How long does it take to re-index?  I'm assuming it does this in a background process. 

Reason I'm asking....  I'm looking at a block and trying to figure out how many lessors there were.  I'm expecting three lessors, but my api call only returns one.  Does it re-index doing one FIM address at a time?  Or does it go block by block?  If one address at a time, I just might need to wait longer for the other two addresses to populate.  So far, it has been 1.5 hours since the modified config option and server restart.
Warmach's Forging Pool
http://fim.warmach.info/pool/
May the forge be with you...