pub struct StaticTestnet {
pub testnet: Testnet,
pub homeserver_config: Option<PathBuf>,
/* private fields */
}Expand description
A simple testnet with
- A local DHT with a boostrap node on port 6881.
- pkarr relay on port 15411.
- http relay on port 15412.
- A homeserver with address is hardcoded to
8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo. - An admin server for the homeserver on port 6288.
Fields§
§testnet: TestnetInner flexible testnet.
homeserver_config: Option<PathBuf>Optional path to the homeserver config file if set.
Implementations§
Source§impl StaticTestnet
impl StaticTestnet
Sourcepub async fn start() -> Result<Self>
pub async fn start() -> Result<Self>
Run a new static testnet with the default homeserver config.
Sourcepub async fn start_with_homeserver_config(config_path: PathBuf) -> Result<Self>
pub async fn start_with_homeserver_config(config_path: PathBuf) -> Result<Self>
Run a new static testnet with a custom homeserver config.
Sourcepub async fn create_random_homeserver(&mut self) -> Result<&HomeserverApp>
pub async fn create_random_homeserver(&mut self) -> Result<&HomeserverApp>
Create an additional homeserver with a random keypair
Sourcepub fn client_builder(&self) -> PubkyHttpClientBuilder
pub fn client_builder(&self) -> PubkyHttpClientBuilder
Create a new pubky client builder.
Sourcepub fn client(&self) -> Result<PubkyHttpClient, BuildError>
pub fn client(&self) -> Result<PubkyHttpClient, BuildError>
Creates a pubky::PubkyHttpClient pre-configured to use this test network.
Sourcepub fn sdk(&self) -> Result<Pubky, BuildError>
pub fn sdk(&self) -> Result<Pubky, BuildError>
Creates a pubky::Pubky SDK facade pre-configured to use this test network.
This is a convenience method that builds a client from Self::client_builder.
Sourcepub fn pkarr_client_builder(&self) -> ClientBuilder
pub fn pkarr_client_builder(&self) -> ClientBuilder
Create a new pkarr client builder.
Sourcepub fn homeserver_app(&self) -> &HomeserverApp
pub fn homeserver_app(&self) -> &HomeserverApp
Get the homeserver in the testnet.
Sourcepub fn http_relay(&self) -> &HttpRelay
pub fn http_relay(&self) -> &HttpRelay
Get the http relay in the testnet.
Sourcepub fn pkarr_relay(&self) -> &Relay
pub fn pkarr_relay(&self) -> &Relay
Get the pkarr relay in the testnet.
Sourcepub fn bootstrap_nodes(&self) -> Vec<String>
pub fn bootstrap_nodes(&self) -> Vec<String>
Get the bootstrap nodes for the testnet.
Auto Trait Implementations§
impl Freeze for StaticTestnet
impl !RefUnwindSafe for StaticTestnet
impl Send for StaticTestnet
impl Sync for StaticTestnet
impl Unpin for StaticTestnet
impl UnsafeUnpin for StaticTestnet
impl !UnwindSafe for StaticTestnet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request