Running spacexpansed for games - SpaceXpanse/Documentation GitHub Wiki
It's important to set the right options when you run spacexpansed so that you can communicate with it and so that libspex can also communicate with it.
The short answer is that you should generally run it as follows.
spacexpansed -rpcuser=user -rpcpassword=password -wallet=game.dat -server=1 -rpcallowip=127.0.0.1 -zmqpubgameblocks=tcp://127.0.0.1:28332 -zmqpubgamepending=tcp://127.0.0.1:28332
It will then run as a server.
However, you will need to supply the rpcuser ("user" above), the rpcpassword ("password" above), and the wallet for every request you make. Using spacexpanse-cli a command would then look like this:
spacexpanse-cli -rpcuser=user -rpcpassword=password -wallet=game.dat <command>
If you have specified the rpcuser, rpcpassword or wallet in spacexpanse.conf in the data directory, then you can leave them out above when running spacexpansed. You will then need to specify the rpcuser, rpcpassword and wallet from the spacexpanse.conf file when you issue commands with spacexpanse-cli or through any other RPC tool that you may use.
If you do not specify a wallet anywhere, spacexpansed will default to the wallet.dat file in the data directory.
You can run spacexpansed without specifying any rpcuser, rpcpassword or wallet, in which case you can leave them out entirely when you run commands through spacexpanse-cli. spacexpanse-cli commands are then much simpler.
spacexpanse-cli <command>
To run spacexpansed very simple for spacexpanse-cli and not specify any rpcuser, rpcpassword or wallet in spacexpanse.conf, run spacexpansed like so:
spacexpansed -server=1 -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332
That is the minimum you must use to run spacexpansed for games, testing, or development.
See more information about spacexpanse.conf here.
See more information about spacexpanse-cli here.
See more information about SpaceXpanse RPC methods here.
See more information about daemon startup options for spacexpansed here.