State Export / Airdrop
Getting all balances with some token held. Useful for airdrops.
Native (JUNO) Export
To airdrop, you will need a state export file. These come from a full node that is synced up to the network and stopped. These nodes typically only hold 30 days' worth of data, so ensure you take an export between now and 30 days ago. You can ensure your height is within this time by checking Mintscan.
Automatic exports can be found here for convenience https://exports.reece.sh/juno/. Downloading from here allows you to skip the rest of this guide. For this guide, you will need to setup a node from this guide. You do not need a validator to do this. Once your node is running and at the latest block, do the following.
# stop the juno node from running then
cd ~/.juno/
junod export HEIGHT-HERE > juno_state_export.json
# Where HEIGHT-HERE is the block height you want, for example 7000000Once the command exits, check your file size. It should be large. If it only shows 4KB, then you have not exported the state correctly due to an issue with height or version. This will have been output in the file itself, so follow the error to fix the reason it could not export correctly. You can check the file size like so
du -sh juno_state_export.jsonThen check to ensure the file is valid and no extra logs got into your JSON. If the below fails, there is likely text at the top of your file that you need to remove from logs
cat juno_state_export.json | python -c "import sys,json;json.loads(sys.stdin.read());print 'OK'"Once the above is complete, you are ready to follow the write scripts to parse, edit, and get the data into a format for your needs. You most likely need to stream the file in most languages due to the size. Here is an example in python for streaming the sections.
CW20 Balances
This section will require you to run 2 scripts which gets all balances held at a select block on chain.\
Last updated
Was this helpful?