Tier 4 Fund Management Discussion

I haved tried to run python main.py --recipient BXKidrUiYNgRmDeDX61k6 CASEJ2HjM8pUF --amount 0.12. The scripts starts but asked rpcusername and pword many times like this

Enter username for jsonrpc at 127.0.0.1:14002: xxx
Enter password for flotty in jsonrpc at 127.0.0.1:14002:
Multisig address seems valid.
Snapshot of BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js not found on disk.
Trying to fetch online…
Newest remote snapshot for BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js found at: dc-tcs
Updating address snapshot…
Enter username for jsonrpc at 127.0.0.1:14002: xxx
Enter password for flotty in jsonrpc at 127.0.0.1:14002:

I think the reason for asking username and passwd is that I start nu with a non-standard directory with these command line options -conf=d:\foo\bar\nu.conf -datadir=d:\foo\bar\. How do I tell main.py where to look for nu.conf ?

Did you set up the rpc username and password in config.py?

Yes. Note that after I typed in user name and password the script went on. Seems it talked with nu successfully?

I just run nud.exe -conf=d:\foo\bar\nu.conf -datadir=d:\foo\bar\ getinfo and it worked

1 Like

The script no longer runs nud directly, it makes http requests to the RPC server within nu -server or nud. If the RPC server runs correctly things should be ok.

I find the multisig address in the receive address list of the wallet so at least we know the script and the server can work together.

1 Like

Apologies. Server is still in maintenance, rebuilding the database. See notification here.

I’m a bit behind testing the scripts, but will be up-to-date soon.
Thank you, @dysconnect and @ttutdxh for your efforts of creating the scripts and the rest of the FLOT to contribute in getting this started!
Looking forward to working with you guys!

Is Python version 3 required for https://github.com/dc-tcs/git-multisig?
I get this error trying out main-py:

