tilt: eth speedup (#2214)
* ethereum/scripts: add register all script * devnet: update eth startup script * ethereum/scripts - remove unused scripts * ethereum/scripts: add register all script * devnet: update eth startup script * ethereum/scripts - remove unused scripts * devnet: update eth-devnet2 script
This commit is contained in:
parent
6f4dd461f0
commit
cf5187b90c
|
@ -54,7 +54,7 @@ spec:
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- "npm run migrate && npx truffle exec scripts/deploy_test_token.js && npm run deploy-batched-vaa-sender && npx truffle exec scripts/register_solana_chain.js && npx truffle exec scripts/register_terra_chain.js && npx truffle exec scripts/register_terra2_chain.js && npx truffle exec scripts/register_bsc_chain.js && npx truffle exec scripts/register_algo_chain.js && npx truffle exec scripts/register_near_chain.js && npx truffle exec scripts/register_worm_chain.js && npx truffle exec scripts/register_aptos_chain.js && nc -lkp 2000 0.0.0.0"
|
- "npm run migrate && npx truffle exec scripts/deploy_test_token.js && npm run deploy-batched-vaa-sender && npx truffle exec scripts/register_all_chains.js && nc -lkp 2000 0.0.0.0"
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
periodSeconds: 1
|
periodSeconds: 1
|
||||||
failureThreshold: 300
|
failureThreshold: 300
|
||||||
|
|
|
@ -56,7 +56,7 @@ spec:
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- "sed -i 's/CHAIN_ID=0x2/CHAIN_ID=0x4/g;s/EVM_CHAIN_ID=1/EVM_CHAIN_ID=1397/g' .env && npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_solana_chain.js && npx truffle exec scripts/register_terra_chain.js && npx truffle exec scripts/register_terra2_chain.js && npx truffle exec scripts/register_eth_chain.js && npx truffle exec scripts/register_algo_chain.js && npx truffle exec scripts/register_near_chain.js && npx truffle exec scripts/register_worm_chain.js && npx truffle exec scripts/register_aptos_chain.js && nc -lkp 2000 0.0.0.0"
|
- "sed -i 's/CHAIN_ID=0x2/CHAIN_ID=0x4/g;s/EVM_CHAIN_ID=1/EVM_CHAIN_ID=1397/g' .env && npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_all_chains.js && nc -lkp 2000 0.0.0.0"
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
periodSeconds: 1
|
periodSeconds: 1
|
||||||
failureThreshold: 300
|
failureThreshold: 300
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
// run this script with truffle exec
|
|
||||||
|
|
||||||
const jsonfile = require("jsonfile");
|
|
||||||
const TokenBridge = artifacts.require("TokenBridge");
|
|
||||||
const TokenImplementation = artifacts.require("TokenImplementation");
|
|
||||||
const BridgeImplementationFullABI = jsonfile.readFileSync(
|
|
||||||
"../build/contracts/BridgeImplementation.json"
|
|
||||||
).abi;
|
|
||||||
const algoTokenBridgeVAA = process.env.REGISTER_ALGO_TOKEN_BRIDGE_VAA;
|
|
||||||
|
|
||||||
module.exports = async function(callback) {
|
|
||||||
try {
|
|
||||||
const accounts = await web3.eth.getAccounts();
|
|
||||||
const initialized = new web3.eth.Contract(
|
|
||||||
BridgeImplementationFullABI,
|
|
||||||
TokenBridge.address
|
|
||||||
);
|
|
||||||
|
|
||||||
// Register the ALGO endpoint
|
|
||||||
await initialized.methods
|
|
||||||
.registerChain("0x" + algoTokenBridgeVAA)
|
|
||||||
.send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000,
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
} catch (e) {
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
// run this script with truffle exec
|
||||||
|
|
||||||
|
const jsonfile = require("jsonfile");
|
||||||
|
const TokenBridge = artifacts.require("TokenBridge");
|
||||||
|
const NFTBridge = artifacts.require("NFTBridgeEntrypoint");
|
||||||
|
const BridgeImplementationFullABI = jsonfile.readFileSync(
|
||||||
|
"../build/contracts/BridgeImplementation.json"
|
||||||
|
).abi;
|
||||||
|
const solTokenBridgeVAA = process.env.REGISTER_SOL_TOKEN_BRIDGE_VAA;
|
||||||
|
const solNFTBridgeVAA = process.env.REGISTER_SOL_NFT_BRIDGE_VAA;
|
||||||
|
const terraTokenBridgeVAA = process.env.REGISTER_TERRA_TOKEN_BRIDGE_VAA;
|
||||||
|
const terraNFTBridgeVAA = process.env.REGISTER_TERRA_NFT_BRIDGE_VAA;
|
||||||
|
const terra2TokenBridgeVAA = process.env.REGISTER_TERRA2_TOKEN_BRIDGE_VAA;
|
||||||
|
const bscTokenBridgeVAA = process.env.REGISTER_BSC_TOKEN_BRIDGE_VAA;
|
||||||
|
const algoTokenBridgeVAA = process.env.REGISTER_ALGO_TOKEN_BRIDGE_VAA;
|
||||||
|
const nearTokenBridgeVAA = process.env.REGISTER_NEAR_TOKEN_BRIDGE_VAA;
|
||||||
|
const wormchainTokenBridgeVAA = process.env.REGISTER_WORMCHAIN_TOKEN_BRIDGE_VAA;
|
||||||
|
const aptosTokenBridgeVAA = process.env.REGISTER_APTOS_TOKEN_BRIDGE_VAA;
|
||||||
|
|
||||||
|
module.exports = async function(callback) {
|
||||||
|
try {
|
||||||
|
const accounts = await web3.eth.getAccounts();
|
||||||
|
const tokenBridge = new web3.eth.Contract(
|
||||||
|
BridgeImplementationFullABI,
|
||||||
|
TokenBridge.address
|
||||||
|
);
|
||||||
|
const nftBridge = new web3.eth.Contract(
|
||||||
|
BridgeImplementationFullABI,
|
||||||
|
NFTBridge.address
|
||||||
|
);
|
||||||
|
|
||||||
|
// Register the Solana token bridge endpoint
|
||||||
|
console.log("Registering solana...");
|
||||||
|
await tokenBridge.methods.registerChain("0x" + solTokenBridgeVAA).send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the Solana NFT bridge endpoint
|
||||||
|
await nftBridge.methods.registerChain("0x" + solNFTBridgeVAA).send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the terra token bridge endpoint
|
||||||
|
console.log("Registering Terra...");
|
||||||
|
await tokenBridge.methods.registerChain("0x" + terraTokenBridgeVAA).send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the terra NFT bridge endpoint
|
||||||
|
await nftBridge.methods.registerChain("0x" + terraNFTBridgeVAA).send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the terra2 token bridge endpoint
|
||||||
|
console.log("Registering Terra2...");
|
||||||
|
await tokenBridge.methods.registerChain("0x" + terra2TokenBridgeVAA).send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the BSC endpoint
|
||||||
|
console.log("Registering BSC...");
|
||||||
|
await tokenBridge.methods.registerChain("0x" + bscTokenBridgeVAA).send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the ALGO endpoint
|
||||||
|
console.log("Registering Algo...");
|
||||||
|
await tokenBridge.methods.registerChain("0x" + algoTokenBridgeVAA).send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the near token bridge endpoint
|
||||||
|
console.log("Registering Near...");
|
||||||
|
await tokenBridge.methods.registerChain("0x" + nearTokenBridgeVAA).send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the wormhole token bridge endpoint
|
||||||
|
console.log("Registering Wormchain...");
|
||||||
|
await tokenBridge.methods
|
||||||
|
.registerChain("0x" + wormchainTokenBridgeVAA)
|
||||||
|
.send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the APTOS endpoint
|
||||||
|
console.log("Registering Aptos...");
|
||||||
|
await tokenBridge.methods.registerChain("0x" + aptosTokenBridgeVAA).send({
|
||||||
|
value: 0,
|
||||||
|
from: accounts[0],
|
||||||
|
gasLimit: 2000000,
|
||||||
|
});
|
||||||
|
|
||||||
|
callback();
|
||||||
|
} catch (e) {
|
||||||
|
callback(e);
|
||||||
|
}
|
||||||
|
};
|
|
@ -1,32 +0,0 @@
|
||||||
// run this script with truffle exec
|
|
||||||
|
|
||||||
const jsonfile = require("jsonfile");
|
|
||||||
const TokenBridge = artifacts.require("TokenBridge");
|
|
||||||
const TokenImplementation = artifacts.require("TokenImplementation");
|
|
||||||
const BridgeImplementationFullABI = jsonfile.readFileSync(
|
|
||||||
"../build/contracts/BridgeImplementation.json"
|
|
||||||
).abi;
|
|
||||||
const aptosTokenBridgeVAA = process.env.REGISTER_APTOS_TOKEN_BRIDGE_VAA;
|
|
||||||
|
|
||||||
module.exports = async function(callback) {
|
|
||||||
try {
|
|
||||||
const accounts = await web3.eth.getAccounts();
|
|
||||||
const initialized = new web3.eth.Contract(
|
|
||||||
BridgeImplementationFullABI,
|
|
||||||
TokenBridge.address
|
|
||||||
);
|
|
||||||
|
|
||||||
// Register the APTOS endpoint
|
|
||||||
await initialized.methods
|
|
||||||
.registerChain("0x" + aptosTokenBridgeVAA)
|
|
||||||
.send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000,
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
} catch (e) {
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1,27 +0,0 @@
|
||||||
// run this script with truffle exec
|
|
||||||
|
|
||||||
const jsonfile = require("jsonfile");
|
|
||||||
const TokenBridge = artifacts.require("TokenBridge");
|
|
||||||
const TokenImplementation = artifacts.require("TokenImplementation");
|
|
||||||
const BridgeImplementationFullABI = jsonfile.readFileSync("../build/contracts/BridgeImplementation.json").abi
|
|
||||||
const bscTokenBridgeVAA = process.env.REGISTER_BSC_TOKEN_BRIDGE_VAA
|
|
||||||
|
|
||||||
module.exports = async function (callback) {
|
|
||||||
try {
|
|
||||||
const accounts = await web3.eth.getAccounts();
|
|
||||||
const initialized = new web3.eth.Contract(BridgeImplementationFullABI, TokenBridge.address);
|
|
||||||
|
|
||||||
// Register the BSC endpoint
|
|
||||||
await initialized.methods.registerChain("0x" + bscTokenBridgeVAA).send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
// run this script with truffle exec
|
|
||||||
|
|
||||||
const jsonfile = require("jsonfile");
|
|
||||||
const TokenBridge = artifacts.require("TokenBridge");
|
|
||||||
const BridgeImplementationFullABI = jsonfile.readFileSync(
|
|
||||||
"../build/contracts/BridgeImplementation.json"
|
|
||||||
).abi;
|
|
||||||
const nearTokenBridgeVAA = process.env.REGISTER_NEAR_TOKEN_BRIDGE_VAA;
|
|
||||||
|
|
||||||
module.exports = async function (callback) {
|
|
||||||
try {
|
|
||||||
const accounts = await web3.eth.getAccounts();
|
|
||||||
const tokenBridge = new web3.eth.Contract(
|
|
||||||
BridgeImplementationFullABI,
|
|
||||||
TokenBridge.address
|
|
||||||
);
|
|
||||||
|
|
||||||
// Register the near token bridge endpoint
|
|
||||||
await tokenBridge.methods.registerChain("0x" + nearTokenBridgeVAA).send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000,
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
} catch (e) {
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1,36 +0,0 @@
|
||||||
// run this script with truffle exec
|
|
||||||
|
|
||||||
const jsonfile = require("jsonfile");
|
|
||||||
const TokenBridge = artifacts.require("TokenBridge");
|
|
||||||
const NFTBridge = artifacts.require("NFTBridgeEntrypoint");
|
|
||||||
const TokenImplementation = artifacts.require("TokenImplementation");
|
|
||||||
const BridgeImplementationFullABI = jsonfile.readFileSync("../build/contracts/BridgeImplementation.json").abi
|
|
||||||
const solTokenBridgeVAA = process.env.REGISTER_SOL_TOKEN_BRIDGE_VAA
|
|
||||||
const solNFTBridgeVAA = process.env.REGISTER_SOL_NFT_BRIDGE_VAA
|
|
||||||
|
|
||||||
module.exports = async function (callback) {
|
|
||||||
try {
|
|
||||||
const accounts = await web3.eth.getAccounts();
|
|
||||||
const tokenBridge = new web3.eth.Contract(BridgeImplementationFullABI, TokenBridge.address);
|
|
||||||
const nftBridge = new web3.eth.Contract(BridgeImplementationFullABI, NFTBridge.address);
|
|
||||||
|
|
||||||
// Register the Solana token bridge endpoint
|
|
||||||
await tokenBridge.methods.registerChain("0x" + solTokenBridgeVAA).send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000
|
|
||||||
});
|
|
||||||
|
|
||||||
// Register the Solana NFT bridge endpoint
|
|
||||||
await nftBridge.methods.registerChain("0x" + solNFTBridgeVAA).send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
// run this script with truffle exec
|
|
||||||
|
|
||||||
const jsonfile = require("jsonfile");
|
|
||||||
const TokenBridge = artifacts.require("TokenBridge");
|
|
||||||
const BridgeImplementationFullABI = jsonfile.readFileSync(
|
|
||||||
"../build/contracts/BridgeImplementation.json"
|
|
||||||
).abi;
|
|
||||||
const terra2TokenBridgeVAA = process.env.REGISTER_TERRA2_TOKEN_BRIDGE_VAA;
|
|
||||||
|
|
||||||
module.exports = async function (callback) {
|
|
||||||
try {
|
|
||||||
const accounts = await web3.eth.getAccounts();
|
|
||||||
const tokenBridge = new web3.eth.Contract(
|
|
||||||
BridgeImplementationFullABI,
|
|
||||||
TokenBridge.address
|
|
||||||
);
|
|
||||||
|
|
||||||
// Register the terra2 token bridge endpoint
|
|
||||||
await tokenBridge.methods.registerChain("0x" + terra2TokenBridgeVAA).send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000,
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
} catch (e) {
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1,37 +0,0 @@
|
||||||
// run this script with truffle exec
|
|
||||||
|
|
||||||
const jsonfile = require("jsonfile");
|
|
||||||
const TokenBridge = artifacts.require("TokenBridge");
|
|
||||||
const NFTBridge = artifacts.require("NFTBridgeEntrypoint");
|
|
||||||
const TokenImplementation = artifacts.require("TokenImplementation");
|
|
||||||
const BridgeImplementationFullABI = jsonfile.readFileSync("../build/contracts/BridgeImplementation.json").abi
|
|
||||||
const terraTokenBridgeVAA = process.env.REGISTER_TERRA_TOKEN_BRIDGE_VAA
|
|
||||||
const terraNFTBridgeVAA = process.env.REGISTER_TERRA_NFT_BRIDGE_VAA
|
|
||||||
|
|
||||||
module.exports = async function (callback) {
|
|
||||||
try {
|
|
||||||
const accounts = await web3.eth.getAccounts();
|
|
||||||
const tokenBridge = new web3.eth.Contract(BridgeImplementationFullABI, TokenBridge.address);
|
|
||||||
const nftBridge = new web3.eth.Contract(BridgeImplementationFullABI, NFTBridge.address);
|
|
||||||
|
|
||||||
// Register the terra token bridge endpoint
|
|
||||||
await tokenBridge.methods.registerChain("0x" + terraTokenBridgeVAA).send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000
|
|
||||||
});
|
|
||||||
|
|
||||||
// Register the terra NFT bridge endpoint
|
|
||||||
await nftBridge.methods.registerChain("0x" + terraNFTBridgeVAA).send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
// run this script with truffle exec
|
|
||||||
|
|
||||||
const jsonfile = require("jsonfile");
|
|
||||||
const TokenBridge = artifacts.require("TokenBridge");
|
|
||||||
const TokenImplementation = artifacts.require("TokenImplementation");
|
|
||||||
const BridgeImplementationFullABI = jsonfile.readFileSync("../build/contracts/BridgeImplementation.json").abi;
|
|
||||||
const wormchainTokenBridgeVAA = process.env.REGISTER_WORMCHAIN_TOKEN_BRIDGE_VAA
|
|
||||||
|
|
||||||
module.exports = async function (callback) {
|
|
||||||
try {
|
|
||||||
const accounts = await web3.eth.getAccounts();
|
|
||||||
const tokenBridge = new web3.eth.Contract(BridgeImplementationFullABI, TokenBridge.address
|
|
||||||
);
|
|
||||||
|
|
||||||
// Register the wormhole token bridge endpoint
|
|
||||||
await tokenBridge.methods.registerChain("0x" + wormchainTokenBridgeVAA).send({
|
|
||||||
value: 0,
|
|
||||||
from: accounts[0],
|
|
||||||
gasLimit: 2000000
|
|
||||||
});
|
|
||||||
|
|
||||||
callback();
|
|
||||||
} catch (e) {
|
|
||||||
callback(e);
|
|
||||||
}
|
|
||||||
};
|
|
Loading…
Reference in New Issue