Permissions consensus tutorial fails

+2 votes
getnewaddress works then i try

grantfrom XXX XXX admin

I get an error every time no matter that address:

error code: -5

error message:

Private key for from-address is not found in this wallet
asked Jul 6, 2017 by Matt
Can you paste a fuller transcript of what you're doing, as well as the output of the listaddresses command? It's quite safe for you to post addresses here, they're only hashes of public keys, and in any event nobody has any idea how to connect to your blockchain.
I am doing the grantfrom command on the node which owns the 1PFXaBD4SmD6Vd7PN2LkvEfGZZCx2S8SZG6voV address.
But when you pasted the output of listaddresses, 1PFXaBD4SmD6Vd7PN2LkvEfGZZCx2S8SZG6voV did not appear in the list. So please check the other nodes.
I did. Still doesn’t work. Please have someone update that tutorial with steps that work so we can duplicate it. Nothing I'm doing is working like it's posted even though my chain is running fine.
Did you find the node where this address was listed in the output from listaddresses? The tutorial explicitly attempts to avoid this complication by suggesting you do everything on one node, so please follow the instructions as written.
I'm following it EXACTLY as written. I'm on the primary node.
That address is what is returned when i follow the EXACT written instructions.

There's a piece missing somewhere. It doesn’t work as written.
I just went through the tutorial on a brand new chain and couldn't see a problem. Transcript pasted below.
$ multichaind chain0 -daemon

MultiChain Core Daemon build 1.0 beta 2 protocol 10008

MultiChain server starting
Looking for genesis block...
Genesis block found

Other nodes can connect to this node using:
multichaind chain0@[removed]

Node started
$ multichain-cli chain0

MultiChain Core RPC client build 1.0 beta 2 protocol 10008


Interactive mode

chain0: getblockchainparams
{"method":"getblockchainparams","params":[],"id":1,"chain_name":"chain0"}

{
    "chain-protocol" : "multichain",
    "chain-description" : "MultiChain chain0",
    "root-stream-name" : "root",
    "root-stream-open" : true,
    "chain-is-testnet" : false,
    "target-block-time" : 15,
    "maximum-block-size" : 8388608,
    "default-network-port" : 6725,
    "default-rpc-port" : 6724,
    "anyone-can-connect" : false,
    "anyone-can-send" : false,
    "anyone-can-receive" : false,
    "anyone-can-receive-empty" : true,
    "anyone-can-create" : false,
    "anyone-can-issue" : false,
    "anyone-can-mine" : false,
    "anyone-can-activate" : false,
    "anyone-can-admin" : false,
    "support-miner-precheck" : true,
    "allow-p2sh-outputs" : true,
    "allow-multisig-outputs" : true,
    "setup-first-blocks" : 1,
    "mining-diversity" : 0.30000000,
    "admin-consensus-upgrade" : 0.50000000,
    "admin-consensus-admin" : 0.60000000,
    "admin-consensus-activate" : 0.50000000,
    "admin-consensus-mine" : 0.50000000,
    "admin-consensus-create" : 0.80000000,
    "admin-consensus-issue" : 0.00000000,
    "lock-admin-mine-rounds" : 10,
    "mining-requires-peers" : true,
    "mine-empty-rounds" : 10.00000000,
    "mining-turnover" : 0.50000000,
    "first-block-reward" : -1,
    "initial-block-reward" : 0,
    "reward-halving-interval" : 52560000,
    "reward-spendable-delay" : 1,
    "minimum-per-output" : 0,
    "maximum-per-output" : 100000000000000,
    "minimum-relay-fee" : 0,
    "native-currency-multiple" : 100000000,
    "skip-pow-check" : false,
    "pow-minimum-bits" : 8,
    "target-adjust-freq" : -1,
    "allow-min-difficulty-blocks" : false,
    "only-accept-std-txs" : true,
    "max-std-tx-size" : 4194304,
    "max-std-op-returns-count" : 10,
    "max-std-op-return-size" : 2097152,
    "max-std-op-drops-count" : 5,
    "max-std-element-size" : 8192,
    "chain-name" : "chain0",
    "protocol-version" : 10008,
    "network-message-start" : "f3f3c7f9",
    "address-pubkeyhash-version" : "00752747",
    "address-scripthash-version" : "05f970c0",
    "private-key-version" : "800df377",
    "address-checksum-value" : "12ba8e16",
    "genesis-pubkey" : "03e47b52208531d9c9180ef8f173e009fe9bc16ea1ea4298e6a42192461f17b995",
    "genesis-version" : 1,
    "genesis-timestamp" : 1499536961,
    "genesis-nbits" : 536936447,
    "genesis-nonce" : 600,
    "genesis-pubkey-hash" : "3a786bb78e27e1c13f00272d0333e762a46d51a8",
    "genesis-hash" : "0037b52c2192d49c054c29fccd4eeb8a66be3454155456bebd382a1a18af87b2",
    "chain-params-hash" : "c02c783eebd237b5b1159dac821a7dedd1ba39a0e3152e034f12911abf58e180"
}
chain0: listpermissions admin
{"method":"listpermissions","params":["admin"],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    }
]
chain0: listaddresses
{"method":"listaddresses","params":[],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt",
        "ismine" : true
    }
]
chain0: getnewaddress
{"method":"getnewaddress","params":[],"id":1,"chain_name":"chain0"}

