joystream icon indicating copy to clipboard operation
joystream copied to clipboard

Giza integration tests: Distributor node CLI commands

Open Lezek123 opened this issue 4 years ago • 0 comments

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": ""
}

Lezek123 avatar Nov 21 '21 14:11 Lezek123