Skip to content

Running Bytecoin Services

Bytecoin Developers Team edited this page Feb 14, 2018 · 4 revisions

Design notes

Bytecoin is split into two separate services - bytecoind and walletd. This is a direct consequence of the anonymity concept Bytecoin is built upon.

bytecoind service is responsible for p2p connections and consensus, it can assemble transactions into blocks, check transactions validity, synchronize and grow blockchain, but it cannot look inside transactions to see transfers between addresses, because this requires access to user secrets (wallet) to do so.

Here comes walletd that is designed to work with user wallet being run with a wallet file as a mandatory argument. After getting chain of blocks from bytecoind, walletd sifts through all transactions with wallet keys to see transfers from and to addresses stored in that wallet file.

Though this separation is perfect, the most common case is running bytecoind and walletd on the same computer at the same time. That's why walletd has a local copy of bytecoind built-in. If you run walletd without --remote-bytecoind-address=<ip:port> parameter, it will run in-process bytecoind while walletd itself is running. If you run walletd with --remote-bytecoind-address=<ip:port>, it will try to connect to external bytecoind running at the given remote address.

You cannot have several bytecoinds running on the same machine, because bytecoind requires exclusive access to blockchain database stored in Bytecoin data folder. (kind-of exception is running one for mainnet and one for testnet, this works because there is separate Bytecoin data folder for testnet)

In the meantime, you can have as many walletds running as you need, but the same wallet file (actually, wallet file with the same view key) cannot be open by more than one walletd. This is because walletd requires exclusive access to wallet cache database with a name derived from wallet file view key, stored in Bytecoin data folder.

Handy examples

Running a single walletd with built-in bytecoind and default parameters:

$ ./walletd --wallet-file=<file>

Running a single walletd with external bytecoind on the same machine (in beta you can only use 127.0.0.1 instead of localhost):

$ ./bytecoind
$ ./walletd --wallet-file=<file> --remote-bytecoind-address=127.0.0.1:8081

Running a single walletd with external bytecoind on a different machine (in beta you can only use IP-address instead of host name, like "my-bytecoind.my-hoster.com"):

$ ./bytecoind
$ ./walletd --wallet-file=<file> --remote-bytecoind-address=137.28.14.69:8081

Running two walletds with external bytecoind on the same machine:

$ ./bytecoind
$ ./walletd --wallet-file=<file1> --remote-bytecoind-address=127.0.0.1:8081
$ ./walletd --wallet-file=<file2> --walletd-bind-address=127.0.0.1:8071 --remote-bytecoind-address=127.0.0.1:8081

We had to specify different bind port for accessing second walletd, because port 8070 is already used by first walletd.

We can check them both in GUI wallet, selecting "Connect to remote walletd" command in Wallet menu, and typing 127.0.0.1:8070 or 127.0.0.1:8071 to connect to each of running walletds.

Clone this wiki locally