python main.py --recipient B5Zi5XJ1sgS6mWGu7bWJqGVnuXwiMXi7qj --amount 1.0
  File "main.py", line 48
    subprocess.call(['git','clone',config.MY_GIT, config.DATA_DIR)
                                                                 ^
SyntaxError: invalid syntax

I have Python 2.7 installed because of the ALP bots:

python --version
Python 2.7.3
python --version
Python 2.7.10

subprocess.call(['git','clone',config.MY_GIT, config.DATA_DIR)

Lacks a closing ]. I don’t know where it should be.

grep subprocess *
[...]
sync.py:    subprocess.call(['git', '-C', git_folder, 'add', '-A'])
sync.py:    subprocess.call(['git', '-C', git_folder, 'commit', '-m', str(time.time())])
sync.py:    subprocess.call(['git', '-C', git_folder, 'push', 'origin', 'master'])
[...]

@dysconnect: Help. :smile:

Never mind, I think my brain decided to work again.

It would become git clone <MY_GIT> <DATA_DIR> as set in config, so:

subprocess.call(['git', 'clone', config.MY_GIT, config.DATA_DIR])

Right?

Yeah sorry for being careless. Fixed in the repo.

Works! Pushes to GitHub too.

What is the flot-operations repository used for?

python main.py --recipient BXKidrUiYNgRmDeDX61k6CASEJ2HjM8pUF --amount 0.1
Multisig address seems valid.
Updating address snapshot...
[master 3aa5c73] 1448311311.94
 1 file changed, 6 insertions(+), 3 deletions(-)
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 387 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
To git@github.com:jooize/flot-operations.git
   42b9c9a..3aa5c73  master -> master
Done.

This is your transaction hex:
01000000127a535602bb2a539844c41f845d68a66baeb26765572af93801f0f3ca46f1f85c0e6edf610000000000fffffffffdd47933815da84323e55aa139e59cd355c26984bb5a6f3ff9eb5b0e12b8daad0100000000ffffffff02e80300000000000017a91426c6f88ca8a0a47b6a015eac69c442b12f715e9f873c0f00000000000017a914f35b24f264597d66ba8c366a5005824bb6a06138870000000042

It’s used for storing unspent outputs of the address in pubconfig.py. If one person git pushes it will be up-to-date. Then it can be retrieved by software that does not have access to the blockchain.

Ahh, neat.

facepalm could have recognized that myself…
Well spotted, @jooize!

Fixed that. Next error:

 python main.py --recipient BXKidrUiYNgRmDeDX61k6CASEJ2HjM8pUF --amount 0.1
Traceback (most recent call last):
  File "main.py", line 19, in <module>
    import chainutils as nbtutil
  File "/home/pi/git-multisig/chainutils.py", line 21, in <module>
    import config
ImportError: No module named config

It seems I don’t know how to use this fine piece of software… :frowning:
My pubconfig.py looks like this - with the right nud rpc parameters of course:

cat pubconfig.py
import os

#ADDRESS: Multisig address
#ADDRESSESS: Constituents of the Multisig address
#These scripts can only track 1 address for now
ADDRESS = "BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js"
ADDRESSES = set([])
PUBKEYS = ["034b0bd0f653d4ac0a2e9e81eb1863bb8e5743f6cb1ea40d845b939c225a1a80ff","02a144af74d018501f03d76ead130433335f969772792ec39ce389c8a234155259","03661a4370dfcfbcea25d1800057220f4572b6eecab95bb0670e8676a9e34451dc","0234139729dd413c84a71a0bfd6f236790be861b37311cef3240277c940e4b0c07","02547427fc2ea3a0ab9ef70f5e1640ff5112b113f65696948f992bd0770b942571"]
SIGN_THRESHOLD = 3

#URLs of folders from which to download address snapshots (spendable outputs etc)
#Format should be like this:
#REFERENCE_URLS = {"foo" : "https://bar", "foo2" : "https://bar2", "foo3" : "https://bar3"}
REFERENCE_URLS = {"dc-tcs" : "https://raw.githubusercontent.com/dc-tcs/flot-operations/master",
        "jooize" : "https://raw.githubusercontent.com/jooize/flot-operations/master"}

GIT_ENABLED = 0
RPC_PORT = xxx
RPC_USER = xxx
RPC_PASSWORD = xxx

You’ll need to look at config-example.py and create a file called config.py. I did it this way so you can directly git pull from git-multisig without affecting your personal settings.

Ah! I’ll try - didn’t read Tier 4 Fund Management Discussion careful enough and edited only pubconfig.py (inserting the rpc config there), but not config.py

Sorry for the trouble I caused.
Works great now!

python main.py --recipient BXKidrUiYNgRmDeDX61k6CASEJ2HjM8pUF --amount 0.1
Address does not match given public keys (note that order matters)
Snapshot of BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js not found on disk.
Trying to fetch online...
Newest remote snapshot for BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js found at: dc-tcs
Updating address snapshot...
Done.

This is your transaction hex:
01000000a382535602bb2a539844c41f845d68a66baeb26765572af93801f0f3ca46f1f85c0e6edf610000000000fffffffffdd47933815da84323e55aa139e59cd355c26984bb5a6f3ff9eb5b0e12b8daad0100000000ffffffff02e80300000000000017a91426c6f88ca8a0a47b6a015eac69c442b12f715e9f873c0f00000000000017a914f35b24f264597d66ba8c366a5005824bb6a06138870000000053

Sorry for the trouble caused by the buggy software. If you feel comfortable that it git pushes, you can fork flot-operations and enable git, which will cause you to git push and update the address snapshot. After enabling git you should remove the flot-operations folder (just this once) before running the script again. Thanks for testing.

It’s weird that your first line failed despite a correct pubconfig.py; are you running on testnet?

Will do!
The script works fine if I don’t mess with the RTFM part :wink:

No, but I created a blank wallet in which I’m going to have only my key pair associated with the multisig address. Haven’t imported the private key yet…

It should work without any private key, as it only checks the sanity of pubconfig.py. Perhaps the blank wallet is read-only? By the way I’ve just forgotten a crucial part: for various use cases you need txindex=1 in nu.conf… I hope this wasn’t a problem for @jooize.

I’d be stopping with my spam messages here in the thread and continue via PM if I didn’t think this might help others…

After

  • forking flot-operation into my github account
  • enabling SSH for this github account
  • adding the SSH private key to the key agent of my RaspberryPi
  • deleting the flot-operations folder from git-multisig/on my RaspberryPi and
  • enabling git for git-multisig I get a new error:
python main.py --recipient BXKidrUiYNgRmDeDX61k6CASEJ2HjM8pUF --amount 0.1
Address does not match given public keys (note that order matters)
Cloning into './flot-operations'...
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
remote: Counting objects: 412, done.
remote: Compressing objects: 100% (65/65), done.
remote: Total 412 (delta 36), reused 0 (delta 0), pack-reused 326
Receiving objects: 100% (412/412), 32.38 KiB, done.
Resolving deltas: 100% (50/50), done.
Updating address snapshot...
Unknown option: -C
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [-c name=value] [--help]
           <command> [<args>]
Unknown option: -C
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [-c name=value] [--help]
           <command> [<args>]
Unknown option: -C
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [-c name=value] [--help]
           <command> [<args>]
Done.

This is your transaction hex:
01000000538a535602bb2a539844c41f845d68a66baeb26765572af93801f0f3ca46f1f85c0e6edf610000000000fffffffffdd47933815da84323e55aa139e59cd355c26984bb5a6f3ff9eb5b0e12b8daad0100000000ffffffff02e80300000000000017a91426c6f88ca8a0a47b6a015eac69c442b12f715e9f873c0f00000000000017a914f35b24f264597d66ba8c366a5005824bb6a06138870000000053

I understand nothing, I’m Jon Snow.

Forces a reindexing of the blockchain files (which might take some time on a RaspberryPi…), right?