16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd
chain0: grantfrom 18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt 16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd admin
{"method":"grantfrom","params":["18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt","16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd","admin"],"id":1,"chain_name":"chain0"}

ff67380cdcd08245d5b54d57e18b321186503b342d71f343c80cd5353fce7bec
chain0: listpermissions admin
{"method":"listpermissions","params":["admin"],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    }
]
chain0: getnewaddress
{"method":"getnewaddress","params":[],"id":1,"chain_name":"chain0"}

1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL
chain0: grantfrom 18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt 1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL admin
{"method":"grantfrom","params":["18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt","1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL","admin"],"id":1,"chain_name":"chain0"}

282ba9627c9102ad27647b252471e21de1c21d11c44d898d574814c6279f94b8
chain0: listpermissions admin
{"method":"listpermissions","params":["admin"],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    }
]
chain0: listpermissions admin 1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL true
{"method":"listpermissions","params":["admin","1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL",true],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 0,
        "admins" : [
        ],
        "pending" : [
            {
                "startblock" : 0,
                "endblock" : 4294967295,
                "admins" : [
                    "18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt"
                ],
                "required" : 1
            }
        ]
    }
]
chain0: grantfrom 16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd 1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL admin
{"method":"grantfrom","params":["16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd","1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL","admin"],"id":1,"chain_name":"chain0"}

21f0b84285c5859e35b310bfcef514d95655f2a7f33d18f0fe65e81a4685b708
chain0: listpermissions admin
{"method":"listpermissions","params":["admin"],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    }
]
chain0: getnewaddress        
{"method":"getnewaddress","params":[],"id":1,"chain_name":"chain0"}

1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd
chain0: grantfrom 16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd 1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd create
{"method":"grantfrom","params":["16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd","1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd","create"],"id":1,"chain_name":"chain0"}

9a309b467d72eaf3fe21fbc7ad3ef21a7e920d2e1095c799b4b6757c14705c65
chain0: listpermissions * 1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd
{"method":"listpermissions","params":["*","1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd"],"id":1,"chain_name":"chain0"}

[
]
chain0: listpermissions * 1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd true
{"method":"listpermissions","params":["*","1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd",true],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd",
        "for" : null,
        "type" : "create",
        "startblock" : 0,
        "endblock" : 0,
        "admins" : [
        ],
        "pending" : [
            {
                "startblock" : 0,
                "endblock" : 4294967295,
                "admins" : [
                    "16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd"
                ],
                "required" : 2
            }
        ]
    }
]
chain0: grantfrom 1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL 1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd create
{"method":"grantfrom","params":["1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL","1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd","create"],"id":1,"chain_name":"chain0"}

c1a757f111b9f81e058a2bbbbb33d035d25ddf9a83d21f7e2d6be0ba93bdccdc
chain0: listpermissions * 1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd true
{"method":"listpermissions","params":["*","1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd",true],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd",
        "for" : null,
        "type" : "create",
        "startblock" : 0,
        "endblock" : 0,
        "admins" : [
        ],
        "pending" : [
            {
                "startblock" : 0,
                "endblock" : 4294967295,
                "admins" : [
                    "1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL",
                    "16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd"
                ],
                "required" : 1
            }
        ]
    }
]
chain0: grantfrom 18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt 1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd create
{"method":"grantfrom","params":["18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt","1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd","create"],"id":1,"chain_name":"chain0"}

e9729518b05c1cab59fed09cd901492e8b3b53ed8faad357e58905296f6617b6
chain0: listpermissions * 1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd
{"method":"listpermissions","params":["*","1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd"],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd",
        "for" : null,
        "type" : "create",
        "startblock" : 0,
        "endblock" : 4294967295
    }
]
chain0: listpermissions * 1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd true
{"method":"listpermissions","params":["*","1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd",true],"id":1,"chain_name":"chain0"}

