first connection "insufficient funds" error code -4

+1 vote
2 virtual boxes set up

generated wallet in second box

Attempting to grant connection permission to chain1 on first box this is what I get:

multichain-cli chain1 grant 1FUc6zjhMmR5zw8ap1JEVVrXjFpMQJ58YT4uN8 connect
{"method":"grant","params"["1FUc6zjhMmR5zw8ap1JEVVrXjFpMQJ58YT4uN8","connect"],"id":1,"chain_name":"chain1"}

error code: -4
error message:
Insufficient funds

Where do I go from here?
asked Oct 15, 2016 by yavorcik

1 Answer

0 votes
You should grant permission from the node which started the chain to the other node, not the other way round. Or did I misunderstand what you're doing?
answered Oct 15, 2016 by MultiChain
yes, i think you misunderstood.

I started the node on VM Machine 1
I received this:
"New users can connect to this node using
multichaind chain1@192.168.0.6:7767"

I then went to VM 2 and entered the following command:
multichaind chain1@192.168.0.6:7767

Vm 2 said: Blockchain successfully initalized
Please ask admin to let you connect and it provided: "multichain-cli chain1 grant 1FUc6zjhMmR5zw8ap1JEVVrXjFpMQJ58YT4uN8 connect"

So I went back to VM1 and entered:
"multichain-cli chain1 grant 1FUc6zjhMmR5zw8ap1JEVVrXjFpMQJ58YT4uN8 connect"

And than i get this:
error code: -4
error message:
Insufficient funds

Not sure why VM1 the first node is not allowing VM2 to connect?

Help please ?

Thanks
Please post the output from getblockchainparams so we can understand your settings.
Now I get this:

MultiChain Core Daemon build 1.0 alpha 24 protocol 10006

ERROR: Parameter set for blockchain getblockchainparams is not complete.


If you want to create new blockchain please run one of the following:

  multichain-util create getblockchainparams
  multichain-util clone <old-blockchain-name> getblockchainparams

And rerun multichaind getblockchainparams


If you want to connect to existing blockchain please specify seed node:

  multichaind getblockchainparams@<seed-node-ip>
  multichaind getblockchainparams@<seed-node-ip>:<seed-node-port>

And than:

Retrieving blockchain parameters from the seed node 192.168.0.6:7767 ...
Error: Couldn't retrieve blockchain parameters from the seed node 192.168.0.6 on port 7767.
For bitcoin protocol blockchains, the file /root/.multichain/getblockchainparams/params.dat must be copied manually from an existing node.
You need to put the blockchain name in before the command name.
multichaind chain1 getblockchainparams@192.168.0.6:7767

MultiChain Core Daemon build 1.0 alpha 24 protocol 10006

IO error: lock /root/.multichain/chain1/permissions.db/LOCK: Resource temporarily unavailable

ERROR: Couldn't initialize permission database for blockchain chain1. Probably multichaind for this blockchain is already running. Exiting...
multichain-cli chain1 getblockchainparams
{"method":"getblockchainparams","params":[],"id":1,"chain_name":"chain1"}

{
    "chain-protocol" : "multichain",
    "chain-description" : "MultiChain chain1",
    "root-stream-name" : "root",
    "root-stream-open" : true,
    "chain-is-testnet" : false,
    "target-block-time" : 15,
    "maximum-block-size" : 1000000,
    "default-network-port" : 7767,
    "default-rpc-port" : 7766,
    "anyone-can-connect" : false,
    "anyone-can-send" : false,
    "anyone-can-receive" : false,
    "anyone-can-create" : false,
    "anyone-can-issue" : false,
    "anyone-can-mine" : false,
    "anyone-can-activate" : false,
    "anyone-can-admin" : false,
    "allow-p2sh-outputs" : true,
    "allow-multisig-outputs" : true,
    "setup-first-blocks" : 60,
    "mining-diversity" : 0.30000000,
    "admin-consensus-admin" : 0.50000000,
    "admin-consensus-activate" : 0.50000000,
    "admin-consensus-mine" : 0.50000000,
    "admin-consensus-create" : 0.00000000,
    "admin-consensus-issue" : 0.00000000,
    "mining-requires-peers" : true,
    "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" : 16,
    "target-adjust-freq" : -1,
    "allow-min-difficulty-blocks" : false,
    "only-accept-std-txs" : true,
    "max-std-tx-size" : 100000,
    "max-std-op-returns-count" : 10,
    "max-std-op-return-size" : 4096,
    "max-std-op-drops-count" : 5,
    "max-std-element-size" : 600,
    "chain-name" : "chain1",
    "protocol-version" : 10006,
    "network-message-start" : "fddac8eb",
    "address-pubkeyhash-version" : "002dd143",
    "address-scripthash-version" : "054f11ce",
    "private-key-version" : "80eed715",
    "address-checksum-value" : "4b340279",
    "genesis-pubkey" : "03122319d2f5f8592530146041b1636def17127963be189069ebc1c1113a20e3e1",
    "genesis-version" : 1,
    "genesis-timestamp" : 1476539242,
    "genesis-nbits" : 520159231,
    "genesis-nonce" : 30233,
    "genesis-pubkey-hash" : "81efee008801cf36c1f68a104eb4177d53143d6e",
    "genesis-hash" : "00006bc034b14c3a773db5cfa9a3f776d6676ba2023bba685ce76e22824d3981",
    "chain-params-hash" : "a49133b5c18a8ecb3d91b240f3cd1b1a5e3c96a5250934710a5a80f46297515e"
}
OK, that looks fairly standard. Please post the output for getinfo, listpermissions and listunspent 0 from node 1. And also, did you do anything on node 1 except start the chain and attempt to grant these permissions. Signing off now so will look tomorrow.
I did nothing other than start the chain and attempted to grant the permissions.

Here are the results:
multichain-cli chain1 getinfo
{"method":"getinfo","params":[],"id":1,"chain_name":"chain1"}

{
    "version" : "1.0 alpha 24",
    "protocolversion" : 10006,
    "chainname" : "chain1",
    "description" : "MultiChain chain1",
    "protocol" : "multichain",
    "port" : 7767,
    "setupblocks" : 60,
    "nodeaddress" : "chain1@192.168.0.6:7767",
    "burnaddress" : "1XXXXXXWe5XXXXXXpKXXXXXXauXXXXXXVjcTTa",
    "incomingpaused" : false,
    "miningpaused" : false,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "walletdbversion" : 2,
    "reindex" : false,
    "blocks" : 1766,
    "timeoffset" : 0,
    "connections" : 0,
    "proxy" : "",
    "difficulty" : 0.00001526,
    "testnet" : false,
    "keypoololdest" : 1476539242,
    "keypoolsize" : 2,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00000000,
    "errors" : ""
}

multichain-cli chain1 listpermissions
{"method":"listpermissions","params":[],"id":1,"chain_name":"chain1"}

[
    {
        "address" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
        "for" : null,
        "type" : "mine",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
        "for" : null,
        "type" : "activate",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
        "for" : null,
        "type" : "connect",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
        "for" : null,
        "type" : "send",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
        "for" : null,
        "type" : "receive",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
        "for" : null,
        "type" : "issue",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
        "for" : null,
        "type" : "create",
        "startblock" : 0,
        "endblock" : 4294967295
    }
]

and

multichain-cli chain1 listunspent 0
{"method":"listunspent","params":[0],"id":1,"chain_name":"chain1"}

[
]


Thanks
Thanks. And please also run:

multichain-cli chain1 getaddresses true

multichain-cli chain1 getblock 0
multichain-cli chain1 getblock 1
multichain-cli chain1 getblock 2

multichain-cli chain1 listwallettransactions
Here are the results:

# multichain-cli chain1 getaddresses true
{"method":"getaddresses","params":[true],"id":1,"chain_name":"chain1"}

[
    {
        "address" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
        "ismine" : true,
        "iswatchonly" : false,
        "isscript" : false,
        "pubkey" : "03122319d2f5f8592530146041b1636def17127963be189069ebc1c1113a20e3e1",
        "iscompressed" : true,
        "account" : "",
        "synchronized" : true
    }
]

multichain-cli chain1 getblock 0
{"method":"getblock","params":["0"],"id":1,"chain_name":"chain1"}

error code: -8
error message:
Block height out of range

multichain-cli chain1 getblock 1
{"method":"getblock","params":["1"],"id":1,"chain_name":"chain1"}

{
    "hash" : "0000deef5d3b1731cee8c81578cc87364c4deb7e8157044c8c54c15489d03763",
    "miner" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
    "confirmations" : 1898,
    "size" : 299,
    "height" : 1,
    "version" : 3,
    "merkleroot" : "3433f0e9662db32e190f193770c12ab54e1641eccdca1bd44346b3bc5e6dd79c",
    "tx" : [
        "3433f0e9662db32e190f193770c12ab54e1641eccdca1bd44346b3bc5e6dd79c"
    ],
    "time" : 1476539243,
    "nonce" : 111556,
    "bits" : "1f00ffff",
    "difficulty" : 0.00001526,
    "chainwork" : "0000000000000000000000000000000000000000000000000000000000020002",
    "previousblockhash" : "00006bc034b14c3a773db5cfa9a3f776d6676ba2023bba685ce76e22824d3981",
    "nextblockhash" : "00003d8a945759381896c86c6f1fc3ca04b3635f67fc3268ce5b5f3c3e3b975f"
}

multichain-cli chain1 getblock 2
{"method":"getblock","params":["2"],"id":1,"chain_name":"chain1"}

{
    "hash" : "00003d8a945759381896c86c6f1fc3ca04b3635f67fc3268ce5b5f3c3e3b975f",
    "miner" : "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1",
    "confirmations" : 1899,
    "size" : 265,
    "height" : 2,
    "version" : 3,
    "merkleroot" : "dd46fc8d9b2f43c3f41c21a085e576b8c1c214d28dee025475cf26a00668fdfd",
    "tx" : [
        "dd46fc8d9b2f43c3f41c21a085e576b8c1c214d28dee025475cf26a00668fdfd"
    ],
    "time" : 1476539244,
    "nonce" : 13900,
    "bits" : "1f00ffff",
    "difficulty" : 0.00001526,
    "chainwork" : "0000000000000000000000000000000000000000000000000000000000030003",
    "previousblockhash" : "0000deef5d3b1731cee8c81578cc87364c4deb7e8157044c8c54c15489d03763",
    "nextblockhash" : "000072fb044ed6f268078f5592abc5b0df113cfae11fcb14fbdde5304ab54fb2"
}

multichain-cli chain1 listwallettransactions
{"method":"listwallettransactions","params":[],"id":1,"chain_name":"chain1"}

[
    {
        "balance" : {
            "amount" : 0.00000000,
            "assets" : [
            ]
        },
        "myaddresses" : [
            "1JZaLWSvr4VoSz6RYymq78FVCQtQFAwkbZpNy1"
        ],
        "addresses" : [
        ],
        "permissions" : [
        ],
        "data" : [
            "53504b62473045022100ee02e908e9206bb8f334054fcab64d9ca8842be4ad312ed856ff64d150d8f03902200fd0ef4e93474a20c84c2f0698d7d50b8c7e1a374f54a609facb790ae189cd0c022103122319d2f5f8592530146041b1636def17127963be189069ebc1c1113a20e3e1"
        ],
        "confirmations" : 1902,
        "generated" : true,
        "blockhash" : "0000deef5d3b1731cee8c81578cc87364c4deb7e8157044c8c54c15489d03763",
        "blockindex" : 0,
        "blocktime" : 1476539243,
        "txid" : "3433f0e9662db32e190f193770c12ab54e1641eccdca1bd44346b3bc5e6dd79c",
        "valid" : true,
        "time" : 1476539243,
        "timereceived" : 1476539243
    }
]

Thanks
OK, I can't see any explanation in what you've sent, so it could be a bug that for some reason showed up specifically in your case. Could you please:

1. Stop the node (multichain-cli chain1 stop)
2. Zip up the directory ~/.multichain/chain1
3. Email the zip file to multichain dot debug at gmail dot com.

We will take a look to try to understand what happened.
Thank you for reporting this.

The wallet database in this chain was corrupted (probably because of crash/kill, which occured on 2016-10-15 10:47).

multichaind didn't recover from this crash properly. We already found the bug and we'll fix it in the next Alpha.

In the meantime you can repair your chain by running

multichaind chain1 -rescan
Ok so ran multichaind chain1 -rescan on server 1
than ran multichaindd chain1@[ip adress]:[port]
Blockchain initialized and it generated the wallet address
Back on server 1 and i input multichain-cli chain1 grant 1[wallet address]

received error code now that that server 1 didn't recognize -cli ?

Not sure what is going on with this one? help please
Can you please post exact error message?
Thanks Michael. I closed out and restarted and it worked fine. I am now getting the hanging node issue on server 2 after connecting and validation. Server two does not go back to the prompt?
Do you start multichaind with -daemon runtime parameter? Otherwise it should not return to the prompt.
...