Solana.RPC.Tracker (Solana v0.1.0)

View Source

A GenServer you can use to track the status of transaction signatures.

Example

iex> key = Solana.keypair() |> Solana.pubkey!()
iex> {:ok, tracker} = Solana.RPC.Tracker.start_link(network: "localhost")
iex> client = Solana.RPC.client(network: "localhost")
iex> {:ok, tx} = Solana.RPC.send_request(client, Solana.RPC.Request.request_airdrop(key, 1))
iex> Solana.Tracker.start_tracking(tracker, tx)
iex> receive do
...>   {:ok, [^tx]} -> IO.puts("confirmed!")
...> end
confirmed!

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts a Solana.RPC.Tracker process linked to the current process.

Starts tracking a transaction signature or list of transaction signatures.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

Starts a Solana.RPC.Tracker process linked to the current process.

start_tracking(tracker, signatures, opts)

Starts tracking a transaction signature or list of transaction signatures.

Sends messages back to the calling process as transactions from the list are confirmed. Stops tracking automatically once transactions have been confirmed.