From 1b34e506276caba582fea8ba3f246c87abbb3767 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sun, 20 Oct 2024 11:47:50 +0700 Subject: [PATCH] Create deploy_state_channel.js --- .../scripts/deploy_state_channel.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 blockchain_integration/pi_network/pi-network-layer2-scaling/scripts/deploy_state_channel.js diff --git a/blockchain_integration/pi_network/pi-network-layer2-scaling/scripts/deploy_state_channel.js b/blockchain_integration/pi_network/pi-network-layer2-scaling/scripts/deploy_state_channel.js new file mode 100644 index 000000000..6d20ca074 --- /dev/null +++ b/blockchain_integration/pi_network/pi-network-layer2-scaling/scripts/deploy_state_channel.js @@ -0,0 +1,24 @@ +// deploy_state_channel.js +const { ethers } = require("hardhat"); + +async function main() { + // Deploy ChannelManager + const ChannelManager = await ethers.getContractFactory("ChannelManager"); + const channelManager = await ChannelManager.deploy(); + await channelManager.deployed(); + console.log("ChannelManager deployed to:", channelManager.address); + + // Deploy ChannelValidator + const ChannelValidator = await ethers.getContractFactory("ChannelValidator"); + const channelValidator = await ChannelValidator.deploy(); + await channelValidator.deployed(); + console.log("ChannelValidator deployed to:", channelValidator.address); +} + +// Execute the deployment script +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + });