Skip to content

Commit

Permalink
Merge branch 'anoma:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cosminbg authored Sep 26, 2024
2 parents f0ff10d + 2403428 commit e44947b
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 13 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ If you need help, feel free to [reach out on discord](https://discord.gg/AsPCKgW
![Voting Power Distribution](images/validators.png "Voting Power Distribution")


- Total pre-genesis transactions: `317`
- Total validators: `195`
- Total delegations: `121`
- Staked tokens: `14929801.203579 (~1.49%)`
- Total delegations: `122`
- Staked tokens: `14929906.203579 (~1.49%)`

## Validators

Expand Down Expand Up @@ -122,10 +123,10 @@ If you need help, feel free to [reach out on discord](https://discord.gg/AsPCKgW
- alias: `Nodes.Guru`
- commission: `5.0%`
- max commission rate change: `1.0%`
- total voting power: `300105.0 (0.03%)`
- total voting power: `300210.0 (0.03%)`
- email: `[email protected]`
- website: `https://nodes.guru`
- total delegations: `3`
- total delegations: `4`

- address: `tnam1qy0zrla88txv244suxaruqgr9g74vr8vyufd8rp7`
- alias: `Wavefive`
Expand Down
12 changes: 12 additions & 0 deletions genesis/transactions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9685,6 +9685,18 @@ tpknam1qzanw7549s295cq8646fv0py2vflt3yuhv9rx86t280wrlkt49jnkfp7wgy = "signam1qqx



# adding transaction for shikkiy2-bond

[[bond]]
source = "tpknam1qz4rcsutrgur7w8j33f4syl35ffvemh5xhr3r2ae0dy330s94kvecwecl58"
validator = "tnam1q9rq7p4wzy6fea96xs5sr8qnsxsfdr2zugfsvw2n"
amount = "105"

[bond.signatures]
tpknam1qz4rcsutrgur7w8j33f4syl35ffvemh5xhr3r2ae0dy330s94kvecwecl58 = "signam1qrkxsha7pgj24023kzw8hzye6gwkuerhxveceuvv34z7kqswjwkca36wvqfv38x5jhj2kfkav0tl8y57nkgvddla6ymye9028a2kk7qpgp2ppc"



# adding transaction for satman81-validator

[[established_account]]
Expand Down
Binary file modified images/validators.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scripts/artifacts/README.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ If you need help, feel free to [reach out on discord](https://discord.gg/AsPCKgW
There are no validators.
{% endif %}

- Total pre-genesis transactions: `{{ total_txs }}`
- Total validators: `{{ validators|length }}`
- Total delegations: `{{ total_delegations }}`
- Staked tokens: `{{ total_staked_tokens }} (~{{ total_staked_token_percentage }}%)`
Expand Down
29 changes: 20 additions & 9 deletions scripts/rebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@

def build_graph(validators):
validators_with_non_zero_stake = list(filter(lambda x: x['voting_power'] > 0, validators))

two_third_stake = (sum(list(map(lambda x: x['voting_power'], validators_with_non_zero_stake))) * 2) / 3
count, index = 0, 0
for idx, validator in enumerate(validators_with_non_zero_stake):
count += validator['voting_power']
if count >= two_third_stake:
index = idx
break

fig = go.Figure()
fig.add_trace(go.Bar(
x=[validator['alias'] if validator['alias'] else validator['address'] for validator in validators_with_non_zero_stake[:150]],
Expand All @@ -22,31 +31,33 @@ def build_graph(validators):
autosize=False,
width=1500,
height=750,
title="First 150 validators, sorted by voting power, with stake > 0"
title="First 150 validators by voting power. Green line is 67% voting power.",
uniformtext_minsize=2,
uniformtext_mode='hide',
)
fig.add_vline(x=index, line_width=1, line_dash="dash", line_color="green")
fig.update_xaxes(
tickangle=75,
tickangle=90,
)
fig.update_yaxes(automargin=True)

fig.write_image("images/validators.png")


def build_readme(validators):
def build_readme(validators, bonds):
environment = Environment(loader=FileSystemLoader("scripts/artifacts"))
template = environment.get_template("README.jinja")

total_staked_tokens = sum(map(lambda x: x['voting_power'], validators))
total_staked_token_percentage = round((total_staked_tokens / TOTAL_SUPPLY) * 100, 2)
total_delegations = sum(map(lambda x: x['total_delegations'], validators))

print(total_delegations)

content = template.render({
"validators": validators,
"total_staked_token_percentage": total_staked_token_percentage,
"total_staked_tokens": total_staked_tokens,
"total_delegations": total_delegations
"total_delegations": total_delegations,
"total_txs": len(validators) + len(bonds)
})

with open("README.md", mode="w", encoding="utf-8") as message:
Expand Down Expand Up @@ -106,7 +117,7 @@ def parse_validators():
'total_delegations': target_delegations[validator['address']] if validator['address'] in target_delegations else 0,
})

return sorted(validators, key=lambda d: d['voting_power'], reverse=True)
return sorted(validators, key=lambda d: d['voting_power'], reverse=True), bonds


def merge_transactions():
Expand All @@ -129,9 +140,9 @@ def merge_transactions():


def main():
validators = parse_validators()
validators, bonds = parse_validators()
build_graph(validators)
build_readme(validators)
build_readme(validators, bonds)
merge_transactions()

if __name__ == "__main__":
Expand Down
7 changes: 7 additions & 0 deletions transactions/shikkiy2-bond.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[bond]]
source = "tpknam1qz4rcsutrgur7w8j33f4syl35ffvemh5xhr3r2ae0dy330s94kvecwecl58"
validator = "tnam1q9rq7p4wzy6fea96xs5sr8qnsxsfdr2zugfsvw2n"
amount = "105"

[bond.signatures]
tpknam1qz4rcsutrgur7w8j33f4syl35ffvemh5xhr3r2ae0dy330s94kvecwecl58 = "signam1qrkxsha7pgj24023kzw8hzye6gwkuerhxveceuvv34z7kqswjwkca36wvqfv38x5jhj2kfkav0tl8y57nkgvddla6ymye9028a2kk7qpgp2ppc"

0 comments on commit e44947b

Please sign in to comment.