Skip to content

Proper notary scripts#127

Merged
ca333 merged 2 commits intoKomodoPlatform:devfrom
kolobus:dev
May 11, 2020
Merged

Proper notary scripts#127
ca333 merged 2 commits intoKomodoPlatform:devfrom
kolobus:dev

Conversation

@kolobus
Copy link
Copy Markdown
Contributor

@kolobus kolobus commented May 6, 2020

Replaces assetchains script, fiat-cli script from Komodo repo and old folders fiat and ac there. Also replaces m_notary_* manning scripts with single one.

Old scripts can be removed only after instructing NNs with new scripts and fixing docs.

Possible improvements:
1. Single ~/config.nn to define: pubkey, binary paths, delay, wallet passphrase file (?), seed ip.
2. jq to read json file instead of separate python scripts.

@kolobus kolobus requested review from DeckerSU, ca333 and tonymorony May 6, 2020 01:41
@tonymorony
Copy link
Copy Markdown
Contributor

@kolobus https://github.com/KomodoPlatform/dPoW/blob/dev/iguana/launch_assetchains.sh probably this one should be deleted in this PR?

@TheComputerGenie
Copy link
Copy Markdown
Contributor

@kolobus https://github.com/KomodoPlatform/dPoW/blob/dev/iguana/launch_assetchains.sh probably this one should be deleted in this PR?

please don't

@tonymorony
Copy link
Copy Markdown
Contributor

tonymorony commented May 6, 2020

@TheComputerGenie why? scripts moving to dPoW repo wasn't even announced yet and this script is outdated (and by the way not-working) duplicate now.

@TheComputerGenie
Copy link
Copy Markdown
Contributor

Not sure which part is "outdated" or now broken, so I'll go back to my hole now

@tonymorony
Copy link
Copy Markdown
Contributor

@TheComputerGenie probably you mixed dPOW and komodo (daemon) repositories or not checked script by link in my comment to which you've reffered, I'm not sure.

Not sure which part is "outdated"

https://github.com/KomodoPlatform/dPoW/blob/dev/iguana/launch_assetchains.sh is outdated because https://github.com/kolobus/dPoW/blob/dev/iguana/assets.sh doing same thing

or now broken

https://github.com/KomodoPlatform/dPoW/blob/dev/iguana/launch_assetchains.sh is not working because tilda inside ~ of "" so it's not parsing correct: https://github.com/KomodoPlatform/dPoW/blob/dev/iguana/launch_assetchains.sh#L8
In new script it fixed by usage of $HOME env var

@kolobus
Copy link
Copy Markdown
Contributor Author

kolobus commented May 7, 2020

We should first implement and merge new scripts (m_notary replacement is also coming) and after that I'll cover deleting all old stuff and updating documents. Otherwise a lot of questions will be.

@kolobus
Copy link
Copy Markdown
Contributor Author

kolobus commented May 7, 2020

Can we implement general config like above in this iteration, @tonymorony ?

@tonymorony
Copy link
Copy Markdown
Contributor

tonymorony commented May 7, 2020

We should first implement and merge new scripts (m_notary replacement is also coming) and after that I'll cover deleting all old stuff and updating documents. Otherwise a lot of questions will be.

I'm not about old stuff. I'm about script which was merged in this PR #124 ...

#127 (comment)

Can we implement general config like above in this iteration, @tonymorony ?

It looks like we reinventing this one:
https://github.com/webworker01/nntools/blob/master/config.example

@DeckerSU
Copy link
Copy Markdown
Contributor

DeckerSU commented May 7, 2020

I guess we are paying too much attention to all of these scripts. My offer is to make something like "base version". Mean, assets.sh in this PR is enough for start and enough for newcomers (just need to describe its features in docs). All other improvements everybody can made by themselves. Personally me, never used these scripts, probably only assetchains.old was important, as just a storage of AC params 😀

p.s. we can improove these scripts infinitely, but as i guess main purpose of these scripts is to allow everyone "quick start" and learn how the things working. after op is understand how it's working - he definitely will write his own version with improvements needed by him.

just an example, i can offer following:

iguana/assets.sh Outdated
@@ -0,0 +1,39 @@
#!/bin/bash
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#!/bin/bash
#!/usr/bin/env bash

iguana/assets.sh Outdated
seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'`
komodo_binary="$HOME/komodo/src/komodod"
cli_binary="$HOME/komodo/src/komodo-cli"
delay=20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
delay=20
delay=${delay:-20}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for hint. It's moved to config in newer version

tonymorony added a commit that referenced this pull request May 7, 2020
Deleting not working script duplicating one PRed in #127
@tonymorony tonymorony marked this pull request as draft May 7, 2020 03:45
@KomodoPlatform KomodoPlatform deleted a comment from todo bot May 8, 2020
@KomodoPlatform KomodoPlatform deleted a comment from todo bot May 8, 2020
@KomodoPlatform KomodoPlatform deleted a comment from todo bot May 8, 2020
@kolobus
Copy link
Copy Markdown
Contributor Author

kolobus commented May 8, 2020

I added newer versions of both scripts with fixes. Tested on both nodes but needs more attention before merging.

Will also require huge manual modification for new season.

pipefail commented out because it should not fail when one chain/operation failed.

@kolobus kolobus requested review from DeckerSU and tonymorony May 8, 2020 08:56
@kolobus kolobus changed the title Proper assetchains script Proper notary scripts May 8, 2020
# unlock any locked utxos. This will unlock utxos for both iguans, need a filter for address to only unlock the pubkey you need to restart.
komodo-cli lockunspent true `komodo-cli listlockunspent | jq -c .`
# unlock any locked utxos. This will unlock utxos for both iguans, need a filter for address to only unlock the pubkey you need to restart.
komodo-cli lockunspent true `komodo-cli listlockunspent | jq -c .`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use komodo_binary variable as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes here. That’s an old script. My editor fixed white spaces there and commited it, sorry, my mistake

Copy link
Copy Markdown
Contributor

@DeckerSU DeckerSU May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not about whitespaces ... it's about komodo-cli binary. Script uses system-wide komodo-cli binary, but should use komodo_binary variable.

It should be:

$komodo_binary lockunspent true `komodo-cli listlockunspent | jq -c .`

instead of:

komodo-cli lockunspent true `komodo-cli listlockunspent | jq -c .`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s an old script not related to this PR. I will remove that from commit ASAP

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, keep this spaces fix in this PR. Editor insists on this fix :) Thanks.

sleep 3

# TODO: Need to get some seeds for both networks.
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"178.128.93.117\"}" # lukechilds_AR
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, good to change this bunch of curl calls on something like this:

declare -a seeds_mainnet=(178.128.93.117 67.207.94.69)
for seed_ip in "${seeds_mainnet[@]}"
do
   curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"${seed_ip}\"}"
done

Copy link
Copy Markdown
Contributor

@DeckerSU DeckerSU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

@kolobus
Copy link
Copy Markdown
Contributor Author

kolobus commented May 8, 2020

Isn’t it different servers or at min different users? Both passphrases should never be in a same file

@DeckerSU
Copy link
Copy Markdown
Contributor

DeckerSU commented May 8, 2020

Isn’t it different servers or at min different users? Both passphrases should never be in a same file

yes, you are absolutely right. that was my bad, that's why i deleted comment right after i posted it. all is ok in that part. sorry for false alarm.

@kolobus kolobus marked this pull request as ready for review May 10, 2020 01:12
@ca333 ca333 merged commit 997df1f into KomodoPlatform:dev May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants