reproduce-giza-issue.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env bash
  2. set -e
  3. ## Run a local development chain
  4. docker-compose up -d joystream-node
  5. # Init the chain with 2 storage buckets that have high limits set
  6. # The DynamicBagPolicy for Channel should be "numberOfStorageBuckets: 2" after this step is done
  7. ./tests/network-tests/run-test-scenario.sh giza-issue-reproduction-setup
  8. # Set env for CLI's
  9. export AUTO_CONFIRM=true
  10. export ACCOUNT_URI=//testing//worker//Storage//0 # Storage lead account uri for storage CLI
  11. # Setup the CLI:
  12. yarn joystream-cli api:setUri ws://localhost:9944
  13. yarn joystream-cli account:choose --address 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
  14. yarn joystream-cli api:setQueryNodeEndpoint http://localhost:8081/graphql
  15. # Set very low limits for storage bucket 0
  16. yarn storage-node leader:set-bucket-limits -i 0 -s 100 -o 1
  17. # Create a channel (the transaction will fail due to low limits of bucket 0)
  18. yarn joystream-cli content:createChannel --context Member -i ./cli/examples/content/CreateChannel.json || true
  19. # Update DynamicBagPolicy to 1 storage bucket per channel bag
  20. yarn storage-node leader:update-dynamic-bag-policy -t Channel -n 1
  21. # Disable storage bucket 0
  22. yarn storage-node leader:update-bucket-status -i 0 --set off
  23. # Create a channel (the transaction still fails, which is unexpected)
  24. yarn joystream-cli content:createChannel --context Member -i ./cli/examples/content/CreateChannel.json || true
  25. # Increase limits of bucket 0
  26. yarn storage-node leader:set-bucket-limits -i 0 -s 1000000000 -o 1000
  27. # Create a channel
  28. yarn joystream-cli content:createChannel --context Member -i ./cli/examples/content/CreateChannel.json
  29. # Notice that channel bag get's assigned to both bucket 0 and 1, even though:
  30. # 1. Bucket 0 is disabled
  31. # 2. DynamicBagPolicy for Channel has "numberOfStorageBuckets: 1"