
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
hypermininet
Advanced tools
A high-level wrapper around mininet for testing Hyperswarm and HyperDHT applications in simulated network conditions.
npm install hypermininet
const Hypermininet = require('hypermininet')
const hypermininet = new Hypermininet({
debug: true,
mininet: { clean: true },
network: {
hosts: 10,
link: {
bandwidth: 1, // 1 Mbit link
delay: '100ms', // 100ms latency
loss: 10, // 10% packet loss
htb: true
}
}
})
await hypermininet.ready()
// Define a function to run on hosts
const helloWorld = hypermininet.add(({ data, bootstrap, controller }) => {
const Hyperswarm = require('hyperswarm')
const swarm = new Hyperswarm({ bootstrap })
console.log('Running on host with data:', data)
controller.on('data', (msg) => {
console.log('Received:', msg)
})
})
// Boot the hypermininet (starts the DHT bootstrapper)
await hypermininet.boot(async () => {
for (const host of hypermininet.hosts) {
await helloWorld(host, { hello: 'world' })
}
})
// Cleanup
await hypermininet.close()
As well as creating multiple hosts with a single link config (controlling speed, delay etc.); this can also be controlled per host.
The example will create 3 hosts, with 3 different preset configs used
const Hypermininet = require('hypermininet')
const hypermininet = new Hypermininet({
debug: true,
mininet: { clean: true },
network: {
hosts: [
Hypermininet.NetworkPotato,
Hypermininet.NetworkOK,
Hypermininet.Network3GRural
]
}
})
new Hypermininet(opts)Create a new Hypermininet instance.
Options:
debug (boolean): Enable debug logging. Default: falsemininet (object): Options passed to the underlying Mininet instance
clean (boolean): Clean up existing Mininet state on startnetwork (object): Network configuration
hosts (number): Number of hosts to create. Default: 10link (object): Link configuration applied to all host connections
bandwidth (number): Bandwidth in Mbit/sdelay (string): Latency (e.g., '100ms')loss (number): Packet loss percentagehtb (boolean): Use HTB qdiscbootstrap (object): Bootstrap node configuration
port (number): Port for the DHT bootstrapper. Default: 49737await hypermininet.ready()Initialize the swarm. Creates the virtual network with the configured number of hosts.
hypermininet.hostsArray of available hosts (excluding the bootstrap host). Each host has an ip property.
hypermininet.add(callback)Register a function to run on hosts. Returns an async function that spawns the callback on a specific host.
The callback receives an object with:
data: Custom data passed when invoking the returned functionbootstrap: Array of bootstrap nodes ([{ host, port }])controller: The mininet/host controller for IPC with the parent processconst runTask = hypermininet.add(({ data, bootstrap, controller }) => {
// This code runs in a separate Node.js process on the virtual host
controller.send('done')
})
const proc = await runTask(host, { customData: 123 })
proc.on('message:done', () => console.log('Task completed'))
await hypermininet.boot(callback)Start the DHT bootstrapper and execute the callback. The bootstrapper runs on the first host and is automatically configured.
await hypermininet.boot(async () => {
// Bootstrap is ready, spawn your application hosts here
})
await hypermininet.close()Stop all processes and clean up the virtual network.
MIT
FAQs
A high-level wrapper around around mininet for easy swarm testing
The npm package hypermininet receives a total of 28 weekly downloads. As such, hypermininet popularity was classified as not popular.
We found that hypermininet demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.