mirror of git3://git3.w3q/git3-cli
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
664 B
TypeScript
26 lines
664 B
TypeScript
2 years ago
|
import { ETHStorage } from "../src/storage/ETHStorage.js";
|
||
|
import { Status } from "../src/storage/storage.js";
|
||
2 years ago
|
|
||
|
|
||
|
let es = new ETHStorage("test123", 3334, { git3Address: null, sender: null })
|
||
|
let main = async () => {
|
||
|
let data = Buffer.from(Array.from({ length: 1024 }, () =>
|
||
|
Math.floor(Math.random() * 256)
|
||
|
))
|
||
|
console.log(data.length)
|
||
|
// return
|
||
2 years ago
|
let pending :Promise<Status>[] = []
|
||
2 years ago
|
for (let i = 0; i < 20; i++) {
|
||
|
pending.push(es.upload(`bbb-${i}`, data))
|
||
|
}
|
||
|
let resaults = await Promise.all(pending)
|
||
|
for (let res of resaults) {
|
||
|
console.log(res)
|
||
|
}
|
||
|
|
||
|
console.log(await es.download("bbb-9"))
|
||
|
}
|
||
|
|
||
|
|
||
|
main()
|