Tier 4 Fund Management Discussion

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?

What is the number at the top of the unspent file? Says 627283 in mine and 627286 (+3) in yours. Aaand the other lines, if you have time.

I donā€™t have that, so I guess it isnā€™t needed for what Iā€™ve done this far. Iā€™ll put it there.

Doesnā€™t seem like that.

?
Nope:

Oh right, sorry. I meant that first part to @dysconnect!

:stuck_out_tongue_winking_eye: I think I give up for now and prepare for a fresh attempt laterā€¦

The first line is the highest block that youā€™ve synced. Just a way to keep track of stuff. The rest lists the unspent outputs.

@masterofdisaster Looks like youā€™re running an older version of git. Iā€™ll find a way that doesnā€™t require that.

2 Likes

My RaspberryPi runs

git --version
git version 1.7.10.4

Iā€™m sorry that I have no coding skills and canā€™t find those answers myself. The script you provided looks very impressive and using github (because it can be viewed publicly) as a place to store and update information automatically is awesome!

Yeah it uses a feature introduced in git 1.8.5ā€¦ itā€™s not crucial right now, I can find a way around it. You can assume youā€™d be ready after you update git or Iā€™ve updated my scripts (and cleared the bugs). Sorry for the mess.

@jooize @masterOfDisaster
Sorry to bother you with this, I still want to see whether txindex=1 is really required. If you do not have txindex=1 (or set it without -reindex), does the following rpc command work?

getrawtransaction addab8120e5bebf93f6f5abb8469c255d39ce539a15ae52343a85d813379d4fd 1

The git version 1.7.10.4 is the most recent in the Raspbian repos.

Iā€™m neither keen for compiling git from source nor using backports. The more adjustments, the harder to restore if something breaks before the next full backup - normally I try to keep my Raspbian as close to standard as possible.
Iā€™d really appreciate if you could find a way around that feature.
If it makes too much trouble (you already put a lot of efforts into this script, I guess), Iā€™m compiling git from source![quote=ā€œdysconnect, post:222, topic:2902ā€]
does the following rpc command work?

getrawtransaction addab8120e5bebf93f6f5abb8469c255d39ce539a15ae52343a85d813379d4fd 1
[/quote]

Result (without txindex=1 in nu.conf):

nud -unit=B getrawtransaction addab8120e5bebf93f6f5abb8469c255d39ce539a15ae52343a85d813379d4fd 1
{
    "hex" : "01000000c0535256011266afa53b463bbd05b71433014115d3e90cc638774189db05a30d8eaf2f77e501000000fd8c0100493046022100909aa3b88a39997e621fa760ab54865777c66a1bd7b8b4642de703c5a76ed704022100de44517cbe293fe411aff5ceb72eb55f843e48feb10a190bbe131b9a2a9a60150149304602210095fd894c2b3ab1919b565cdc39325e92953908604ef031490c539031dc9baa2f022100cb1e4da9db1a0b0ce639f84e24dd1b3530c6ddbc3c4ceaea36e271f1fa66da2f014730440220580b8b35332a3ae1b3d6505fbb116fa28afa6937c55384dea8871c43cab65cbd02202d00ab9fc813c5884386d9a11147e29ae6c58d1192a56bdf5fff1acfdba7bba0014cad5321034b0bd0f653d4ac0a2e9e81eb1863bb8e5743f6cb1ea40d845b939c225a1a80ff2102a144af74d018501f03d76ead130433335f969772792ec39ce389c8a2341552592103661a4370dfcfbcea25d1800057220f4572b6eecab95bb0670e8676a9e34451dc210234139729dd413c84a71a0bfd6f236790be861b37311cef3240277c940e4b0c072102547427fc2ea3a0ab9ef70f5e1640ff5112b113f65696948f992bd0770b94257155aeffffffff02e80300000000000017a91426c6f88ca8a0a47b6a015eac69c442b12f715e9f873c0f00000000000017a914f35b24f264597d66ba8c366a5005824bb6a06138870000000042",
    "txid" : "addab8120e5bebf93f6f5abb8469c255d39ce539a15ae52343a85d813379d4fd",
    "version" : 1,
    "time" : 1448235968,
    "locktime" : 0,
    "unit" : "B",
    "vin" : [
        {
            "txid" : "e5772faf8e0da305db89417738c60ce9d31541013314b705bd3b463ba5af6612",
            "vout" : 1,
            "scriptSig" : {
                "asm" : "0 3046022100909aa3b88a39997e621fa760ab54865777c66a1bd7b8b4642de703c5a76ed704022100de44517cbe293fe411aff5ceb72eb55f843e48feb10a190bbe131b9a2a9a601501 304602210095fd894c2b3ab1919b565cdc39325e92953908604ef031490c539031dc9baa2f022100cb1e4da9db1a0b0ce639f84e24dd1b3530c6ddbc3c4ceaea36e271f1fa66da2f01 30440220580b8b35332a3ae1b3d6505fbb116fa28afa6937c55384dea8871c43cab65cbd02202d00ab9fc813c5884386d9a11147e29ae6c58d1192a56bdf5fff1acfdba7bba001 5321034b0bd0f653d4ac0a2e9e81eb1863bb8e5743f6cb1ea40d845b939c225a1a80ff2102a144af74d018501f03d76ead130433335f969772792ec39ce389c8a2341552592103661a4370dfcfbcea25d1800057220f4572b6eecab95bb0670e8676a9e34451dc210234139729dd413c84a71a0bfd6f236790be861b37311cef3240277c940e4b0c072102547427fc2ea3a0ab9ef70f5e1640ff5112b113f65696948f992bd0770b94257155ae",
                "hex" : "00493046022100909aa3b88a39997e621fa760ab54865777c66a1bd7b8b4642de703c5a76ed704022100de44517cbe293fe411aff5ceb72eb55f843e48feb10a190bbe131b9a2a9a60150149304602210095fd894c2b3ab1919b565cdc39325e92953908604ef031490c539031dc9baa2f022100cb1e4da9db1a0b0ce639f84e24dd1b3530c6ddbc3c4ceaea36e271f1fa66da2f014730440220580b8b35332a3ae1b3d6505fbb116fa28afa6937c55384dea8871c43cab65cbd02202d00ab9fc813c5884386d9a11147e29ae6c58d1192a56bdf5fff1acfdba7bba0014cad5321034b0bd0f653d4ac0a2e9e81eb1863bb8e5743f6cb1ea40d845b939c225a1a80ff2102a144af74d018501f03d76ead130433335f969772792ec39ce389c8a2341552592103661a4370dfcfbcea25d1800057220f4572b6eecab95bb0670e8676a9e34451dc210234139729dd413c84a71a0bfd6f236790be861b37311cef3240277c940e4b0c072102547427fc2ea3a0ab9ef70f5e1640ff5112b113f65696948f992bd0770b94257155ae"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.1,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_HASH160 26c6f88ca8a0a47b6a015eac69c442b12f715e9f OP_EQUAL",
                "hex" : "a91426c6f88ca8a0a47b6a015eac69c442b12f715e9f87",
                "type" : "scripthash",
                "reqSigs" : 1,
                "addresses" : [
                    "BXKidrUiYNgRmDeDX61k6CASEJ2HjM8pUF"
                ]
            }
        },
        {
            "value" : 0.39,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_HASH160 f35b24f264597d66ba8c366a5005824bb6a06138 OP_EQUAL",
                "hex" : "a914f35b24f264597d66ba8c366a5005824bb6a0613887",
                "type" : "scripthash",
                "reqSigs" : 1,
                "addresses" : [
                    "BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js"
                ]
            }
        }
    ],
    "blockhash" : "57d1a457090ce9e7c58e6cacf3171e3191c5edd2abc6fc58a3eb14532855ecd4",
    "confirmations" : 1096,
    "blocktime" : 1448239930
}

It appears to work without txindex=1. I havenā€™t put it in nu.conf yet, and itā€™s not there already.

The output is large, but do you want it? Oh, the boxes scroll! Well, thatā€™s what I get too.