Add --testnet-config-dir flag for tx-generator
Context
tx-generator allows users and testers to automatically send transactions to a cardano network. This can be used, for example, for checking how the network behaves under high-pressure. This checks are typically performed on a testnet, and cardano-testnet is a tool that can be used to easily spawn testnets. So is often the case that we want to run cardano-testnet to spawn a testnet, and then use tx-generator on that testnet.
tx-generator has both a high-level and a low-level interface, and for this issue we are focusing on the high-level one, which internally gets translated into the low-level one automatically. The high-level interface can be accessed through the sub-command json_highlevel.
The main configuration for json_highlevel comes from a json file (you can see an example of what it looks like here). This JSON file determines aspects of how the tests will be run, like:
- How many transactions will be generated (
tx_count)
- How many inputs or outputs each transaction will have (
inputs_per_tx and outputs_per_tx)
- How fast the transactions will be generated (
tps)
But also more environmental aspects like:
- The Cardano era that the network is in (
era)
- The keep-alive timeout for mini-protocol used to connect to the Cardano node (
keepalive)
And, the most relevant ones for this issue, how to connect to and how to use the Cardano network:
- Path to local node socket for protocol queries (
localNodeSocketPath)
- List of nodes to submit transactions to (Node-to-Node protocol) (
targetNodes)
- Path to node configuration file (
nodeConfigFile)
- Path to signing key with sufficient funds (genesis key) (
sigKey)
If the network that we want to use tx-generator on has been spawned by using cardano-testnet. These last 4 attributes could be filled automatically.
So this issue proposes adding a new flag --testnet-config-dir that takes the configuration folder of a Cardano testnet spawned by cardano-testnet, and it automatically fills this four fields using the information extracted from that configuration folder.
Of course, the user still has to specify the rest of required values.
Add
--testnet-config-dirflag for tx-generatorContext
tx-generatorallows users and testers to automatically send transactions to a cardano network. This can be used, for example, for checking how the network behaves under high-pressure. This checks are typically performed on a testnet, andcardano-testnetis a tool that can be used to easily spawn testnets. So is often the case that we want to runcardano-testnetto spawn a testnet, and then usetx-generatoron that testnet.tx-generatorhas both a high-level and a low-level interface, and for this issue we are focusing on the high-level one, which internally gets translated into the low-level one automatically. The high-level interface can be accessed through the sub-commandjson_highlevel.The main configuration for
json_highlevelcomes from a json file (you can see an example of what it looks like here). This JSON file determines aspects of how the tests will be run, like:tx_count)inputs_per_txandoutputs_per_tx)tps)But also more environmental aspects like:
era)keepalive)And, the most relevant ones for this issue, how to connect to and how to use the Cardano network:
localNodeSocketPath)targetNodes)nodeConfigFile)sigKey)If the network that we want to use
tx-generatoron has been spawned by usingcardano-testnet. These last 4 attributes could be filled automatically.So this issue proposes adding a new flag
--testnet-config-dirthat takes the configuration folder of a Cardano testnet spawned bycardano-testnet, and it automatically fills this four fields using the information extracted from that configuration folder.Of course, the user still has to specify the rest of required values.