run-all-commands.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/env bash
  2. # Must be run on the clean development chain.
  3. # It tests all leader and operator commands.
  4. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  5. cd $SCRIPT_PATH
  6. CLI=../bin/run
  7. # Set Alice as leader
  8. GROUP=storageWorkingGroup yarn workspace api-scripts initialize-lead # leader workerId = 0
  9. # Update limits and constants
  10. ${CLI} leader:update-bag-limit -l 7 --dev
  11. ${CLI} leader:update-voucher-limits -o 100 -s 10000000 --dev
  12. ${CLI} leader:update-data-fee -f 10000 --dev
  13. ${CLI} leader:update-dynamic-bag-policy -n 10 -t Member --dev
  14. # Create and configure a bucket.
  15. BUCKET_ID=`${CLI} leader:create-bucket -i=0 --dev` # bucketId = 0
  16. ${CLI} operator:accept-invitation -w=0 -i=${BUCKET_ID} --dev -t=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
  17. ${CLI} leader:set-bucket-limits -i=${BUCKET_ID} -o=100 -s=10000000 --dev
  18. ${CLI} leader:update-bucket-status -i=${BUCKET_ID} --set on --dev
  19. ${CLI} leader:update-bag -a=${BUCKET_ID} -i static:council --dev
  20. ${CLI} operator:set-metadata -w=0 -i=${BUCKET_ID} -e=http://localhost:3333 --dev
  21. ${CLI} operator:set-metadata -w=0 -i=${BUCKET_ID} -j=./operatorMetadata.json --dev
  22. # Create and delete a bucket
  23. BUCKET_ID=`${CLI} leader:create-bucket -a -n=100 -s=10000000 --dev` # bucketId = 1
  24. ${CLI} leader:delete-bucket -i=${BUCKET_ID} --dev
  25. # Create a bucket, invite operator, cancel invite, accept invitation and remove operator.
  26. BUCKET_ID=`${CLI} leader:create-bucket -a -n=100 -s=10000000 --dev` # bucketId = 2
  27. ${CLI} leader:invite-operator -i=${BUCKET_ID} -w=0 --dev
  28. ${CLI} leader:cancel-invite -i=${BUCKET_ID} --dev
  29. ${CLI} leader:invite-operator -i=${BUCKET_ID} -w=0 --dev
  30. ${CLI} operator:accept-invitation -i=${BUCKET_ID} -w=0 --dev -t=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
  31. ${CLI} leader:remove-operator -i=${BUCKET_ID} --dev
  32. # Toggle uploading block.
  33. ${CLI} leader:set-global-uploading-status --set on --dev
  34. ${CLI} leader:set-global-uploading-status --set off --dev
  35. # Blacklist.
  36. ${CLI} leader:update-blacklist -a BLACKLISTED_CID -r SOME_CID --dev