del packages

main
cyhhao 2 years ago
parent 9ecc10120a
commit d932e14dcb

11
package-lock.json generated

@ -14,7 +14,6 @@
"@nomiclabs/hardhat-etherscan": "^3.1.3", "@nomiclabs/hardhat-etherscan": "^3.1.3",
"@openzeppelin/contracts": "^4.8.0", "@openzeppelin/contracts": "^4.8.0",
"chai": "^4.3.7", "chai": "^4.3.7",
"git3-evm-large-storage": "^1.1.0",
"typechain": "^8.1.1" "typechain": "^8.1.1"
}, },
"devDependencies": { "devDependencies": {
@ -4164,11 +4163,6 @@
"testrpc-sc": "index.js" "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": { "node_modules/glob": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
@ -11610,11 +11604,6 @@
"node-emoji": "^1.10.0" "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": { "glob": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",

@ -1,7 +1,7 @@
import { ethers } from "hardhat"; import { ethers } from "hardhat";
async function main() { async function main() {
const Git3 = await ethers.getContractFactory("Git3"); const Git3 = await ethers.getContractFactory("Git3Hub");
const git3 = await Git3.deploy(); const git3 = await Git3.deploy();
let receipt = await git3.deployed(); let receipt = await git3.deployed();

@ -8,12 +8,12 @@ async function main() {
const Git3 = await hre.ethers.getContractAt( const Git3 = await hre.ethers.getContractAt(
"Git3Hub", "Git3Hub",
"0xa709975Bc01e745432f8898499E7b9a60f420117" "0xcE386Fe1d237e42dd01c130DA19d32B2c3794C06"
); );
let file = fs.readFileSync("test/git3.png"); let file = fs.readFileSync("scripts/git3.png");
let rept
let buffer = Array.from(file).slice(0, 24576); let buffer = Array.from(file).slice(0, 24 * 1024 * 5);
let fileSize = buffer.length; let fileSize = buffer.length;
console.log("buffer", buffer.length); console.log("buffer", buffer.length);
@ -21,10 +21,17 @@ async function main() {
if (fileSize > 24 * 1024 - 326) { if (fileSize > 24 * 1024 - 326) {
cost = Math.floor((fileSize + 326) / 1024 / 24); cost = Math.floor((fileSize + 326) / 1024 / 24);
} }
let repoName = Buffer.from("helloworld")
// rept = await Git3.createRepo(repoName)
let key = ethers.utils.toUtf8Bytes("aaa"); let key = ethers.utils.toUtf8Bytes("aaa");
let rept = await Git3.upload(key, buffer, { // rept = await Git3.upload(repoName, key, buffer, {
value: ethers.utils.parseEther(cost.toString()), // 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); console.log("rept", "https://explorer.galileo.web3q.io/tx/" + rept.hash);
} }

Loading…
Cancel
Save