run-test-node.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Location that will be mounted as the /data volume in containers
  2. # This is how we access the initial members and balances files from
  3. # the containers and where generated chainspec files will be located.
  4. DATA_PATH="test-data"
  5. # Initial account balance for Alice
  6. # Alice is the source of funds for all new accounts that are created in the tests.
  7. ALICE_INITIAL_BALANCE=100000000
  8. rm -Rf ${DATA_PATH}
  9. mkdir -p ${DATA_PATH}
  10. echo "{
  11. \"balances\":[
  12. [\"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY\", ${ALICE_INITIAL_BALANCE}]
  13. ]
  14. }" > ${DATA_PATH}/initial-balances.json
  15. # Make Alice a member
  16. echo '
  17. [{
  18. "member_id": 0,
  19. "root_account": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
  20. "controller_account": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
  21. "handle":"alice_with_a_long_handle",
  22. "avatar_uri":"https://alice.com/avatar.png",
  23. "about":"Alice",
  24. "name": "Alice",
  25. "registered_at_time": 0
  26. },
  27. {
  28. "member_id": 1,
  29. "root_account": "5FUeDYFzvvizNhhHyidsuchG7jnToKj7zfimbWBpWKzT9Fqe",
  30. "controller_account": "5FUeDYFzvvizNhhHyidsuchG7jnToKj7zfimbWBpWKzT9Fqe",
  31. "handle":"bob_with_a_long_handle",
  32. "avatar_uri":"https://bob.com/avatar.png",
  33. "about":"Bob",
  34. "name": "Bob",
  35. "registered_at_time": 0
  36. }
  37. ]
  38. ' > ${DATA_PATH}/initial-members.json
  39. function cleanup() {
  40. rm -Rf ${DATA_PATH}/alice
  41. }
  42. trap cleanup EXIT
  43. # Create a chain spec file
  44. ./target/release/chain-spec-builder new -a Alice \
  45. --chain-spec-path ${DATA_PATH}/chain-spec.json \
  46. --initial-balances-path ${DATA_PATH}/initial-balances.json \
  47. --initial-members-path ${DATA_PATH}/initial-members.json \
  48. --deployment dev \
  49. --sudo-account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
  50. ./target/release/joystream-node --base-path ${DATA_PATH}/alice \
  51. --validator --chain ${DATA_PATH}/chain-spec.json --alice --unsafe-ws-external --rpc-cors all