Skip to content

Commit

Permalink
chore: change the hardhat local network port to 8545 (#115)
Browse files Browse the repository at this point in the history
Co-authored-by: zakir <80246097+zakir-code@users.noreply.github.com>
  • Loading branch information
2 people authored and github-actions[bot] committed Feb 19, 2024
1 parent fcc0dd5 commit 118de6d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
5 changes: 4 additions & 1 deletion solidity/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const config: HardhatUserConfig = {
// forking: {
// url: `${process.env.MAINNET_URL || "https://mainnet.infura.io/v3/infura-key"}`,
// }
chainId: 1337
chainId: 1337,
mining: {
interval: 3000
},
},
mainnet: {
url: `${process.env.MAINNET_URL || "https://mainnet.infura.io/v3/infura-key"}`,
Expand Down
8 changes: 4 additions & 4 deletions solidity/tasks/bridge_tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ const initBridge = task("init-bridge", "init bridge contract")
.addParam("restUrl", "fx node rest rpc url", undefined, string, false)
.addParam("chainName", "init cross chain name", undefined, string, false)
.setAction(async (taskArgs, hre) => {
const {bridgeLogic, bridgeContract, fxRestUrl, chainName} = taskArgs;
const {bridgeLogic, bridgeContract, restUrl, chainName} = taskArgs;
const {wallet} = await hre.run(SUB_CHECK_PRIVATE_KEY, taskArgs);
const from = await wallet.getAddress();

const bridge_logic_factory = await hre.ethers.getContractFactory("FxBridgeLogic")

const oracle_set = await GetOracleSet(fxRestUrl, chainName)
const gravity_id_str = await GetGravityId(fxRestUrl, chainName)
const oracle_set = await GetOracleSet(restUrl, chainName)
const gravity_id_str = await GetGravityId(restUrl, chainName)
const gravity_id = hre.ethers.encodeBytes32String(gravity_id_str);

const external_addresses = [];
Expand All @@ -130,7 +130,7 @@ const initBridge = task("init-bridge", "init bridge contract")
])

if (bridgeLogic) {
const proxy_factory = await hre.ethers.getContractFactory("TransparentUpgradeableProxy")
const proxy_factory = await hre.ethers.getContractAt("ITransparentUpgradeableProxy", bridgeContract, wallet)
data = proxy_factory.interface.encodeFunctionData('upgradeToAndCall', [bridgeLogic, data])
}

Expand Down
4 changes: 3 additions & 1 deletion tests/scripts/bridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ EOF
container_name: fx-$bridge_name
image: $BRIDGE_IMAGE
hostname: fx-$bridge_name
command: bridge --bridge-chain-name="$chain" --bridge-node-url="$external_json_rpc_url" --bridge-addr="$bridge_contract_address" --fx-gas-price=4000000000000FX --fx-grpc="http://fxcore:9090" --bridge-key=/root/eth-$bridge_name.key --bridge-pwd=12345678 --fx-key=/root/fx-$bridge_name.key --fx-pwd=/root/fx-$bridge_name.password
command: bridge --bridge-chain-name="$chain" --bridge-node-url="$external_json_rpc_url" --bridge-addr="$bridge_contract_address" --fx-gas-price=4000000000000FX --fx-grpc="http://fxcore:9090" --bridge-key=/root/eth-$bridge_name.key --bridge-pwd=12345678 --fx-key=/root/fx-$bridge_name.key --fx-pwd=12345678
networks:
- $DOCKER_NETWORK
volumes:
Expand All @@ -129,6 +129,8 @@ networks:
$DOCKER_NETWORK:
external: true
EOF

docker-compose -f "$OUT_DIR/bridge-docker-compose.yml" up -d
}

function request_batch() {
Expand Down
8 changes: 7 additions & 1 deletion tests/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ function run() {
)

(
export LOCAL_PORT=8535
LOCAL_PORT=8535
export LOCAL_PORT
"${script_dir}/ethereum.sh" start
"${script_dir}/ethereum.sh" deploy_bridge_token
"${script_dir}/ethereum.sh" deploy_bridge_contract
Expand Down Expand Up @@ -46,6 +47,11 @@ function run() {
"${script_dir}/bridge.sh" create_oracles eth
"${script_dir}/bridge.sh" update_crosschain_oracles eth
"${script_dir}/bridge.sh" create_oracle_bridger eth

LOCAL_PORT=8535
export LOCAL_PORT
"${script_dir}/ethereum.sh" init_bridge
"${script_dir}/bridge.sh" setup_bridge_server eth
)

}
Expand Down

0 comments on commit 118de6d

Please sign in to comment.