Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ require (
)

replace (
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.82
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.103
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4
github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.56
github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.59
google.golang.org/grpc => google.golang.org/grpc v1.33.2
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1097,10 +1097,10 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo=
github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY=
github.com/sei-protocol/sei-cosmos v0.1.82 h1:vGsbp35KOZzP3YQoJ8T0MuWpLuC8Ea+6+F5QvHy9a5c=
github.com/sei-protocol/sei-cosmos v0.1.82/go.mod h1:L4fVgFVReigFZAe+43UNhaCf3DQzUZvpN6LlBsWkub4=
github.com/sei-protocol/sei-tendermint v0.1.56 h1:iRVhiIetj+GSwpBzaR9lqgvmgcOqmShfACS6x3tuBIw=
github.com/sei-protocol/sei-tendermint v0.1.56/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8=
github.com/sei-protocol/sei-cosmos v0.1.103 h1:HIWnzmw3TuCtnGYqZj5jKbVztUqHU8rJm9eWQ8ji8po=
github.com/sei-protocol/sei-cosmos v0.1.103/go.mod h1:L4fVgFVReigFZAe+43UNhaCf3DQzUZvpN6LlBsWkub4=
github.com/sei-protocol/sei-tendermint v0.1.59 h1:POGL60PumMQHF4EzAHzvkGfDnodQJLHpl65LuiwSO/Y=
github.com/sei-protocol/sei-tendermint v0.1.59/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs=
github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
Expand Down
27 changes: 13 additions & 14 deletions loadtest/scripts/populate_genesis_accounts.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import json
import os
import multiprocessing
import subprocess
import sys
import threading
import time

PARALLEISM=32
LOCK=threading.Lock()

def add_genesis_account(account_name, local=False):
def add_genesis_account(account_name, lock, local=False):
if local:
add_key_cmd = f"yes | ~/go/bin/seid keys add {account_name} --keyring-backend test"
else:
Expand Down Expand Up @@ -41,7 +39,7 @@ def add_genesis_account(account_name, local=False):
sleep_time = 1
while not success and retry_counter > 0:
try:
with LOCK:
with lock:
subprocess.check_call(
[add_account_cmd],
shell=True,
Expand All @@ -54,25 +52,26 @@ def add_genesis_account(account_name, local=False):
time.sleep(sleep_time)


def bulk_create_genesis_accounts(number_of_accounts, start_idx, is_local=False):
def bulk_create_genesis_accounts(number_of_accounts, start_idx, lock, is_local=False):
for i in range(start_idx, start_idx + number_of_accounts):
print(f"Creating account {i}")
add_genesis_account(f"ta{i}", is_local)
add_genesis_account(f"ta{i}", lock, is_local)

def main():
args = sys.argv[1:]
number_of_accounts = int(args[0])
is_local = False
if len(args) > 1 and args[1] == "loc":
is_local = True
num_processes = number_of_accounts // PARALLEISM
processes = []
for i in range(0, number_of_accounts, num_processes):
processes.append(multiprocessing.Process(target=bulk_create_genesis_accounts, args=(num_processes, i, is_local)))
for p in processes:
p.start()
for p in processes:
p.join()
num_threads = number_of_accounts // PARALLEISM
threads = []
lock=threading.Lock()
for i in range(0, number_of_accounts, num_threads):
threads.append(threading.Thread(target=bulk_create_genesis_accounts, args=(num_threads, i, lock, is_local)))
for t in threads:
t.start()
for t in threads:
t.join()

if __name__ == "__main__":
main()