Joystream / Joystream/joystream

General Procedure to update @joystream/types for a new runtime

Open
#1,835 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.4k
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Updating @joystream/types package

Outlined below are steps we need to take update @joystream/types package for a new runtime.

  • Bump the package version
  • Update the package.json dependencies of dependent packages in the monorepo to use the new version of @joystream/types
  • Identify the version of @polkadot/api (keying, types, util, util-crypto) that matches with the new version of substrate being used in the runtime and update all packages in the monorepo, as well as the root package.json 'resolutions' with these versions.
  • Identify new public types introduced in the runtime, or modified existing types.
    • by examining runtime code / code diff
    • by running a basic script to connect to the joystream-node with the new runtime and looking at warnings and/or errors about Unknown types.
      yarn workspace api-scripts status
      api-scripts might need its dependencies updated before it works with new runtime
  • Identify public types and modules removed from the runtime compared with prior version.
  • Update the types package by defining the new types, updating existing ones if necessary, and removing unused types.
  • New polkadot api version might have API changes, and the types package will need to be updated accordingly. For example some core type names might have changed like (AccountId --> Address)
  • Running the generate:all script in the @joystream/types package to generate augment codec files
  • Running build script to ensure build works. (linting and formatting also goes without saying)

Its possible to use the hosted polkadot apps by pointing it to our node, and injecting the types definition file types/augment/all/def.json to test basic functionality (functionality common to substrate and joystream)
This will work reasonably well if the version of polkadot and api and types are compatible with our version of substrate. For olympia where we have updated to v2.0.0 of substrate I think the api should be stable enough that it should work)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the @joystream/types package and the root and dependent package.json files, then review the runtime code or diff for public type changes. Run yarn workspace api-scripts status against the new runtime, followed by the package's generate:all and build scripts. Done means the procedure documents dependency updates, type additions or removals, generated augment files, and successful builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
blockchain, documentation, tooling
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.