Skip to content

Commit

Permalink
Merge pull request #47 from stc-community/develop
Browse files Browse the repository at this point in the history
feat(web):update create pod
  • Loading branch information
Jchicode committed Feb 7, 2024
2 parents 84a78d6 + eff5503 commit ad118ba
Show file tree
Hide file tree
Showing 21 changed files with 138 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../build-info/db5b77630e604083b64e3df959c36809.json"
"buildInfo": "../../../build-info/4453f6a7d0531fd48aa100572bb3b3f3.json"
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../build-info/db5b77630e604083b64e3df959c36809.json"
"buildInfo": "../../../build-info/4453f6a7d0531fd48aa100572bb3b3f3.json"
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../build-info/db5b77630e604083b64e3df959c36809.json"
"buildInfo": "../../../build-info/4453f6a7d0531fd48aa100572bb3b3f3.json"
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../build-info/db5b77630e604083b64e3df959c36809.json"
"buildInfo": "../../../build-info/4453f6a7d0531fd48aa100572bb3b3f3.json"
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../build-info/db5b77630e604083b64e3df959c36809.json"
"buildInfo": "../../../build-info/4453f6a7d0531fd48aa100572bb3b3f3.json"
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../build-info/db5b77630e604083b64e3df959c36809.json"
"buildInfo": "../../../build-info/4453f6a7d0531fd48aa100572bb3b3f3.json"
}

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions contract/build/cache/solidity-files-cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"_format": "hh-sol-cache-2",
"files": {
"/Users/chengqiang/icode/github/stc/GlobalDevDao/contract/contracts/Config.sol": {
"lastModificationDate": 1690956884079,
"contentHash": "79afe2569c8d7e45ff8423e72691fc09",
"lastModificationDate": 1703656026638,
"contentHash": "e53796c860eaa008c1b123cf4f10dddf",
"sourceName": "contracts/Config.sol",
"solcConfig": {
"version": "0.8.13",
Expand Down
2 changes: 1 addition & 1 deletion contract/contracts/Config.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "./interface/IAccessControl.sol";

contract Config {

address public ACCESS_CONTROL = 0x4D736E5c2B0c5C8E9EE88955964ead24C8D70469;
address public ACCESS_CONTROL = 0x93d30f8dcfD09FE8b1669320E81c459925E05835;

modifier onlyBeGrant(string memory publicKey) {
require(IAccessControl(ACCESS_CONTROL).roleCheck(publicKey, msg.sender), "Not authorized by the account owner");
Expand Down
9 changes: 8 additions & 1 deletion contract/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const SEPOLIA_RPC_URL =
process.env.SEPOLIA_RPC_URL ||
"https://sepolia.infura.io/v3/60a1a58a3e8b4aa58451b9467a52818c";
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const COSMOS_PRIVATE_KEY = process.env.COSMOS_PRIVATE_KEY;
const MAINNET_PRIVATE_KEY = process.env.MAINNET_PRIVATE_KEY;
const REPORT_GAS = process.env.REPORT_GAS || false;

Expand All @@ -41,7 +42,13 @@ module.exports = {
}
]
},
defaultNetwork: "opbnb",
networks: {
cosmos: {
chainId: 9000,
url: "http://localhost:8545/",
accounts: [COSMOS_PRIVATE_KEY]
},
calibration: {
chainId: 314159,
url: "https://api.calibration.node.glif.io/rpc/v1",
Expand All @@ -66,9 +73,9 @@ module.exports = {
url: "https://opbnb-testnet.nodereal.io/v1/57ac598465ef4545a95c2ee3d376cd57",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 5611,
gasPrice: 3500,
}
},
defaultNetwork: "opbnb",
gasReporter: {
enabled: REPORT_GAS,
currency: "USD",
Expand Down
95 changes: 79 additions & 16 deletions contract/helper-hardhat-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,39 @@ const networkConfig = {
314159: {
name: "calibration",

STCMarket: "0x07e5959627d3473e3948a7A9F9d8652Ea634510B",

STCMarketToken: "0x9672F063Ccba1e4aC40d31f4c00fdC9dE491aB59",

// Deploy Operator contract parameters
owner: "",
owner: "0x72Cd49C4434b583a5f09d10FCe91443554706316",

// linkToken address
linkToken: "",
linkToken: "0xDe98FF050Cb0DdaaE274E3Fd23620209AAA80648",

// Oracle contract address
oracle: "",
oracle: "0xCe76ab89Cac76d67Bd43Ed901AE6544b03103a63",

// Serverless Oracle contract address
ZtControl: "0xA3A07c5fdd2b7cea1c7aD9d67292206dBf8832D8",
mesh: "0x962E121f6067B0dA6F90D07d565ba21004922B9d",
cod: "0x6051273DB68F2af68617589f30F8a91f859e5b82",
// Container contract
pod: "0x3aDb761e02a76e9E8C8aBD12B2744f32F15D7166",
deployment: "0xD6540c5eC23f664D3Fee7E2Aa608C6B197FD24ce",
cluster: "0x2BB9Bf849C4C5AeCf16209750b9b67375929d872",
node: "0x4a243dFb4EeFffb5a255b3b320681aa39915420B",
// ApiMarket
STCMarket: "0xe9aeeA52781Cb265a83c65d44DB398Ad78571892",
STCMarketToken: "0x7A338445C1eAE2f13E294C28050541686187Cd5F",

//Serverless Site Info
sitename: "gw105",
sitehost: "http://192.168.103.113:4441",
ztMeshJob: "84981edb58a2455aade2e9d797ae86f1",
codjob: "3c09c86cffbd4563a3c0b2b97f411aec",

// Parameters for calling the setAuthorizedSenders method in the Operator contract
authorizedSenders: "",
authorizedSenders: "0xFE44eABf5bD44316e796Fb5fdE19CDBAe94dC054",

fee: 0.1 * 10 ** 18,
fundAmount: "1000000000000000000", // 1
fee: "0.1",
fundAmount: "100", // 100
automationUpdateInterval: "30"
},
420: {
Expand Down Expand Up @@ -85,18 +100,18 @@ const networkConfig = {
owner: "0x72Cd49C4434b583a5f09d10FCe91443554706316",

// linkToken address
linkToken: "0x07e5959627d3473e3948a7A9F9d8652Ea634510B",
linkToken: "0x9F9C503c6e1889C9c0bCAed75ED0a5F68828EE9A",

// Oracle contract address
oracle: "0x141Ee019dE7bBd96441a6287C506B35C9718094f",
oracle: "0xB27A3b7272c1b7c6f195e3066c144B18a33ce522",

// Serverless Oracle contract address
ZtControl: "0xd72E21A51594f1Cacf5F1231bA432c392323Fd8c",
mesh: "0x73Cb12189FCAcDE3d742E2ad0ABD2068011F56Ac",
cod: "0x0A873038d29bf16871232f59D589deA2B849C846",
// Container contract
pod: "0xed809AF6f37889c7914Bf9f10a210c49EFF9011F",
deployment: "0xCe76ab89Cac76d67Bd43Ed901AE6544b03103a63",
pod: "0xB51eCD66f9Eb59cFc8c6bc2349FcE9d5e1C9DF49",
deployment: "0x58171edeEDe71164fc99081D57837d30daf2c194",
cluster: "0xcfB3900Aa34b1584229fb06f405D7691910d1980",
node: "0x962E121f6067B0dA6F90D07d565ba21004922B9d",
// ApiMarket
Expand All @@ -108,14 +123,62 @@ const networkConfig = {
sitehost: "http://192.168.103.113:4441",
ztMeshJob: "84981edb58a2455aade2e9d797ae86f1",
codjob: "3c09c86cffbd4563a3c0b2b97f411aec",
deploymentJobId: "d61b61a4e6684116be70d6ec6e58b52e",
podJobId: "c1efad95d1b34cc9b3e2ee06802a2a6d",
nodeJobId: "aa7198c0190f4cc29d4e4470c08f6391",

// Parameters for calling the setAuthorizedSenders method in the Operator contract
authorizedSenders: "0x68dd2c02ae32fc47EafE970dfc02d14030a0c624",
authorizedSenders: "0x609d4643c8eaFC079B74d524d7e942D088d47fD6",

fee: "0.1",
fundAmount: "100", // 100
automationUpdateInterval: "30"
}
},

11155111: {
name: "sepolia",

// Deploy Operator contract parameters
owner: "0x72Cd49C4434b583a5f09d10FCe91443554706316",

// linkToken address
linkToken: "0x4E9bfAB50AE5aA47838921450BBc1b12a81798ba",

userHubContract: "0x51923dcd6Bb170bd28AD4425A6Dd5cD0456F8e52",
userHubConfigContract: "0x2E5D5a169AD52Ac45B37E5cA74155D7b725eB70D",

// Oracle contract address
oracle: "0x84f146aD17078D9C278832768B0cd9EA597E0E67",

// Serverless Oracle contract address
ZtControl: "0x1Dd5940C70FFAeFe80EF4902ea5Ae9a2Ec3b574D",
mesh: "0x51aeb604fBfC7D40aB331ffFc007F246C2Db9180",
cod: "0x754e87664F278f2be89b3f496955752f127fBdf8",
// Container contract
pod: "0xC7F694fbbc168CE02F2ce9cE84d748957F283336",
deployment: "0x6Ca351492b3b137aBb94052B847Af891bb067eFe",
// cluster: "0x2BB9Bf849C4C5AeCf16209750b9b67375929d872",
// node: "0x248E10ec1C54CB570F7A15933286BAa1D59B70c0",
// ApiMarket
STCMarket: "0x6051273DB68F2af68617589f30F8a91f859e5b82",
STCMarketToken: "0x8b321Dde4CAe93848f756895fdb34E889A6c831b",

//Serverless Site Info
sitename: "gw105",
sitehost: "http://192.168.103.113:4441",
ztMeshJob: "84981edb58a2455aade2e9d797ae86f1",
codjob: "3c09c86cffbd4563a3c0b2b97f411aec",
deploymentJobId: "d61b61a4e6684116be70d6ec6e58b52e",
podJobId: "c1efad95d1b34cc9b3e2ee06802a2a6d",
nodeJobId: "aa7198c0190f4cc29d4e4470c08f6391",

// Parameters for calling the setAuthorizedSenders method in the Operator contract
authorizedSenders: "0xb56f8d912326Ed22a18E2DdcBBB7BC1B78E88Ad7",

fee: "0.1",
fundAmount: "100", // 100
automationUpdateInterval: "30"
},
};
const developmentChains = ["hardhat", "localhost"];
const VERIFICATION_BLOCK_CONFIRMATIONS = 6;
Expand Down
4 changes: 4 additions & 0 deletions contract/scripts/deploy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const hre = require("hardhat");

const private_key = hre.network.config.accounts[0];
const wallet = new hre.ethers.Wallet(private_key, hre.ethers.provider);

async function main() {
console.log("Wallet Ethereum Address:", wallet.address);
const STCMarket = await hre.ethers.getContractFactory("STCMarket");
const lock = await STCMarket.deploy();

Expand Down
7 changes: 7 additions & 0 deletions src/components/Modal/account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,19 @@ const handleSubmit = async () => {
}
} else {
try {
loading.value = true;
console.log(1)
const chainPrivateKey = data[1].privateKey;
console.log(2)
const signKey = await signMessage("CloudX3");
console.log(3)
const truePrivateKey = decrypt(chainPrivateKey, signKey);
console.log(4)
useAccountStore().savePrivateKey(truePrivateKey);
console.log(5)
window.location.reload();
} catch (e) {
loading.value = false;
window.alert(
"Please sign the message for build security tunnel with server"
);
Expand Down
9 changes: 9 additions & 0 deletions src/components/Modal/new-pod.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ const handleSubmit = async () => {
listenIfNeeded();
try {
console.log(
getCurrentChain().oracle,
getCurrentChain().podJobId,
window.btoa(data.requestData),
`https://stc-test.${getCurrentSiteName(
"gw"
)}.oneitfarm.com/brige/providers/pod`,
md5(accountStore.publicKey)
);
const transaction = await contract.requestContainerPod(
getCurrentChain().oracle,
getCurrentChain().podJobId,
Expand Down
14 changes: 7 additions & 7 deletions src/config/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ const chains: Chain[] = [
blockExplorerUrls: ["https://mainnet.opbnbscan.com/"],
iconUrls: ["https://docs.bnbchain.org/opbnb-docs/img/logo.svg"],

oracle: "0x141Ee019dE7bBd96441a6287C506B35C9718094f", //
oracle: "0xB27A3b7272c1b7c6f195e3066c144B18a33ce522", //

podContract: "0xc07f40758d3bb0f8B8E4C4d146f79265484ba6Fe", //
podJobId: "780d3dd1933a4a9d839f4c78d92ab595", //
podContract: "0x139E7c9ADfee9682E7997eb736F48f98B8821774", //
podJobId: "c1efad95d1b34cc9b3e2ee06802a2a6d", //

deploymentContract: "0x67F47fC6cdCcD13bbe6ee88B3E7eb71726225e97", //
deploymentJobId: "68c1dc5cd63841459ff2395a931f042c", //
deploymentContract: "0xC217097F4fe4640BcD541B09bDFaCc8e200cEa37", //
deploymentJobId: "d61b61a4e6684116be70d6ec6e58b52e", //

nodeContract: "0x962E121f6067B0dA6F90D07d565ba21004922B9d", //
nodeJobId: "aa7198c0190f4cc29d4e4470c08f6391",
Expand All @@ -151,11 +151,11 @@ const chains: Chain[] = [
stcMarketContract: "0xBd0F68775aA77288Ea2083D7d7776D2D0C3bf0Ee", //
stcMarketTokenContract: "0x5d3c43875589f4881E769f4b46cFf6257dC5Ad1C", //

userHubContract: "0xD436429Cf172a79A5E4D8F672c698A2E98315dc0" //
userHubContract: "0xbE5b30a59cdA47d40A0a15830a31aCA00b8af983" //
}
];

let currentChain: ChainName = "Sepolia";
let currentChain: ChainName = "opBNB Testnet";
export function setCurrentChain(name: ChainName) {
currentChain = name;
}
Expand Down
4 changes: 3 additions & 1 deletion src/views/container/pods/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ const loading = ref(true);
const pods: Array<Pod> = reactive([]);
let page = 1;
const limit = 9;
const name = "nginx";
const loadOnePage = () => {
loadData(
pods,
"cloud.pod.list",
{
page,
limit
limit,
name
},
loading
);
Expand Down

0 comments on commit ad118ba

Please sign in to comment.