Skip to content

Commit

Permalink
Revert "chore: remove bash"
Browse files Browse the repository at this point in the history
This reverts commit baaafac.
  • Loading branch information
leovct committed Nov 8, 2023
1 parent 9cbb5ee commit c6ec038
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
14 changes: 7 additions & 7 deletions src/express/commands/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,16 @@ async function startServices(doc) {
await runSshCommand(ip, command, maxRetries)

console.log('📍Deploying main net contracts on machine ' + ip + ' ...')
command = 'cd ~/matic-cli/devnet && ./ganache-deployment.sh'
command = 'cd ~/matic-cli/devnet && bash ganache-deployment.sh'
await runSshCommand(ip, command, maxRetries)

console.log('📍Setting up validators on machine ' + ip + ' ...')
command = 'cd ~/matic-cli/devnet && ./ganache-stake.sh'
command = 'cd ~/matic-cli/devnet && bash ganache-stake.sh'
await runSshCommand(ip, command, maxRetries)
}

console.log('📍Setting up heimdall on machine ' + ip + ' ...')
command = 'cd ~/node && ./heimdalld-setup.sh'
command = 'bash ~/node/heimdalld-setup.sh'
await runSshCommand(ip, command, maxRetries)

console.log('📍Starting heimdall on machine ' + ip + ' ...')
Expand All @@ -221,15 +221,15 @@ async function startServices(doc) {

if (hostToIndexMap.get(ip) < returnTotalBorNodes(doc)) {
console.log('📍Setting bor on machine ' + ip + ' ...')
command = 'cd ~/node && ./bor-setup.sh'
command = 'bash ~/node/bor-setup.sh'
await runSshCommand(ip, command, maxRetries)

console.log('📍Starting bor on machine ' + ip + ' ...')
command = 'sudo systemctl start bor.service'
await runSshCommand(ip, command, maxRetries)
} else {
console.log('📍Setting erigon on machine ' + ip + ' ...')
command = 'cd ~/node && ./erigon-setup.sh'
command = 'bash ~/node/erigon-setup.sh'
await runSshCommand(ip, command, maxRetries)

console.log('📍Starting erigon on machine ' + ip + ' ...')
Expand All @@ -255,11 +255,11 @@ async function deployBorContractsAndStateSync(doc) {

console.log('📍Deploying contracts for bor on machine ' + ip + ' ...')
await timer(60000)
let command = 'cd ~/matic-cli/devnet && ./ganache-deployment-bor.sh'
let command = 'cd ~/matic-cli/devnet && bash ganache-deployment-bor.sh'
await runSshCommand(ip, command, maxRetries)

console.log('📍Deploying state-sync contracts on machine ' + ip + ' ...')
await timer(60000)
command = 'cd ~/matic-cli/devnet && ./ganache-deployment-sync.sh'
command = 'cd ~/matic-cli/devnet && bash ganache-deployment-sync.sh'
await runSshCommand(ip, command, maxRetries)
}
22 changes: 11 additions & 11 deletions src/express/commands/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ async function installCommonPackages(ip) {

console.log('📍Installing go...')
command = `wget -nc https://raw.githubusercontent.com/maticnetwork/node-ansible/master/go-install.sh &&
./go-install.sh --remove &&
./go-install.sh &&
bash go-install.sh --remove &&
bash go-install.sh &&
source ~/.bashrc`
await runSshCommand(ip, command, maxRetries)

Expand All @@ -191,7 +191,7 @@ async function installHostSpecificPackages(ip) {
let command = `curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash &&
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \\. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \\. "$NVM_DIR/bash_completion" &&
[ -s "$NVM_DIR/bash_completion" ] && \\. "$NVM_DIR/bash_completion" &&
nvm install 16.17.1`
await runSshCommand(ip, command, maxRetries)

Expand Down Expand Up @@ -382,30 +382,30 @@ async function runDockerSetupWithMaticCLI(ips, devnetId) {
await runSshCommand(ip, command, maxRetries)

console.log('📍Starting ganache...')
command = 'cd ~/matic-cli/devnet && ./docker-ganache-start.sh'
command = 'cd ~/matic-cli/devnet && bash docker-ganache-start.sh'
await runSshCommand(ip, command, maxRetries)

console.log('📍Starting heimdall...')
command = 'cd ~/matic-cli/devnet && ./docker-heimdall-start-all.sh'
command = 'cd ~/matic-cli/devnet && bash docker-heimdall-start-all.sh'
await runSshCommand(ip, command, maxRetries)

console.log('📍Setting up bor...')
command = 'cd ~/matic-cli/devnet && ./docker-bor-setup.sh'
command = 'cd ~/matic-cli/devnet && bash docker-bor-setup.sh'
await runSshCommand(ip, command, maxRetries)

console.log('📍Starting bor...')
command = 'cd ~/matic-cli/devnet && ./docker-bor-start-all.sh'
command = 'cd ~/matic-cli/devnet && bash docker-bor-start-all.sh'
await runSshCommand(ip, command, maxRetries)

if (!process.env.NETWORK) {
await timer(60000)
console.log('📍Deploying contracts for bor...')
command = 'cd ~/matic-cli/devnet && ./ganache-deployment-bor.sh'
command = 'cd ~/matic-cli/devnet && bash ganache-deployment-bor.sh'
await runSshCommand(ip, command, maxRetries)

await timer(60000)
console.log('📍Deploying state-sync contracts...')
command = 'cd ~/matic-cli/devnet && ./ganache-deployment-sync.sh'
command = 'cd ~/matic-cli/devnet && bash ganache-deployment-sync.sh'
await runSshCommand(ip, command, maxRetries)
}

Expand Down Expand Up @@ -450,12 +450,12 @@ async function runRemoteSetupWithMaticCLI(ips, devnetId) {
if (!process.env.NETWORK) {
console.log('📍Deploying contracts for bor on machine ' + ip + ' ...')
await timer(60000)
command = 'cd ~/matic-cli/devnet && ./ganache-deployment-bor.sh'
command = 'cd ~/matic-cli/devnet && bash ganache-deployment-bor.sh'
await runSshCommand(ip, command, maxRetries)

console.log('📍Deploying state-sync contracts on machine ' + ip + ' ...')
await timer(60000)
command = 'cd ~/matic-cli/devnet && ./ganache-deployment-sync.sh'
command = 'cd ~/matic-cli/devnet && bash ganache-deployment-sync.sh'
await runSshCommand(ip, command, maxRetries)
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/setup/bor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ export class Bor {
console.log(
chalk.gray('Setup bor chain') +
': ' +
chalk.bold.green('./bor-setup.sh')
chalk.bold.green('bash bor-setup.sh')
)
console.log(
chalk.gray('Start bor chain') +
': ' +
chalk.bold.green('./bor-start.sh')
chalk.bold.green('bash bor-start.sh')
)
console.log(
chalk.gray('Clean bor chain') +
': ' +
chalk.bold.green('./bor-clean.sh')
chalk.bold.green('bash bor-clean.sh')
)
}

Expand Down
6 changes: 3 additions & 3 deletions src/setup/bor/templates/BOR_README.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
To setup Bor node with genesis file:

```
./bor-setup.sh
bash bor-setup.sh
```

To start Bor node:

```
./bor-start.sh
bash bor-start.sh
```

To clean every bor data and setup again:

```
./bor-clean.sh
bash bor-clean.sh
```
12 changes: 6 additions & 6 deletions src/setup/ganache/templates/GANACHE_README.sh.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

By default, contracts are deployed.

Contract addresses json: {{ obj.contracts.contractAddressesPath }}
Contract addresses json: {{ obj.contracts.contractAddressesPath }}
Ganache DB path: {{ obj.dbDir }}

**To start ganache**

```bash
./ganache-start.sh
bash ganache-start.sh
```

##### Setup
Expand All @@ -18,25 +18,25 @@ Note that, by default, it doesn't need to setup.
**To clean current setup**

```bash
./ganache-clean.sh
bash ganache-clean.sh
```

**To start ganache**

```bash
./ganache-start.sh
bash ganache-start.sh
```

**To deploy on ganache**

```bash
./ganache-deployment.sh
bash ganache-deployment.sh
```

**To stake with default address**

```bash
./ganache-stake.sh
bash ganache-stake.sh
```

This will stake {{ obj.config.defaultStake }} tokens for {{ obj.config.primaryAccount.address }}
4 changes: 2 additions & 2 deletions src/setup/heimdall/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ export class Heimdall {
console.log(
chalk.gray('Setup heimdall') +
': ' +
chalk.bold.green('./heimdall-start.sh')
chalk.bold.green('bash heimdall-start.sh')
)
console.log(
chalk.gray('Reset heimdall') +
': ' +
chalk.bold.green('./heimdall-clean.sh')
chalk.bold.green('bash heimdall-clean.sh')
)
}

Expand Down

0 comments on commit c6ec038

Please sign in to comment.