Sha256: 7c394df990369fb3ec810d38360f29b09f0759a9205090ef595c8478e3e6aa9e

Contents?: true

Size: 625 Bytes

Versions: 6

Compression:

Stored size: 625 Bytes

Contents

#!/usr/bin/env ruby
#
# Creates a handful of "mock" peers on the network that are a member of all groups.
#
# Author: Preston Lee <conmotto@gmail.com>
#

current_dir = File.dirname(File.expand_path(__FILE__))
lib_path = File.join(current_dir, '..', 'lib')
$LOAD_PATH.unshift lib_path

require 'journeta'
include Journeta


COUNT = 5
puts "Creating #{COUNT} mock peers."
instances = []
for i in 1..COUNT
  n = Engine.new(:peer_port => (12345 + i))
  instances.push n
  n.start
end


puts "Hit <ENTER> to stop all #{COUNT} peer instances exit."
gets
instances.each do |i|
  i.stop
end

puts "All instances stopped. Exiting..."

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
journeta-1.1.0 bin/journeta_mock_peers.rb
journeta-1.0.1 bin/journeta_mock_peers.rb
journeta-1.0.0 bin/journeta_mock_peers.rb
journeta-0.2.2 bin/journeta_mock_peers.rb
journeta-0.2.1 bin/journeta_mock_peers.rb
journeta-0.2.0 bin/journeta_mock_peers.rb