Skip to content

Extract Stakeholder CLI and Deploy Actions#1056

Merged
tuxxy merged 28 commits intonucypher:sekanjabinfrom
KPrasch:croquetas
Jul 18, 2019
Merged

Extract Stakeholder CLI and Deploy Actions#1056
tuxxy merged 28 commits intonucypher:sekanjabinfrom
KPrasch:croquetas

Conversation

@KPrasch
Copy link
Member

@KPrasch KPrasch commented Jun 6, 2019

This PR goes into the Sekanjabin Epic (#1107); Refactors the staking CLI to suit the StakeHolder and makes improvements to the usability of development deployment.

Based on #1064

Fixes #1119
Contributes to fixing #1117

Introduces #1125

Status

Still has failing mixed-configuration tests, possibly related to federated vs. non-federated keyring attachment methods on Ursula. Needs interactive reviews and Issue-opening follow-ups.

Interactive Review in 4 Steps
1- Run Development Blockchain
geth --dev --dev.period 2
2 - Deploy Contracts
nucypher-deploy contracts --provider-uri ipc:///tmp/geth.ipc --poa --dev
3 - Create StakeHolder
nucypher stake new-stakeholder --provider-uri file:///tmp/geth.ipc --registry-filepath  ~/.local/share/nucypher/dev_contract_registry.json  --poa
4 - Initialize Stake
nucypher stake init

@codecov
Copy link

codecov bot commented Jun 7, 2019

Codecov Report

Merging #1056 into sekanjabin will increase coverage by 1.9%.
The diff coverage is 78.65%.

Impacted file tree graph

@@              Coverage Diff              @@
##           sekanjabin    #1056     +/-   ##
=============================================
+ Coverage       81.55%   83.46%   +1.9%     
=============================================
  Files              70       71      +1     
  Lines            9527     9707    +180     
=============================================
+ Hits             7770     8102    +332     
+ Misses           1757     1605    -152
Impacted Files Coverage Δ
nucypher/crypto/powers.py 94.47% <ø> (-0.62%) ⬇️
nucypher/blockchain/eth/token.py 87.29% <ø> (+0.33%) ⬆️
nucypher/config/keyring.py 89.13% <ø> (+0.63%) ⬆️
nucypher/config/characters.py 99.16% <100%> (+0.05%) ⬆️
nucypher/blockchain/eth/interfaces.py 80.45% <100%> (-0.16%) ⬇️
nucypher/cli/types.py 81.48% <100%> (ø) ⬆️
nucypher/cli/characters/alice.py 77.39% <100%> (+1.73%) ⬆️
nucypher/cli/main.py 88.7% <100%> (+0.18%) ⬆️
nucypher/blockchain/eth/agents.py 91.95% <100%> (+2.09%) ⬆️
nucypher/config/node.py 90.53% <100%> (+0.37%) ⬆️
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04122fe...2c4b5cf. Read the comment docs.

@cygnusv cygnusv force-pushed the alhambra-verde branch 4 times, most recently from ffdb6f6 to e2a3ec9 Compare June 10, 2019 10:02
@cygnusv cygnusv force-pushed the alhambra-verde branch 2 times, most recently from 4eca13d to b1572a7 Compare June 11, 2019 08:05
@KPrasch KPrasch added the CLI This effects the nucypher CLI label Jun 13, 2019
@KPrasch KPrasch force-pushed the croquetas branch 2 times, most recently from 72e6633 to 83d7993 Compare June 14, 2019 00:59
@KPrasch KPrasch changed the title Extracts staking CLI to 'nucypher stake' entry point StakeHolder CLI Jun 14, 2019
cygnusv added a commit to cygnusv/nucypher that referenced this pull request Jun 14, 2019
cygnusv added a commit to cygnusv/nucypher that referenced this pull request Jun 17, 2019
cygnusv added a commit that referenced this pull request Jun 18, 2019
cygnusv added a commit that referenced this pull request Jun 20, 2019
cygnusv added a commit that referenced this pull request Jun 26, 2019
KPrasch added a commit to KPrasch/nucypher that referenced this pull request Jul 17, 2019
@KPrasch KPrasch added the Ursula 👩‍🚀 Effects the "Ursula" development area label Jul 17, 2019
KPrasch added 3 commits July 16, 2019 19:50
…n to/from UrsulaConfiguration; Attempting to fix reward collection CLI integration tests.
…inflation rewards to specified account or funding account. Touch up reward collection assertions.
@cygnusv
Copy link
Member

cygnusv commented Jul 17, 2019

Just a placeholder. I want to review this but it will have to be tonight, before I leave. In any case, I've been using this as the base of #1111, so if you don't hear about me after today 23:59 CEST, it's an implicit approval.

@KPrasch KPrasch changed the title Extract Stakeholder and Common CLI Deploy Actions Extract Stakeholder CLI and Deploy Actions Jul 17, 2019
@cygnusv
Copy link
Member

cygnusv commented Jul 17, 2019

There's a tiny bug when handling the receipts of the deployment of UserEscrowProxy, which is composed of 2 steps, and the only first one is printed, but twice. Just to let you know this is fixed in #1111.
E.g.:

UserEscrowProxy (0xD89a96A5C37b9326Dc332037d6034D89c6d35641)
************************************************************
OK | deployment | 0xf40f3a24c79c1721f671991d68ddd5f59cde26dc7efed3641eeca28b25b95211 (1302579 gas)
Block #114 | 0x4f688ac25eef491830b1031b6d0392d53be267942477a9dcab578986663d3b5b

OK | proxy_deployment | 0xf40f3a24c79c1721f671991d68ddd5f59cde26dc7efed3641eeca28b25b95211 (1302579 gas)
Block #114 | 0x4f688ac25eef491830b1031b6d0392d53be267942477a9dcab578986663d3b5b

Copy link
Contributor

@tuxxy tuxxy left a comment

Choose a reason for hiding this comment

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

A few things here that I uncovered during a UX audit with a hardware wallet:

1. Instead of --device, let's do --hw-wallet/--no-hw-wallet.
2. Don't prompt for stakes in Nunits, let's do a float.
3. When I specify --device when creating a new stake-holder, it should specify that that stakeholder is a device so I don't need to do --device when I perform a stake init (maybe? I guess it'll be a default, so it's kinda moot.)
4. It prompts for my passphrase despite using a hardware wallet and then tries to use it when I want to publish the stake on the blockchain; thus, preventing me from staking with a hardware wallet.
5. A better explanation of what a "period" is during the stake initialization process would be ideal.

Copy link
Member

@cygnusv cygnusv left a comment

Choose a reason for hiding this comment

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

Apart from the suggested changes, I also had a minor problem with the stakeholder JSON config file. At some moment I had 2 of them, one named stakeholder.json and the other stakeholder-0xfoobar.json, and I had to remove the former and change the name of the latter to stakeholder.json to continue working.

Copy link
Member

@cygnusv cygnusv left a comment

Choose a reason for hiding this comment

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

I've just successfully staked (yay!) and set a worker.

One issue I've found is that when using option 'c', it's not creating a new account in the end, but staking with the funding account. I'm sure it's just a minor bug when handling the address in nucypher stake init. Also, as a consequence of the above, it's funding the funding account from the funding account :P

@KPrasch
Copy link
Member Author

KPrasch commented Jul 18, 2019

@cygnusv - Yes I also noticed this. Noted.

Co-Authored-By: Derek Pierre <derek.pierre@gmail.com>
Copy link
Contributor

@tuxxy tuxxy left a comment

Choose a reason for hiding this comment

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

🐧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI This effects the nucypher CLI Ursula 👩‍🚀 Effects the "Ursula" development area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants