Solana.TestValidator (Solana v0.1.0) View Source
A Solana Test Validator
managed by an Elixir process. This allows you to run unit tests as if you had
the solana-test-validator tool running in another process.
Requirements
Since Solana.TestValidator uses the solana-test-validator binary, you'll
need to have the Solana tool
suite installed.
How to Use
Add the following lines to the beginning of your test/test_helper.exs file:
alias Solana.TestValidator
{:ok, validator} = TestValidator.start_link(ledger: "/tmp/test-ledger")
ExUnit.after_suite(fn _ -> TestValidator.stop(validator) end)This will start and stop the solana-test-validator before and after your
tests run.
Options
You can pass any of the long-form options you would pass to a
solana-test-validator here. See Solana.TestValidator.start_link/1 for more
details.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Gets the state of a Solana.TestValidator process.
Starts a Solana.TestValidator process linked to the current process.
Stops a Solana.TestValidator process.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Gets the state of a Solana.TestValidator process.
This is useful when you want to check the latest output of the
solana-test-validator.
Starts a Solana.TestValidator process linked to the current process.
This process runs and monitors a solana-test-validator in the background.
Options
:bind_address- The default value is"0.0.0.0".:bpf_program:clone:config- The default value is"/home/derek/.config/solana/cli/config.yml".:dynamic_port_range- The default value is"1024-65535".:faucet_port- The default value is9900.:faucet_sol- The default value is1000000.:gossip_host- The default value is"127.0.0.1".:gossip_port:url:ledger- The default value is"test-ledger".:limit_ledger_size- The default value is10000.:mint:rpc_port- The default value is8899.:slots_per_epoch:warp_slot
Stops a Solana.TestValidator process.
Should be called when you want to stop the solana-test-validator.