I am trying to create a docker image where multichain is spun up, running and streams are created and subscribed to.
I have a bash file for the creation and setup of multichain. Here is the end snippet of the file;
multichaind -printtoconsole -shrinkdebugfilesize $CHAINNAME -daemon
multichain-cli $CHAINNAME create stream user_data false
multichain-cli $CHAINNAME subscribe user_data
while true; do sleep 1000; done
*The while loop is to keep the container alive and not get docker to exit from it
So when it tries to create the stream, I get an error and then another error when subscribing because the stream hasn't been created. Here's a chunk of the logs that displays the error
{"method":"create","params":["stream","user_data",false],"id":1,"chain_name":"recordz_multichain"}
Pre-allocating up to position 0x100000 in rev00000.dat
UpdateTip: new best=0071964261f413dc8e0cdd9b3bbeb66cf4b1fe2adad8e45f9cb241c4e6704f2a height=1 log2_work=9 tx=2 date=2018-09-01 17:46:56 progress=1.000000 cache=0
mchn: Coin selection: No unspent output with create permission
SendMoney() : No unspent output with create permission
error code: -704
error message:
No unspent output with create permission
MultiChainMiner: Block Found - 006020dd467afcfa90cfd959ffad3799c21f03d86248bc5ba45639c79b297131, prev: 0071964261f413dc8e0cdd9b3bbeb66cf4b1fe2adad8e45f9cb241c4e6704f2a, height: 2, txs: 1
{"method":"subscribe","params":["user_data"],"id":1,"chain_name":"recordz_multichain"}
UpdateTip: new best=006020dd467afcfa90cfd959ffad3799c21f03d86248bc5ba45639c79b297131 height=2 log2_work=9.5849625 tx=3 date=2018-09-01 17:46:57 progress=1.000000 cache=0
error code: -708
error message:
Entity with this name not found: user_data
Looking at the multichain guide there is a part on permission when trying to connect a second node. But I only have the one node so I assume theres no explicit permissions needed to be set as that node would have all of the permissions set.
Here is a listpermissions from the node;
{"method":"listpermissions","params":[],"id":1,"chain_name":"recordz_multichain"}
[
{
"address" : "1SnFs4GrVVnkXV8esVbonjYva5cQ23W9cmBD87",
"for" : null,
"type" : "mine",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "1SnFs4GrVVnkXV8esVbonjYva5cQ23W9cmBD87",
"for" : null,
"type" : "admin",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "1SnFs4GrVVnkXV8esVbonjYva5cQ23W9cmBD87",
"for" : null,
"type" : "activate",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "1SnFs4GrVVnkXV8esVbonjYva5cQ23W9cmBD87",
"for" : null,
"type" : "connect",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "1SnFs4GrVVnkXV8esVbonjYva5cQ23W9cmBD87",
"for" : null,
"type" : "send",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "1SnFs4GrVVnkXV8esVbonjYva5cQ23W9cmBD87",
"for" : null,
"type" : "receive",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "1SnFs4GrVVnkXV8esVbonjYva5cQ23W9cmBD87",
"for" : null,
"type" : "issue",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "1SnFs4GrVVnkXV8esVbonjYva5cQ23W9cmBD87",
"for" : null,
"type" : "create",
"startblock" : 0,
"endblock" : 4294967295
}
]
Can you help shed some light on this for me?
Answer
So straight after asking this question I had a brainwave that maybe the stream creation could be happening before the node is fully started. So I put in a sleep command between starting the node and creating the stream and now it works