Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDW-257] Set up Shelley cardano-node selfnode environment #2462

Merged
merged 47 commits into from Mar 19, 2021

Conversation

nikolaglumac
Copy link
Contributor

@nikolaglumac nikolaglumac commented Mar 16, 2021

This PR sets up Shelley cardano-node selfnode environment.

Todos

Selfnode

  1. Run yarn nix:selfnode from daedalus.

  2. Run yarn dev from the subsequent nix-shell (use KEEP_LOCAL_CLUSTER_RUNNING environment variable to keep the local cluster running after Daedalus exits: KEEP_LOCAL_CLUSTER_RUNNING=true yarn dev)

  3. Once Daedalus has started and has gotten past the loading screen run the following commands from a new terminal window if you wish to import funded wallets:

    • Byron wallets: yarn byron:wallet:importer
    • Shelley wallets: yarn shelley:wallet:importer
    • Mary wallets: yarn mary:wallet:importer (all of which contain native tokens which are visible once selfnode enters Mary era)
    • Yoroi Byron wallets: yarn yoroi:wallet:importer
    • ITN Byron wallets: yarn itn:byron:wallet:importer [Deprecated]
    • ITN Shelley wallets: yarn itn:shelley:wallet:importer [Deprecated]

    These scripts import 3 wallets by default. You can import up to 10 wallets by supplying WALLET_COUNT environment variable (e.g. WALLET_COUNT=10 yarn mary:wallet:importer).

    List of all funded wallet recovery phrases can be found here: https://github.com/input-output-hk/daedalus/blob/shelley-test-cluster/utils/api-importer/mnemonics.js

Notes:

  • Cardano wallet process ID shown on the "Diagnostics" screen is faked and expected to match the Cardano node process ID.
  • Stake pool metadata is fetched directly by default (IOHK SMASH server option is not available).
  • Token metadata is fetched from a mock token metadata server which is automatically ran alongside the local cluster (there is no need to run it manually)
  • Daedalus will ask you if you wish to keep the local cluster running after it exits - this option is useful if you need to preserve local cluster state between Daedalus restarts.
Parameter Value
slotLength 0.2 sec
epochLength 50 slots
desiredPoolNumber 3
minimumUtxoValue 1 ADA

Screenshots

Screenshot 2021-03-19 at 11 03 33


Testing Checklist

  • Slack QA thread
  • Make sure you are able to run the selfnode locally and import all types of wallets using the wallet-importer scripts
  • Try basic wallet operations such as tx-features/delegation-features/native-tokens

Review Checklist

Basics

  • PR has been assigned and has appropriate labels (feature/bug/chore, release-x.x.x)
  • PR is updated to the most recent version of the target branch (and there are no conflicts)
  • PR has a good description that summarizes all changes
  • PR has default-sized Daedalus window screenshots or animated GIFs of important UI changes:
    • In English
    • In Japanese
  • CHANGELOG entry has been added to the top of the appropriate section (Features, Fixes, Chores) and is linked to the correct PR on GitHub
  • Automated tests: All acceptance and unit tests are passing (yarn test)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in development build (yarn dev)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in production build (yarn package / CI builds)
  • There are no flow errors or warnings (yarn flow:test)
  • There are no lint errors or warnings (yarn lint)
  • There are no prettier errors or warnings (yarn prettier:check)
  • There are no missing translations (running yarn manage:translations produces no changes)
  • Text changes are proofread and approved (Jane Wild / Amy Reeve)
  • Japanese text changes are proofread and approved (Junko Oda)
  • UI changes look good in all themes (Alexander Rukin)
  • Storybook works and no stories are broken (yarn storybook)
  • In case of dependency changes yarn.lock file is updated

Code Quality

  • Important parts of the code are properly commented and documented
  • Code is properly typed with flow
  • React components are split-up enough to avoid unnecessary re-renderings
  • Any code that only works in main process is neatly separated from components

Testing

  • New feature/change is covered by acceptance tests
  • New feature/change is manually tested and approved by QA team
  • All existing acceptance tests are still up-to-date
  • New feature/change is covered by Daedalus Testing scenario
  • All existing Daedalus Testing scenarios are still up-to-date

After Review

  • Merge the PR
  • Delete the source branch
  • Move the ticket to done column on the YouTrack board
  • Update Slack QA thread by marking it with a green checkmark

@@ -2667,14 +2673,14 @@ const _createWalletFromServerData = action(
return {
policyId: item.policy_id,
assetName: item.asset_name,
quantity: new BigNumber(item.quantity),
quantity: new BigNumber(item.quantity.toString()),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aleksandardjordjeviciohk @tomislavhoracek @yakovkaravelov @daniloprates @DominikGuzei we need to always convert quantities to string before passing them to BigNumber. This is a protection from JS number overflow. I have observed a lot of failures due to this happening in the selfnode environment.

Copy link
Contributor

Choose a reason for hiding this comment

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

@nikolaglumac Good catch. 👍

Copy link
Contributor

@topseniors topseniors left a comment

Choose a reason for hiding this comment

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

@nikolaglumac Amazing work. Just left minor comments.
Would you please review them?

source/main/cardano/CardanoSelfnodeLauncher.js Outdated Show resolved Hide resolved
source/main/index.js Show resolved Hide resolved
Copy link
Contributor

@tomislavhoracek tomislavhoracek left a comment

Choose a reason for hiding this comment

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

@nikolaglumac This is incredible 💯 💯 💯
I left just 2 comments / questions, but BIG approve!!

@nikolaglumac nikolaglumac merged commit 65e654d into develop Mar 19, 2021
@iohk-bors iohk-bors bot deleted the shelley-test-cluster branch March 19, 2021 18:55
@nikolaglumac nikolaglumac added release-4.0.3 Daedalus Mainnet and removed ⏳release-vNext labels Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature release-4.0.3 Daedalus Mainnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants