Nxt Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Nxt Client 1.11.9 - NEW RELEASE: Ardor 2.0.3e TestNet IS LAUNCHED!

Pages: [1]

Author Topic: another database question  (Read 250 times)

forkedchain

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1153
  • bite me
    • View Profile
  • Karma: +68/-10
another database question
June 10, 2017, 06:35:24 pm

Ive noticed that the API has been pretty static ever since way back when.  I dont mean that disparagingly -just meaning once something was implemented in an API, it was very rare for future NRS releases  to affect the way that API operated or presented JSON data to requests.  This has made my job as a forging pool operator very hands-off:  Ive very rarely had to go in and edit my accounting system's code that calculates what payouts for block forging fees are for members of my pool.

Im planning on redoing it all for Ardor, implementing it all in java with h2 queries versus how it is now with perl and HTTP api.

Can I expect the same level of static-ness in how H2 is arranged?  Id hate do redo it all but then have to deal with DB changes, etc.  As I do notice that many times with new NRS releases I see in the logfile that very often lots of DB stuff changes around.
NXT tips: 2319251 or NXT-8SWM-2224-YKWW-22222

Riker

  • Core Dev
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1705
    • View Profile
  • Karma: +429/-42
Re: another database question
June 10, 2017, 08:44:29 pm

Ive noticed that the API has been pretty static ever since way back when.  I dont mean that disparagingly -just meaning once something was implemented in an API, it was very rare for future NRS releases  to affect the way that API operated or presented JSON data to requests.  This has made my job as a forging pool operator very hands-off:  Ive very rarely had to go in and edit my accounting system's code that calculates what payouts for block forging fees are for members of my pool.

Im planning on redoing it all for Ardor, implementing it all in java with h2 queries versus how it is now with perl and HTTP api.

Can I expect the same level of static-ness in how H2 is arranged?  Id hate do redo it all but then have to deal with DB changes, etc.  As I do notice that many times with new NRS releases I see in the logfile that very often lots of DB stuff changes around.

It is generally better if you continue to rely on the APIs and not access the database directly.
The main changes for porting your app from NXT to Ardor are explained here https://nxtwiki.org/wiki/Nxt_to_Ardor
NXT Core Dev
Account: NXT-HBFW-X8TE-WXPW-DZFAG
Public Key: D8311651 Key fingerprint: 0560 443B 035C EE08 0EC0  D2DD 275E 94A7 D831 1651

forkedchain

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1153
  • bite me
    • View Profile
  • Karma: +68/-10
Re: another database question
June 12, 2017, 09:42:58 pm

got it, ok thanks ill build it with API then.  too bad i think it would be much faster if it could get data directly from DB instead of abstracted through API layer, even then after that layer, there is more processing (the json) that has to happen.  but id much prefer more hands off and to not have to redo stuff each time a new NRS release restructures the DB so thanks for the input.
NXT tips: 2319251 or NXT-8SWM-2224-YKWW-22222

mrceebo

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
    • View Profile
  • Karma: +0/-0
Re: another database question
July 17, 2017, 06:22:27 pm

Hi we have also trouble to create genesis block in our database
SenderPubKey is Null but provided in genesis block :-(

2017-07-16 22:37:18 FINE: Failed to get transaction bytes for transaction: "senderPublicKey":null,"signature":"bab851dab1c4b5594327c922a24c244063c77f21f54d7ff3ce20ced1afa5bf0bf553fae2fefaf4d2fa476d7f1487d846518ca82ee888593186c0659cc9783b4d","feeNQT":0,"type":0,"version":0,"ecBlockId":"0","attachment":{"version.OrdinaryPayment":0},"subtype":0,"amountNQT":1000000000000000,"recipient":"13007192849191954727","ecBlockHeight":0,"deadline":0,"timestamp":0}
2017-07-16 22:37:18 FINE: java.lang.NullPointerException
java.lang.NullPointerException
    at java.nio.ByteBuffer.put(ByteBuffer.java:859)
    at nxt.TransactionImpl.bytes(TransactionImpl.java:617)
    at nxt.BlockImpl.loadTransactions(BlockImpl.java:452)
    at nxt.BlockchainProcessorImpl.scan(BlockchainProcessorImpl.java:2042)
    at nxt.BlockchainProcessorImpl.scan(BlockchainProcessorImpl.java:1964)
    at nxt.BlockchainProcessorImpl.scan(BlockchainProcessorImpl.java:1947)
    at nxt.BlockchainProcessorImpl.lambda$new$5(BlockchainProcessorImpl.java:1077)
    at nxt.util.ThreadPool$2.run(ThreadPool.java:131)
2017-07-16 22:37:18 FINE: Applying block 32536643842995406 at height 0 failed, deleting from database
Exception in thread "Thread-3" java.lang.NullPointerException
    at nxt.BlockDb.deleteBlocksFrom(BlockDb.java:343)
    at nxt.BlockchainProcessorImpl.scan(BlockchainProcessorImpl.java:2085)
    at nxt.BlockchainProcessorImpl.scan(BlockchainProcessorImpl.java:1964)
    at nxt.BlockchainProcessorImpl.scan(BlockchainProcessorImpl.java:1947)
    at nxt.BlockchainProcessorImpl.lambda$new$5(BlockchainProcessorImpl.java:1077)

thx for anyhelp!
Pages: [1]