utils.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. export const getSubkeyContainers = (validators: number, dataPath: string) => {
  2. const result = []
  3. for (let i = 1; i <= validators; i++) {
  4. result.push({
  5. name: `subkey-node-${i}`,
  6. image: 'parity/subkey:latest',
  7. command: ['/bin/sh', '-c'],
  8. args: [`subkey generate-node-key >> ${dataPath}/privatekey${i} 2>> ${dataPath}/publickey${i}`],
  9. volumeMounts: [
  10. {
  11. name: 'config-data',
  12. mountPath: dataPath,
  13. },
  14. ],
  15. })
  16. }
  17. return result
  18. }
  19. export const getValidatorContainers = (validators: number, dataPath: string, chainSpecPath: string) => {
  20. const result = []
  21. for (let i = 1; i <= validators; i++) {
  22. result.push({
  23. name: `joystream-node-${i}`,
  24. image: 'joystream/node:latest',
  25. args: [
  26. '--chain',
  27. chainSpecPath,
  28. '--pruning',
  29. 'archive',
  30. '--node-key-file',
  31. `${dataPath}/privatekey${i}`,
  32. '--keystore-path',
  33. `${dataPath}/data/auth-${i - 1}`,
  34. '--validator',
  35. '--log',
  36. 'runtime,txpool,transaction-pool,trace=sync',
  37. ],
  38. volumeMounts: [
  39. {
  40. name: 'config-data',
  41. mountPath: dataPath,
  42. },
  43. ],
  44. })
  45. }
  46. return result
  47. }