elective-stereophonic
elective-stereophonic
account balance at certain block height - possible? How?
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.12.1 Upgrade before block 2870000 is mandatory!

Author Topic: account balance at certain block height - possible? How?  (Read 1508 times)

altsheets

  • Full Member
  • ***
  • Karma: +31/-1
  • Offline Offline
  • Posts: 232
  • check out #AAssetNXT #AltFolio and #AssetGraphs
    • View Profile
    • AssetGraphs-v2 live examples
account balance at certain block height - possible? How?
« on: March 30, 2016, 07:46:15 am »

If I wanted to know an account balance at a certain block height,
would that be possible? How?

Thanks.
Logged
AltFolio | Newbium DataSite | AAssetNXT & -HZ | AssetGraphs | ABEE | Advice | assetparser.py & shareholders.py | bamm.py | PeerCrawler | Github e.g. ChainCountDown, ethjsre | ... much more

Jean-Luc

  • Core Dev
  • Hero Member
  • *****
  • Karma: +816/-81
  • Offline Offline
  • Posts: 1610
    • View Profile
Re: account balance at certain block height - possible? How?
« Reply #1 on: March 30, 2016, 08:05:38 am »

If the height is within the last 800 blocks that have not yet been trimmed, we could add a height parameter to the getBalance API. But if you need the balance at an older height, this data is not kept unless you either set nxt.trimDerivedTables=false to keep all records, or increase nxt.maxRollback to cover back to the height you need. This is likely to make the database unusably slow.
For a one-off data retrieval, you can write a custom add-on that records the balance of the specific account(s) at the height of interest, and do a blockchain rescan to get that.
Or you can just enable nxt.debugTraceAccounts=*, or the account of interest, do a rescan, and look into nxt-trace.csv.
Logged
GPG key fingerprint: 263A 9EB0 29CF C77A 3D06  FD13 811D 6940 E1E4 240C
NXT-X4LF-9A4G-WN9Z-2R322

altsheets

  • Full Member
  • ***
  • Karma: +31/-1
  • Offline Offline
  • Posts: 232
  • check out #AAssetNXT #AltFolio and #AssetGraphs
    • View Profile
    • AssetGraphs-v2 live examples
Re: account balance at certain block height - possible? How?
« Reply #2 on: March 31, 2016, 12:28:40 pm »

Thanks a lot. So until now, not possible by default, good to know. Thx.

Yes please consider that extension, and if only in the past 800 blocks ... still useful.



All the other options - great.

> nxt.debugTraceAccounts
Yes, for my own accounts that sounds like a good way to go.
To observe other people's accounts, not so much.

> nxt.trimDerivedTables=false
Where can I find (a list of) full archive servers which I can query with such questions?

> This is likely to make the database unusably slow.
oops.


> you can write a custom ... that records the balance of the specific account(s) at the height of interest
In my one case I had thought about it before, and actually did exactly that.
Now I was wondering what to do if I had forgotten to record all balances before.


> nxt-trace.csv

I had to try out quite a few things, but the format is
    nxt.debugTraceAccounts=numericalaccountid01;numericalaccountid02;numericalaccountid03
and the accountRS format is not working at all.

... now I am waiting what happens when the blockchain is synced, and I send a tx to myself.


Thanks a lot!

Logged
AltFolio | Newbium DataSite | AAssetNXT & -HZ | AssetGraphs | ABEE | Advice | assetparser.py & shareholders.py | bamm.py | PeerCrawler | Github e.g. ChainCountDown, ethjsre | ... much more

altsheets

  • Full Member
  • ***
  • Karma: +31/-1
  • Offline Offline
  • Posts: 232
  • check out #AAssetNXT #AltFolio and #AssetGraphs
    • View Profile
    • AssetGraphs-v2 live examples
Re: account balance at certain block height - possible? How?
« Reply #3 on: March 31, 2016, 01:17:53 pm »

NICE

nxt-trace.csv

is filling up with all kinds of information about my traced accounts. That is cool.

Two suggestions:
* do not have it placed in the program folder, but in the data folder
* close the file after adding a row; to look inside, I needed to make a copy

But - wow, very useful function. Kudos.
Logged
AltFolio | Newbium DataSite | AAssetNXT & -HZ | AssetGraphs | ABEE | Advice | assetparser.py & shareholders.py | bamm.py | PeerCrawler | Github e.g. ChainCountDown, ethjsre | ... much more

Jean-Luc

  • Core Dev
  • Hero Member
  • *****
  • Karma: +816/-81
  • Offline Offline
  • Posts: 1610
    • View Profile
Re: account balance at certain block height - possible? How?
« Reply #4 on: March 31, 2016, 01:27:42 pm »

> nxt.trimDerivedTables=false
Where can I find (a list of) full archive servers which I can query with such questions?

There aren't such servers, this has nothing to do with archiving. I doubt anyone would configure their public node to disable trimming, it will be too slow to be usable. Trimming and pruning are different things.
Logged
GPG key fingerprint: 263A 9EB0 29CF C77A 3D06  FD13 811D 6940 E1E4 240C
NXT-X4LF-9A4G-WN9Z-2R322

altsheets

  • Full Member
  • ***
  • Karma: +31/-1
  • Offline Offline
  • Posts: 232
  • check out #AAssetNXT #AltFolio and #AssetGraphs
    • View Profile
    • AssetGraphs-v2 live examples
Re: account balance at certain block height - possible? How?
« Reply #5 on: April 01, 2016, 09:13:03 am »

alright. looks like I need to do some background reading.  :D
Logged
AltFolio | Newbium DataSite | AAssetNXT & -HZ | AssetGraphs | ABEE | Advice | assetparser.py & shareholders.py | bamm.py | PeerCrawler | Github e.g. ChainCountDown, ethjsre | ... much more

altsheets

  • Full Member
  • ***
  • Karma: +31/-1
  • Offline Offline
  • Posts: 232
  • check out #AAssetNXT #AltFolio and #AssetGraphs
    • View Profile
    • AssetGraphs-v2 live examples
Re: account balance at certain block height - possible? How?
« Reply #6 on: April 08, 2016, 02:34:57 pm »


...

The getBalance API now supports an optional height parameter to retrieve account
balance at previous heights, if still available.

...


Thanks a lot!
Logged
AltFolio | Newbium DataSite | AAssetNXT & -HZ | AssetGraphs | ABEE | Advice | assetparser.py & shareholders.py | bamm.py | PeerCrawler | Github e.g. ChainCountDown, ethjsre | ... much more
 

elective-stereophonic
elective-stereophonic
assembly
assembly