Tier 4 Fund Management Discussion

Fixed, chances are there is a lot of these things. Pull requests welcome :grinning:

This does exist: https://svr1.nubitsexplorer.nu/q
Unfortunately we having some issues with the database at the moment resulting in some exceptions thrown. Matthew is looking into it. The API works for older transactions though. Please let me know if it is useful and I might strengthen and monitor the server more closely going forward.

Any chance it can return unspent outputs for an address? I donā€™t see an API for that.

Also what are the available chains?? https://svr1.nubitsexplorer.nu/chain/NuBits/q/getblockcount

@MatthewLM Could you please comment on this? No idea what is required to expand the API.

The NuBits chain is the only available chain. As said we are currently having some issues with it so your getblockcount may work therefore.

@dysconnect, Iā€™m going to attempt some sleep.


Pushover is more flexible than email notifications. Message priority for example. I wouldnā€™t want all my emails as notifications only for potentially urgent FLOT messages.

@jooize You can make priority subcategories and only subscribe to emergency subcategory. Just a thought.


@dysconnect my pubkey 03661a4370dfcfbcea25d1800057220f4572b6eecab95bb0670e8676a9e34451dc

Still, how would I get only Nu Discourse emails in push notifications? It would be neat if Discourse could trigger a Pushover notification for those who want them.

email notice is meaningless when checking the forum is as easy as checking emails (actually checking the forum might even be easier when you use a port 25 email client at a place where port 25 is blocked).
i for one donā€™t have an android or apple device.

The point of email notification is that almost everyone nowadays receive email in real time to the phone or desktop.
I agree that otherwise it is actually easier to open the forum, but in that case, If you live ā€œdisconnectedā€ and donā€™t have an android or apple device, something like a phone number should be available for FLOT emergencies.

With my promised available time it shouldnā€™t be a problem to get online with a computer in time. You canā€™t sign with only a phone number anyway. I like to discuss in the forum instead of using another platform

Iā€™l get on this tommorow! Will post here.

The repository for the current state of the scripts is here:

Either git clone or download the zip. This is a command line tool, and youā€™ll need to have nud running (or nu -server). Thereā€™s very little error handling or robustness in the scripts, but enough for some actual use.

There are some basic personal settings in config.py. To start, you can rename config-example.py to config.py. Updates to the code will change config-example.py and pubconfig.py but not config.py.

1. Settings - Git

Skip this part if you don't know how to use git.
GIT_ENABLED = 0

To use git set this to 1. git is mainly used to synchronize with your own ā€œflot-operationsā€ repository, which maintains ā€œsnapshotsā€ of the tracked address; I recommend to fork from mine: https://github.com/dc-tcs/flot-operations , and post the url here.

Then, you can use the parameter MY_GIT to set the address of your repository for pushing.

Note that in this script git is basically called just from the command line; not a good idea if youā€™re using windows or OSX, because I donā€™t know how git works on those.

2. Set RPC port, username and password

RPC_PORT = 14002
RPC_USERNAME = "XXXXX"
RPC_PASSWORD = "YYYYY"

The script makes calls using jsonrpc. Remember to set rpcuser and rpcpassword in nu.conf, and use the same strings in place of XXXXX and YYYYY. Most likely the port is 14002 for the mainnet and 15002 for the testnet.

There are some other shared settings in pubconfig.py like the following:

ADDRESS = "BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js"
ADDRESSES = set([])
PUBKEYS = ["034b0bd0f653d4ac0a2e9e81eb1863bb8e5743f6cb1ea40d845b939c225a1a80ff","02a144af74d018501f03d76ead130433335f969772792ec39ce389c8a234155259","03661a4370dfcfbcea25d1800057220f4572b6eecab95bb0670e8676a9e34451dc","0234139729dd413c84a71a0bfd6f236790be861b37311cef3240277c940e4b0c07","02547427fc2ea3a0ab9ef70f5e1640ff5112b113f65696948f992bd0770b942571"]
SIGN_THRESHOLD = 3

Most likely you donā€™t need to change anything pubconfig.py . Iā€™ll publish changes myself or someone else can help.

3. How to use

You can use this script running either nud or nu -server. In the latter case, you would still have access to the qt interface.

After setting the above, thereā€™s basically only one way to use this script:

> python main.py --recipient RECIPIENT_ADDRESS --amount SEND_AMOUNT

The script first tries to sync the address balance with the blockchain (or download it from REFERENCE_URLS set in config.py), forms the transaction, and spits out the hex. Use decoderawtransaction to check that the content makes sense.

An example output:

$ python main.py --recipient B5Zi5XJ1sgS6mWGu7bWJqGVnuXwiMXi7qj --amount 999.9
Updating address snapshot...
Done.

This is your transaction hex:
010000004e05505601d1c30e31b4dd598332b155d9074f1ed98a75dacb39b1ee5aff5648f28a3ae2ab0000000000ffffffff0298929800000000001976a9140c390f04c4022947b6493cfa5beefa45e306970e88ac48a1a60b000000001976a914f8e77eac0ffff17e4294cdcae6e7b6e3c1fcb4d288ac0000000042

4. Misc

There are more parameters in config.py though they don't really need to be set by the user. I'll set them when they're ready, though it would also be helpful that someone else does it.
4 Likes

Sorry for the delay. I ll give you an instance of pubkey in a few hours. I use win right now.

If you have nud running, see if you can run the script with

python main.py --recipient B5Zi5XJ1sgS6mWGu7bWJqGVnuXwiMXi7qj --amount 999.9

It should be possible to extend Abe to provide unspent outputs for an address. The pubkey table has a pubkey_hash field. The pubkey_id can be used to lookup txouts, but the pubkey_id field in the txout table would need an index. Or maybe txout_scriptPubKey could be used. The txouts would need to not have a corresponding txin to be unspent.

I was planning on trying it out on windows first but it seems it might be better to straight away set this up on my rasppi with linux right? Seeing as your explanation is relevant to linux if Iā€™m correct.

It should be possible to run it on windows (with nud running, setting full path) but Iā€™m not very sure how.

First youā€™ll need to set like NUD_PATH = ā€œC:\\PATH_TO_NUD\\nudā€ in config.py, notice the double backslashes. To run Python like that you may need to add python to the PATH environment variable, and you may even need to add the entire project folder somewhere like this: http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7

Though on Linux everything is more straightforward.

NOTE UPDATE: RPC call directly made at nud is deprecated. NUD_PATH etc. is no longer relevant.

Planning on having it on linux in the future anyway so might as well do so with the testing to.

Thanks for creating that tool!
Iā€™m looking forward to testing it.

Iā€™m currently syncing the testnet blockchain.
BT9AWq9r1i6kghZc6LtrvNb2wRFh7JLCdP doesnā€™t look like a testnet NBT address, though. Do we start on the real blockchain?

I donā€™t know of a testnet address with positive balance. By the way, you should still be able to create an address and pubkey while syncing the blockchain.