-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into special-allocation-order
- Loading branch information
Showing
120 changed files
with
2,636 additions
and
144 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"start_price": "", | ||
"min_bid_price": "", | ||
"selling_coin": { | ||
"denom": "", | ||
"amount": "" | ||
}, | ||
"paying_coin_denom": "", | ||
"start_time": "", | ||
"end_time": "", | ||
"max_extended_round": 0, | ||
"extended_round_rate": "0.05" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"start_price": "", | ||
"min_bid_price": "", | ||
"selling_coin": { | ||
"denom": "", | ||
"amount": "" | ||
}, | ||
"paying_coin_denom": "", | ||
"vesting_schedules": [], | ||
"start_time": "", | ||
"end_time": "" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
import os | ||
import pathlib | ||
|
||
if pathlib.PurePath(os.getcwd()).name != 'localnet': | ||
print('script must be run from localnet folder') | ||
exit(1) | ||
def clear_home(home): | ||
if pathlib.PurePath(os.getcwd()).name != 'localnet': | ||
print('script must be run from localnet folder') | ||
exit(1) | ||
|
||
os.system("rm ./node1/config/write-file-atomic-*") | ||
os.system("rm ./node2/config/write-file-atomic-*") | ||
os.system("rm ./node3/config/write-file-atomic-*") | ||
for i in [1,2,3]: | ||
os.system('rm {}/node{}/config/write-file-atomic-*'.format(home, i)) | ||
os.system('rm {}/node{}/config/genesis.json'.format(home, i)) | ||
os.system("rm {}/node{}/config/addrbook.json".format(home, i)) | ||
os.system('spnd tendermint unsafe-reset-all --home {}/node{}'.format(home, i)) | ||
|
||
os.system("rm ./node1/config/genesis.json") | ||
os.system("rm ./node2/config/genesis.json") | ||
os.system("rm ./node3/config/genesis.json") | ||
os.system("rm ./node1/config/addrbook.json") | ||
os.system("rm ./node2/config/addrbook.json") | ||
os.system("rm ./node3/config/addrbook.json") | ||
|
||
os.system('spnd tendermint unsafe-reset-all --home ./node1') | ||
os.system('spnd tendermint unsafe-reset-all --home ./node2') | ||
os.system('spnd tendermint unsafe-reset-all --home ./node3') | ||
if __name__ == "__main__": | ||
clear_home('spn') | ||
clear_home('testnet') |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[global] | ||
log_level = 'info' | ||
|
||
[mode] | ||
[mode.clients] | ||
enabled = true | ||
refresh = true | ||
misbehaviour = false | ||
|
||
[mode.connections] | ||
enabled = false | ||
|
||
[mode.channels] | ||
enabled = false | ||
|
||
[mode.packets] | ||
enabled = true | ||
clear_interval = 100 | ||
clear_on_start = true | ||
tx_confirmation = true | ||
|
||
[rest] | ||
enabled = false | ||
host = '127.0.0.1' | ||
port = 3000 | ||
|
||
[telemetry] | ||
enabled = false | ||
host = '127.0.0.1' | ||
port = 3001 | ||
|
||
[[chains]] | ||
id = 'spn-1' | ||
rpc_addr = 'http://0.0.0.0:26657' | ||
grpc_addr = 'http://0.0.0.0:9090' | ||
websocket_addr = 'ws://0.0.0.0:26657/websocket' | ||
rpc_timeout = '10s' | ||
account_prefix = 'spn' | ||
key_name = 'steve' | ||
store_prefix = 'ibc' | ||
default_gas = 100000 | ||
max_gas = 400000 | ||
gas_price = { price = 0.025, denom = 'uspn' } | ||
gas_adjustment = 0.1 | ||
max_msg_num = 30 | ||
max_tx_size = 2097152 | ||
clock_drift = '5s' | ||
max_block_time = '10s' | ||
trusting_period = '14days' | ||
trust_threshold = { numerator = '1', denominator = '3' } | ||
address_type = { derivation = 'cosmos' } | ||
|
||
[[chains]] | ||
id = 'orbit-1' | ||
rpc_addr = 'http://localhost:26659' | ||
grpc_addr = 'http://localhost:9092' | ||
websocket_addr = 'ws://localhost:26659/websocket' | ||
rpc_timeout = '10s' | ||
account_prefix = 'spn' | ||
key_name = 'joe' | ||
store_prefix = 'ibc' | ||
default_gas = 100000 | ||
max_gas = 400000 | ||
gas_price = { price = 0.025, denom = 'uspn' } | ||
gas_adjustment = 0.1 | ||
max_msg_num = 30 | ||
max_tx_size = 2097152 | ||
clock_drift = '5s' | ||
max_block_time = '10s' | ||
trusting_period = '14days' | ||
trust_threshold = { numerator = '1', denominator = '3' } | ||
address_type = { derivation = 'cosmos' } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import argparse | ||
from utils import cmd_devnull | ||
|
||
parser = argparse.ArgumentParser(description='Initialize the rewards on SPN for the testnet') | ||
parser.add_argument('--last_block_height', | ||
type=int, | ||
default=100, | ||
help='Last block for the reward pool', | ||
) | ||
parser.add_argument('--self_delegation_1', | ||
default='10000000uspn', | ||
help='Self delegation for validator 1', | ||
) | ||
parser.add_argument('--self_delegation_2', | ||
default='10000000uspn', | ||
help='Self delegation for validator 2', | ||
) | ||
parser.add_argument('--self_delegation_3', | ||
default='10000000uspn', | ||
help='Self delegation for validator 3', | ||
) | ||
|
||
def initialize_rewards(lastBlockHeight, selfDelegationVal1, selfDelegationVal2, selfDelegationVal3): | ||
cmd_devnull('spnd tx profile create-coordinator --from alice -y') | ||
cmd_devnull('spnd tx launch create-chain orbit-1 orbit.com 0xaaa --from alice -y') | ||
cmd_devnull('spnd tx campaign create-campaign orbit 1000000orbit --from alice -y') | ||
cmd_devnull('spnd tx campaign mint-vouchers 1 50000orbit --from alice -y') | ||
cmd_devnull('spnd tx reward set-rewards 1 50000v/1/orbit {} --from alice -y'.format(lastBlockHeight)) | ||
|
||
gentx1 = './testnet/node1/config/gentx/gentx.json' | ||
gentx2 = './testnet/node2/config/gentx/gentx.json' | ||
gentx3 = './testnet/node3/config/gentx/gentx.json' | ||
pub1 = '"Q5D7koejne/P2F1iIcSSVo6M4siL5anwHH7iopX66ps="' | ||
pub2 = '"JzzB4Kr09x3k1MdatVL7MBMrZUn0D3Lx9AK+nHWjbq0="' | ||
pub3 = '"4TwlBGJhu4ZDRBDK57GiFyAFafDAapa6nVQ0VvG5rjA="' | ||
val1 = 'spn1aqn8ynvr3jmq67879qulzrwhchq5dtrvtx0nhe' | ||
val2 = 'spn1pkdk6m2nh77nlaep84cylmkhjder3arey7rll5' | ||
val3 = 'spn1twckcceyw43da9j247pfs3yhqsv25j38grh68q' | ||
|
||
cmd_devnull('spnd tx launch request-add-validator 1 {} {} {} aaa foo.com --validator-address {} --from alice -y'.format(gentx1, pub1, selfDelegationVal1, val1)), | ||
cmd_devnull('spnd tx launch request-add-validator 1 {} {} {} aaa foo.com --validator-address {} --from alice -y'.format(gentx2, pub2, selfDelegationVal2, val2)), | ||
cmd_devnull('spnd tx launch request-add-validator 1 {} {} {} aaa foo.com --validator-address {} --from alice -y'.format(gentx3, pub3, selfDelegationVal3, val3)), | ||
|
||
# Uncomment for testing incomplete validator set | ||
# cmd_devnull('spnd tx launch request-add-validator 1 ./node3/config/gentx/gentx.json "FyTmyvZhwRjwqhY6eWykTfiE+0mwe+U0aSo3ti8DCW8=" 16000000stake aaa foo.com --validator-address spn1ezptsm3npn54qx9vvpah4nymre59ykr9exx2ul --from alice -y') | ||
|
||
cmd_devnull('spnd tx launch trigger-launch 1 5 --from alice -y') | ||
|
||
|
||
if __name__ == "__main__": | ||
# Parse params | ||
args = parser.parse_args() | ||
lastBlockHeight = args.last_block_height | ||
selfDelegationVal1 = args.self_delegation_1 | ||
selfDelegationVal2 = args.self_delegation_2 | ||
selfDelegationVal3 = args.self_delegation_3 | ||
|
||
rewards(lastBlockHeight, selfDelegationVal1, selfDelegationVal2, selfDelegationVal3) |
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
Oops, something went wrong.