Skip to content

Commit

Permalink
feat: modify deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Nov 1, 2023
1 parent 6e6a18a commit 82a7991
Show file tree
Hide file tree
Showing 12 changed files with 3,547 additions and 870 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 7 additions & 14 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ args = ["fmt"]
command = "cargo"
args = ["test", "--locked"]

[tasks.test-cover]
script = """docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin"""

[tasks.lint]
command = "cargo"
args = ["clippy", "--tests", "--", "-D", "warnings"]
Expand Down Expand Up @@ -49,22 +52,12 @@ docker run --rm -v "$(pwd)":/code \
${image}:0.14.0
"""


[tasks.deploy]
script = """
npm install -g ts-node
ts-node ./scripts/deploy-oracle.ts
ts-node ./scripts/deploy-hub.ts
"""

[tasks.deploy-oracle]
[tasks.store-code]
script = """
npm install -g ts-node
ts-node ./scripts/deploy-oracle.ts
ts-node ./scripts/store-code.ts
"""

[tasks.deploy-hub]
[tasks.migrate-contracts]
script = """
npm install -g ts-node
ts-node ./scripts/deploy-hub.ts
ts-node ./scripts/execute-migrate-contracts.ts
"""
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Take in consideration that the XLarge dataset almost reach the limit of data we

| | Network | CodeID | Contract Address |
|--------|---------------------|--------|------------------------------------------------------------------|
| Oracle | testnet (pisco-1) | 10056 | [terra1w8ta7vhpzwe0y99tvvtp7k0k8uex2jq8jts8k2hsyg009ya06qts5fwftt](https://terrasco.pe/testnet/address/terra1w8ta7vhpzwe0y99tvvtp7k0k8uex2jq8jts8k2hsyg009ya06qts5fwftt) |
| Hub | testnet (pisco-1) | 10047 | [terra1eaxcahzxp0x8wqejqjlqaey53tp06l728qad6z395lyzgl026qkq20xj43](https://terrasco.pe/testnet/address/terra1eaxcahzxp0x8wqejqjlqaey53tp06l728qad6z395lyzgl026qkq20xj43) |
| Oracle | testnet (pisco-1) | 11271 | [terra1w8ta7vhpzwe0y99tvvtp7k0k8uex2jq8jts8k2hsyg009ya06qts5fwftt](https://terrasco.pe/testnet/address/terra1w8ta7vhpzwe0y99tvvtp7k0k8uex2jq8jts8k2hsyg009ya06qts5fwftt) |
| Hub | testnet (pisco-1) | 11272 | [terra1eaxcahzxp0x8wqejqjlqaey53tp06l728qad6z395lyzgl026qkq20xj43](https://terrasco.pe/testnet/address/terra1eaxcahzxp0x8wqejqjlqaey53tp06l728qad6z395lyzgl026qkq20xj43) |
| Oracle | mainnet (phoenix-1) | 1782 | [terra1mdpvgjc8jmv60a4x68nggsh9w8uyv69sqls04a76m9med5hsqmwsse8sxa](https://chainsco.pe/terra2/address/terra1mdpvgjc8jmv60a4x68nggsh9w8uyv69sqls04a76m9med5hsqmwsse8sxa) |
| Hub | mainnet (phoenix-1) | 1778 | [terra1jwyzzsaag4t0evnuukc35ysyrx9arzdde2kg9cld28alhjurtthq0prs2s](https://chainsco.pe/terra2/address/terra1jwyzzsaag4t0evnuukc35ysyrx9arzdde2kg9cld28alhjurtthq0prs2s) |

Expand Down
2 changes: 1 addition & 1 deletion contracts/alliance-hub/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "alliance-hub"
version = "0.1.0"
version = "0.1.1"
authors = ["Terra Money <[email protected]>"]
edition = "2018"

Expand Down
89 changes: 0 additions & 89 deletions scripts/deploy-hub.ts

This file was deleted.

72 changes: 0 additions & 72 deletions scripts/deploy-oracle.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const init = async () => {
console.log(`Pleae deploy the hub contract first or add it's address to the ./scripts/.hub_address.log file to run this script`);
return;
}
if (!fs.existsSync('./scripts/.oracle_address.log')
|| fs.readFileSync('./scripts/.oracle_address.log').toString('utf-8') == "") {
console.log(`Pleae deploy the hub contract first or add it's address to the ./scripts/.oracle_address.log file to run this script`);
return;
}

// Create the LCD Client to interact with the blockchain
const lcd = LCDClient.fromDefaultConfig("testnet")
Expand All @@ -23,21 +28,25 @@ const init = async () => {

try {
const hubAddress = fs.readFileSync('./scripts/.hub_address.log').toString('utf-8');
const msgMigrateCode = new MsgMigrateContract(
accAddress,
hubAddress,
9865,
{}
);
const oracleAddress = fs.readFileSync('./scripts/.oracle_address.log').toString('utf-8');

const tx = await wallet.createAndSignTx({
msgs: [msgMigrateCode],
memo: "Migrate Alliance Hub",
msgs: [new MsgMigrateContract(
accAddress,
hubAddress,
11271,
{}
),new MsgMigrateContract(
accAddress,
oracleAddress,
11272,
{}
)],
memo: "Migrate Alliance Protocol",
chainID: "pisco-1",
});
const result = await lcd.tx.broadcastBlock(tx, "pisco-1");
console.log(`Migrate Alliance Hub submitted on chain
- Tx Hash: ${result.txhash}`);
const result = await lcd.tx.broadcastSync(tx, "pisco-1");
console.log(`Migration for Alliance Protocol submitted on chain ${result.txhash}`);
}
catch (e) {
console.log(e)
Expand Down
Loading

0 comments on commit 82a7991

Please sign in to comment.