add sh files

This commit is contained in:
vvzvlad 2024-09-21 23:51:36 +03:00
parent 8183934d09
commit 9be7df6bcf
3 changed files with 18 additions and 8 deletions

View File

@ -19,11 +19,9 @@
path: "~/.bash_history"
create: true
block: |
cd ~/ritual; bash rebuild.sh
nano ~/ritual/projects/hello-world/container/config.json
docker logs infernet-node -f
cd ~/ritual; project=hello-world make deploy-container
cd ~/ritual; project=hello-world make deploy-contracts
cd ~/ritual; contract_address=$(jq -r '.transactions[0].contractAddress' projects/hello-world/contracts/broadcast/Deploy.s.sol/8453/run-latest.json); checksum_address=$(python3 toChecksumAddress.py $contract_address); sed -i "s/SaysGM(.*/SaysGM($checksum_address);/" projects/hello-world/contracts/script/CallContract.s.sol
cd ~/ritual; project=hello-world make call-contract
marker: ""
mode: '0644'
@ -195,10 +193,7 @@
failed_when: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" not in contract_deploy_output.stdout'
- name: Update CallContract.s.sol with contract address
ansible.builtin.shell: |
contract_address=$(jq -r '.transactions[0].contractAddress' projects/hello-world/contracts/broadcast/Deploy.s.sol/8453/run-latest.json)
checksum_address=$(python3 toChecksumAddress.py $contract_address)
sed -i "s/SaysGM(.*/SaysGM($checksum_address);/" projects/hello-world/contracts/script/CallContract.s.sol
ansible.builtin.shell: bash update_contracts.sh
args:
chdir: "{{ ansible_env.HOME }}/ritual"

8
rebuild.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
set -e
cd ~/ritual
project=hello-world make deploy-container
project=hello-world make deploy-contracts
bash update_contracts.sh
project=hello-world make call-contract

7
update_contracts.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e
cd ~/ritual
contract_address=$(jq -r '.transactions[0].contractAddress' projects/hello-world/contracts/broadcast/Deploy.s.sol/8453/run-latest.json)
checksum_address=$(python3 toChecksumAddress.py $contract_address)
sed -i "s/SaysGM(.*/SaysGM($checksum_address);/" projects/hello-world/contracts/script/CallContract.s.sol