The broadcaster-cli provides a set of functions for running performance tests on ARC. Additionally, broadcaster-cli allows the management of key sets and UTXOs.
The broadcaster-cli can be installed using the following command.
go install github.com/bitcoin-sv/arc/cmd/broadcaster-cli@latest
If the ARC repository is checked out it can also be installed from that local repository like this
go install ./cmd/broadcaster-cli/
broadcaster-cli uses flags for adding context needed to run it. The flags and commands available can be shown by running broadcaster-cli with the flag --help.
As there can be a lot of flags you can also define them in a configuration file. The file broadcaster-cli-example.yaml is an example of the configuration. The format of the file can be the following: JSON, TOML, YAML, HCL, INI, envfile or Java properties formats.
A specific config file can be selected using the --config flag. Example:
broadcaster-cli keyset address -- --config ./cmd/broadcaster-cli/broadcaster-cli-example.yaml
Note that the config has to be added as a subcommand with a double dash -- as shown above. The path to the config file has to be separated by a space.
If no config file is given using the --config flag, broadcaster-cli will search for broadcaster-cli.yaml in . and ./cmd/broadcaster-cli/ folders.
If a config file was found, then these values will be used as flags (if available to the command). You can still provide the flags, in which case the value provided in the flag will override the value provided in broadcaster-cli.yaml.
Note that a configuration file needs to be given at least for the private keys (see broadcaster-cli-example.yaml) as they cannot be passed as flags.
These instructions will provide the steps needed in order to use broadcaster-cli to send transactions to ARC.
- Create a new key set by running
broadcaster-cli keyset new- The key set displayed has to be added to the configuration file under
privateKeys
- The key set displayed has to be added to the configuration file under
- Add funds to the funding addresses
- Show the funding addresses by running
broadcaster-cli keyset address- In case of
testnet(using the--testnetflag) funds can be added using the WoC faucet. For that you can use the commandbroadcaster-cli keyset topup --testnet - In case of
mainnetfunds could be added to one of the addresses.
- In case of
- The funds can be spread to the other keys using the
utxos splitcommand.- The following command will split funds of a given UTXO from
key-01to keys:key-01,key-02,key-03,key-04broadcaster-cli utxos split --txid=cf111f19bcfb6baab7fc200f0f8fb669dd6c66fd9de212becb0950c92a0b6c40 --satoshis=21953 --vout=0 --from=key-01 --keys=key-01,key-02,key-03,key-04 - The same command can be used to move all funds from one UTXO from one to another key. The following example shows how to send all funds of the given UTXO from
key-01tokey-02broadcaster-cli utxos split --txid=cf111f19bcfb6baab7fc200f0f8fb669dd6c66fd9de212becb0950c92a0b6c40 --satoshis=21953 --vout=0 --from=key-01 --keys=key-02 - In order to just print the transaction without submitting it, the
--dryrunflag can be added
- The following command will split funds of a given UTXO from
- You can view the balance of the key set using the command
broadcaster-cli keyset balance
- Show the funding addresses by running
- Create UTXO set
- There must be a certain UTXO set available so that
broadcaster-clican broadcast a reasonable number of transactions in batches - First look at the existing UTXO set using
broadcaster-cli keyset utxos - In order to create more outputs use the following command
broadcaster-cli utxos create --outputs=<number of outputs> --satoshis=<number of satoshis per output> - This command will send transactions creating the requested outputs to ARC. There are more flags needed for this command. Please see
go run cmd/broadcaster-cli/main.go utxos -hfor more details - See the new distribution of UTXOs using
broadcaster-cli keyset utxos
- There must be a certain UTXO set available so that
- Broadcast transactions to ARC
- Now
broadcaster-clican be used to broadcast transactions to ARC at a given rate using this commandbroadcaster-cli utxos broadcast --rate=<txs per second> --batchsize=<nr ot txs per batch> - The limit flag
--limit=<nr of transactions at which broadcasting stops>is optional. If not givenbroadcaster-cliwill only stop whenbroadcaster-cliis aborted manually e.g. usingCTRL+C - In order to broadcast a large number of transactions in parallel, multiple key sets can be given.
- Each concurrently running broadcasting process will broadcast at the given rate
- For example: If a rate of
--rate=100is given with 3 key files--keys=key-1,key-2,key-3, then the final rate will be 300 transactions per second.
- Now
- Consolidate outputs
- If not enough outputs are available for another test run it is best to consolidate the outputs so that there remains only 1 output using
broadcaster-cli utxos consolidate - After this step you can continue with step 4
- Before continuing with step 4 it is advisable to wait until all consolidation transactions were mined
- The command
broadcaster-cli keyset balanceshows the amount of satoshis in the balance that have been confirmed and the amount which has not yet been confirmed
- If not enough outputs are available for another test run it is best to consolidate the outputs so that there remains only 1 output using