[
    {
        "address" : "1HcVdKHQnxuJ2u97wcv79jyYnrk4AuzbdJqpcd",
        "for" : null,
        "type" : "create",
        "startblock" : 0,
        "endblock" : 4294967295,
        "admins" : [
            "18uMBg3ev2RxHjjeMJyRfnwVUb3PbtChn8poYt",
            "1QTckNppQPxqa8mCf2VE5UwMXyrQqNYm1DgbLL",
            "16LwHYkTG9j8JDxonKemeUhq5nXtNrkhr494cd"
        ],
        "pending" : [
        ]
    }
]
chain0:
Please post your own transcript so we can see where they are diverging.

1 Answer

0 votes
There's not much to post. I'm just getting that error.

 

karma: listpermissions admin                                                                        

{"method":"listpermissions","params":["admin"],"id":1,"chain_name":"karma"}

 

[

    {

        "address" : "1PFXaBD4SmD6Vd7PN2LkvEfGZZCx2S8SZG6voV",

        "for" : null,

        "type" : "admin",

        "startblock" : 0,

        "endblock" : 4294967295

    }

]

karma: grantfrom 1PFXaBD4SmD6Vd7PN2LkvEfGZZCx2S8SZG6voV 1CD3G8AdGXeJthg7Bwqfjht2grgNAF4Y6KWdtw admin

{"method":"grantfrom","params":["1PFXaBD4SmD6Vd7PN2LkvEfGZZCx2S8SZG6voV","1CD3G8AdGXeJthg7Bwqfjht2grgNAF4Y6KWdtw","admin"],"id":1,"chain_name":"karma"}

 

error code: -5

error message:

Private key for from-address is not found in this wallet

karma: getnewaddress                                                                                

{"method":"getnewaddress","params":[],"id":1,"chain_name":"karma"}

 

1vTmg2dfUKvJTQcfwBWr9Rg4AqsChsqojHLMz

karma:
answered Jul 6, 2017 by matttrainer
We need to see the output of listaddresses because the error suggests that the address 1PFXaBD4SmD6Vd7PN2LkvEfGZZCx2S8SZG6voV was not created in the node you are issuing this command from.
Interactive mode

karma: listaddresses
{"method":"listaddresses","params":[],"id":1,"chain_name":"karma"}

[
    {
        "address" : "1LHFR3kCnF2Xgbv3rdwyVZM3LzYuQNEAJ9b41D",
        "ismine" : true
    },
    {
        "address" : "1PDrsFdLusfqSBzhrzQkMfKy6QwmztCntEAzxr",
        "ismine" : true
    },
    {
        "address" : "1QeiLB17jfQMREmg75Z9my65HKPJNTpwgswaQo",
        "ismine" : true
    },
    {
        "address" : "1XG6t3qhugYkYSgBkH1n7kjwSU4tD1SJpdRKsD",
        "ismine" : true
    },
    {
        "address" : "1CD3G8AdGXeJthg7Bwqfjht2grgNAF4Y6KWdtw",
        "ismine" : true
    },
    {
        "address" : "1vTmg2dfUKvJTQcfwBWr9Rg4AqsChsqojHLMz",
        "ismine" : true
    }
]
So this node does not appear to have 1PFXaBD4SmD6Vd7PN2LkvEfGZZCx2S8SZG6voV in its wallet, which would explain the error message. Where did you get that address from?
I got it from following the tutorial. CLI output below.

karma: listpermissions admin
{"method":"listpermissions","params":["admin"],"id":1,"chain_name":"karma"}

[
    {
        "address" : "1PFXaBD4SmD6Vd7PN2LkvEfGZZCx2S8SZG6voV",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    }
]
karma:
How many nodes in this chain?
If more than one, use listaddresses on each to see who owns that address. The fact it's shown in listpermissions doesn't mean every node can use it.
There are 3 nodes but I'm working on the admin of the first node. I’m missing something. I'm just following the tutorial and got stuck.

I ran listpermissions on other nodes but not sure what that does for me? It's a wallet issue? So confused.

If I get the admin address and then use that to set admin rights on new address, that all makes sense like the tutorial lays out but I'm missing something that's not in the tutorial.
The listpermissions and listaddresses commands are two different things. If you run listaddresses on each node you'll get a different answer, showing the addresses that belong to that particular node. You need to run the grantfrom command on the node which owns the 1PFXaBD4SmD6Vd7PN2LkvEfGZZCx2S8SZG6voV address.
...