From d932e14dcb0f7545714e5c5263dc6267d9918c8a Mon Sep 17 00:00:00 2001 From: cyhhao Date: Fri, 16 Dec 2022 18:35:02 +0800 Subject: [PATCH] del packages --- package-lock.json | 11 ----------- scripts/deploy.ts | 2 +- scripts/upload-file.ts | 21 ++++++++++++++------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index c445360..10411d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ "@nomiclabs/hardhat-etherscan": "^3.1.3", "@openzeppelin/contracts": "^4.8.0", "chai": "^4.3.7", - "git3-evm-large-storage": "^1.1.0", "typechain": "^8.1.1" }, "devDependencies": { @@ -4164,11 +4163,6 @@ "testrpc-sc": "index.js" } }, - "node_modules/git3-evm-large-storage": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/git3-evm-large-storage/-/git3-evm-large-storage-1.1.0.tgz", - "integrity": "sha512-nCRP5Wr2+ecHFdoMBtuJKbM99Y7F54dOJvB2HPuiajOP768gesVwr3yD5lJoZ0fEjT2VU0uES+0gD9U8KpwukQ==" - }, "node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -11610,11 +11604,6 @@ "node-emoji": "^1.10.0" } }, - "git3-evm-large-storage": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/git3-evm-large-storage/-/git3-evm-large-storage-1.1.0.tgz", - "integrity": "sha512-nCRP5Wr2+ecHFdoMBtuJKbM99Y7F54dOJvB2HPuiajOP768gesVwr3yD5lJoZ0fEjT2VU0uES+0gD9U8KpwukQ==" - }, "glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 23d09ca..99d063b 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -1,7 +1,7 @@ import { ethers } from "hardhat"; async function main() { - const Git3 = await ethers.getContractFactory("Git3"); + const Git3 = await ethers.getContractFactory("Git3Hub"); const git3 = await Git3.deploy(); let receipt = await git3.deployed(); diff --git a/scripts/upload-file.ts b/scripts/upload-file.ts index e761d4c..148c591 100644 --- a/scripts/upload-file.ts +++ b/scripts/upload-file.ts @@ -8,12 +8,12 @@ async function main() { const Git3 = await hre.ethers.getContractAt( "Git3Hub", - "0xa709975Bc01e745432f8898499E7b9a60f420117" + "0xcE386Fe1d237e42dd01c130DA19d32B2c3794C06" ); - let file = fs.readFileSync("test/git3.png"); - - let buffer = Array.from(file).slice(0, 24576); + let file = fs.readFileSync("scripts/git3.png"); + let rept + let buffer = Array.from(file).slice(0, 24 * 1024 * 5); let fileSize = buffer.length; console.log("buffer", buffer.length); @@ -21,10 +21,17 @@ async function main() { if (fileSize > 24 * 1024 - 326) { cost = Math.floor((fileSize + 326) / 1024 / 24); } + let repoName = Buffer.from("helloworld") + // rept = await Git3.createRepo(repoName) + let key = ethers.utils.toUtf8Bytes("aaa"); - let rept = await Git3.upload(key, buffer, { - value: ethers.utils.parseEther(cost.toString()), - }); + // rept = await Git3.upload(repoName, key, buffer, { + // value: ethers.utils.parseEther(cost.toString()), + // }); + console.log(await Git3.download(repoName, key)); + + rept = await Git3.remove(repoName, key) + console.log("rept", "https://explorer.galileo.web3q.io/tx/" + rept.hash); }