Joystream / Joystream/joystream

Giza integration tests: Distributor node CLI commands

Open
#2,839 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

estimate-12h giza network-integration-test qn-hydra-board query-node to-triage
Dominant language
Rust
Stars
1.4k
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Preconditions:

  • A running Joystream node
  • A running query-node
  • Distribution lead is hired

Optimistic flow:

  1. Hire 3 distribution workers

  2. Initial setup

    1. Execute leader:set-buckets-per-bag-limit -l 4
    2. Create 2 families via leader:create-bucket-family, save output ids to f1 and f2
    3. Create 2 buckets in each family via leader:create-bucket -f ${f} -a yes, save output ids to B1-B4
    4. Execute leader:update-dynamic-bag-policy -t Member -p ${f1}:1 ${f2}:2
    5. Execute leader:update-dynamic-bag-policy -t Channel -p ${f1}:1 ${f2}:2
    6. Execute leader:update-bag -b {b} -f ${f1} -a ${B1} ${B2} for each static bag type {b}
    7. Execute leader:update-bag -b {b} -f ${f2} -a ${B3} ${B4} for each static bag type {b}
    8. Check the state in query node and chain.
  3. First state mutation

    1. Execute leader:update-bucket-status -f ${f1} -B ${B1} --acceptingBags no
    2. Execute leader:update-bucket-mode -f ${f1} -B ${B1} --mode off
    3. Execute leader:invite-bucket-operator -f ${f1} -B ${B1} -w ${w1}
    4. Execute leader:invite-bucket-operator -f ${f1} -B ${B2} -w ${w2}
    5. Execute leader:invite-bucket-operator -f ${f2} -B ${B3} -w ${w3}
    6. Execute leader:set-bucket-family-metadata -f ${f1} -i ${fm1} (see fm1 defined under Family metadata updates)
    7. Execute leader:update-bag -b {b} -f ${f1} -r ${B1} ${B2} for each static bag type {b}
    8. Execute leader:update-bag -b {b} -f ${f2} -r ${B3} ${B4} for each static bag type {b}
    9. Execute leader:update-dynamic-bag-policy -t Member -p ${f1}:0
    10. Execute leader:update-dynamic-bag-policy -t Channel -p ${f1}:0
    11. Check the state in query node and chain.
  4. Second state mutation

    1. Execute operator:accept-invitation -f ${f1} -B ${B1} -w ${w1}
    2. Execute operator:accept-invitation -f ${f1} -B ${B2} -w ${w2}
    3. Execute leader:cancel-invitation -f ${f2} -B ${B3} -w ${w3}
    4. Execute operator:set-metadata -f ${f1} -B ${B1} -w {w1} -i ${om1} (see om1 defined under Operator metadata updates)
    5. Execute leader:set-bucket-family-metadata -f ${f1} -i ${fm2} (see fm2 defined under Family metadata updates)
    6. Execute leader:update-bucket-status -f ${f1} -B ${B1} --acceptingBags yes
    7. Execute leader:update-bucket-mode -f ${f1} -B ${B1} --mode on
    8. Execute leader:update-dynamic-bag-policy -t Channel -p ${f1}:2
    9. Execute leader:update-dynamic-bag-policy -t Member -p ${f1}:1
    10. Check the state in query node and chain.
  5. Thrid state mutation

    1. Execute operator:set-metadata -f ${f1} -B ${B1} -w {w1} -i ${om2} (see om2 defined under Operator metadata updates)
    2. Execute leader:set-bucket-family-metadata -f ${f1} -i ${fm3} (see fm3 defined under Family metadata updates)
    3. Execute leader:remove-bucket-operator -f ${f1} -B ${B2} -w {w2}
    4. Execute leader:delete-bucket -f ${f2} -B ${B3}
    5. Execute leader:delete-bucket -f ${f2} -B ${B4}
    6. Check the state in query node and chain.
  6. Fourth state mutation

    1. Execute operator:set-metadata -f ${f1} -B ${B1} -w {w1} -i ${om3} (see om2 defined under Operator metadata updates)
    2. Execute leader:remove-bucket-operator -f ${f1} -B ${B2} -w {w2}
    3. Execute leader:delete-bucket-family -f ${f2}
    4. Check the state in query node and chain.

Family metadata updates:

  1. Full metadata (fm1):
{
  "region": "eu-west",
  "description": "Western Europe",
  "areas": [
    { "countryCode": "AT" },
    { "countryCode": "BE" },
    { "countryCode": "FR" },
    { "countryCode": "DE" },
    { "countryCode": "LI" },
    { "countryCode": "LU" },
    { "countryCode": "MC" },
    { "countryCode": "NL" },
    { "countryCode": "CH" }
  ],
  "latencyTestTargets": [
    "euw-1.joystream.org",
    "euw-2.joystream.org",
    "euw-3.joystream.org",
    "euw-4.joystream.org",
  ]
}
  1. Partial update (fm2):
{
  "latencyTestTargets": [
    "w1.joystream.eu",
    "w2.joystream.eu"
  ]
}
  1. Unsetting (fm3):
{
  "region": "",
  "description": "",
  "areas": [{}],
  "latencyTestTargets": [""]
}

Operator metadata updates:

  1. Full metadata (om1):
{
  "endpoint": "http://localhost:3334",
  "location": {
    "countryCode": "DE",
    "city": "Berlin",
    "coordinates": {
      "latitude": 52.520008,
      "longitude": 13.404954
    }
  },
  "extra": "Some additional information"
}
  1. Partial update (om2):
  "location": {
    "countryCode": "PL",
    "city": "Warsaw",
  },
  1. Unsetting (om3):
{
  "endpoint": "",
  "location": {},
  "extra": ""
}

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

The issue names no file or existing test path. Start by locating the Giza integration-test entry point and the Distributor node CLI handlers, then follow the listed setup and state-mutation flows. Done means the commands execute successfully and the resulting state is checked in both the query node and chain.

Written by the indexing model from the issue text.

Assessment

Domain
blockchain, cli, testing-qa
Issue type
Feature
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.