Created
January 12, 2015 22:12
-
-
Save compleatang/66a3b29e9079f5bb7243 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
this_account = {} | |
accounts = [] | |
def makeaccount | |
b = %w(a b c d e f 1 2 3 4 5 6 7 8 9 0) | |
tmp = '0x' | |
40.times do | |
tmp << b.sample | |
end | |
return tmp | |
end | |
# make researchers | |
i = 1 | |
12.times do | |
acc = this_account.clone | |
acc['address'] = makeaccount | |
acc['name'] = "researcher#{i}" | |
acc['balance'] = '1000000000000000000000000000000000000' | |
acc['permissions'] = {"tx" => 1,"mine" => 1,"create" => 1, "doug" => 1} | |
acc['stake'] = 0 | |
accounts << acc | |
i+=1 | |
end | |
# make trusted participants | |
i = 1 | |
100.times do | |
acc = this_account.clone | |
acc['address'] = makeaccount | |
acc['name'] = "trustedparticipant#{i}" | |
acc['balance'] = '0' | |
acc['permissions'] = {"tx" => 1,"mine" => 1,"create" => 0, "doug" => 0} | |
acc['stake'] = 0 | |
accounts << acc | |
i+=1 | |
end | |
# make trusted participants | |
i = 1 | |
100000.times do | |
acc = this_account.clone | |
acc['address'] = makeaccount | |
acc['name'] = "participant#{i}" | |
acc['balance'] = '0' | |
acc['permissions'] = {"tx" => 1,"mine" => 0,"create" => 0, "doug" => 0} | |
acc['stake'] = 0 | |
accounts << acc | |
i+=1 | |
end | |
genesis = JSON.parse(File.read('./gen.json')) | |
genesis['accounts'] = accounts | |
File.open('genesis.json', 'w'){|f| f.write(JSON.pretty_generate(genesis))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment