vinteumorg / infra-signet-server

Signet Server manager for bitcoin educational cohorts
1 stars 0 forks source link

Signet Server

The server script signet-server.py needs to be run by the administrator on a publicly reachable server to start the game. The script requires a local installation of Bitcoin Core since it consumes the test framework as a library.

The server runs the signet full node, creates all the wallets and continues mining blocks forever. It should never be killed, but the node can always be restarted by using -datadir=<path/for/bitcoin/datadir>

Usage

python signet-server.py [-h] [--datadir DATADIR] [--config CONFIG] [--regtest] [--wallets WALLETS]
                        [--loglevel {debug,info,warning,error,critical}]
                        <Bitcoin Core path>

<Bitcoin Core path>: path to local installation of Bitcoin Core repository. The server requires that the binaries are compiled with wallet support.

Options

-h, --help: Show usage help.

--datadir DATADIR: path to the bitcoin datadir (default: default system location).

--config CONFIG: path to save the configuration files generated by the server (default: config). The server will create a bitcoinf.conf file and wallet descriptors that can be distributed to students.

--regtest: start server in regtest mode (faster for testing, default: False).

--wallets WALLETS: how many student wallets should the server create (default: 10).

--loglevel {debug,info,warning,error,critical}: log level for the server messages (default: info).

Known limitations

Operating Systems limit the amount of file descriptors a process can manage. This affacts creating too many wallets. MacOS is especially sensitive to this.

You can check the limits with ulimit -a. Increasing the limit with ulimit -n 8192 (or higher) can fix things, but I can't figure out a way to know how many descriptors you will need.

See this issue for more info.

Credits

This is forked from the work of Matthew Zipkin for Chaincode Labs.