| Crates.io | pubky-testnet |
| lib.rs | pubky-testnet |
| version | 0.6.0-rc.3 |
| created_at | 2025-02-13 18:01:57.986211+00 |
| updated_at | 2025-09-17 03:59:01.630917+00 |
| description | A local test network for Pubky Core development. |
| homepage | https://github.com/pubky/pubky-core |
| repository | https://github.com/pubky/pubky-core |
| max_upload_size | |
| id | 1554538 |
| size | 139,128 |
A local test network for developing Pubky Core or applications depending on it.
All resources are ephemeral, databases are in the operating system's temporary directories, and all servers are closed as the testnet dropped.
use pubky_testnet::EphemeralTestnet;
#[tokio::main]
async fn main () {
// Run a new testnet. This creates a test dht,
// a homeserver, and a http relay.
let testnet = EphemeralTestnet::start().await.unwrap();
// Create a Pubky Http Client from the testnet.
let client = testnet.client().unwrap();
// Use the homeserver
let homeserver = testnet.homeserver();
// Use the relay
let http_relay = testnet.http_relay();
}
If you need to run the testnet in a separate process, for example to test Pubky Core in browsers, you need to run this binary, which will create these components with hardcoded configurations: