From cd23fbf063946cb35ce9a103c1e4aa2b750a0ea3 Mon Sep 17 00:00:00 2001 From: Karl Prieb Date: Mon, 15 Aug 2022 13:58:51 -0300 Subject: [PATCH 1/7] feat: use file stream while deriving ipfs hash --- src/CLICommand/parameters_helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CLICommand/parameters_helper.ts b/src/CLICommand/parameters_helper.ts index 64ad3627..a664e92e 100644 --- a/src/CLICommand/parameters_helper.ts +++ b/src/CLICommand/parameters_helper.ts @@ -309,8 +309,8 @@ export class ParametersHelper { )}}` ); } else { - const fileContent = fs.readFileSync(localFilePath); - const cidHash = await deriveIpfsCid(fileContent); + const fileStream = fs.createReadStream(localFilePath); + const cidHash = await deriveIpfsCid(fileStream); if (!customMetaDataClone.dataGqlTags) { customMetaDataClone.dataGqlTags = {}; From ca5563ad3b18d0ee1fce1ea3f764f11eab63fdc8 Mon Sep 17 00:00:00 2001 From: Gisela Martinez Date: Wed, 24 Aug 2022 17:54:31 -0300 Subject: [PATCH 2/7] Update CLI Readme: IPFS tag use is specified --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62492482..073bb443 100644 --- a/README.md +++ b/README.md @@ -800,7 +800,7 @@ ardrive drive-info -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" | jq -r '.rootFolde ### IPFS CID Tagging -Certain nodes on the Arweave network may be running the [IPFS+Arweave bridge](https://arweave.medium.com/arweave-ipfs-persistence-for-the-interplanetary-file-system-9f12981c36c3). Tagging your file upload transaction with its IPFS v1 CID value in the 'IPFS-Add' tag may allow you to take advantage of this system. It can also be helpful for finding data on Arweave via GQL based on its CID. To include the CID tag on your file uploads, you may use the '--add-ipfs-tag' flag: +Certain nodes on the Arweave network may be running the [IPFS+Arweave bridge](https://arweave.medium.com/arweave-ipfs-persistence-for-the-interplanetary-file-system-9f12981c36c3). Tagging your file upload transaction with its IPFS v1 CID value in the 'IPFS-Add' tag may allow you to take advantage of this system. It can also be helpful for finding data on Arweave via GQL based on its CID. To include the CID tag on your file uploads, you may use the '--add-ipfs-tag' flag which can only be used for public entities: ```shell ardrive upload-file --add-ipfs-tag --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json From 06e3ef114a2f2696919fd1cdd09a01306f78ab69 Mon Sep 17 00:00:00 2001 From: Gisela Martinez Date: Wed, 24 Aug 2022 18:23:51 -0300 Subject: [PATCH 3/7] documentation(readme): Updated text style --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 073bb443..def3c123 100644 --- a/README.md +++ b/README.md @@ -800,7 +800,7 @@ ardrive drive-info -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" | jq -r '.rootFolde ### IPFS CID Tagging -Certain nodes on the Arweave network may be running the [IPFS+Arweave bridge](https://arweave.medium.com/arweave-ipfs-persistence-for-the-interplanetary-file-system-9f12981c36c3). Tagging your file upload transaction with its IPFS v1 CID value in the 'IPFS-Add' tag may allow you to take advantage of this system. It can also be helpful for finding data on Arweave via GQL based on its CID. To include the CID tag on your file uploads, you may use the '--add-ipfs-tag' flag which can only be used for public entities: +Certain nodes on the Arweave network may be running the [IPFS+Arweave bridge](https://arweave.medium.com/arweave-ipfs-persistence-for-the-interplanetary-file-system-9f12981c36c3). Tagging your file upload transaction with its IPFS v1 CID value in the 'IPFS-Add' tag may allow you to take advantage of this system. It can also be helpful for finding data on Arweave via GQL based on its CID. To include the CID tag on your file uploads, you may use the '--add-ipfs-tag' flag which *can only be used* for **public** entities: ```shell ardrive upload-file --add-ipfs-tag --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json From 6982a6caac60e136e76a2bba6a4125c754a2932e Mon Sep 17 00:00:00 2001 From: GiMartinezz <92453287+GiMartinezz@users.noreply.github.com> Date: Mon, 29 Aug 2022 16:38:16 -0300 Subject: [PATCH 4/7] Update README.md Co-authored-by: arielmelendez --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index def3c123..74a3af7c 100644 --- a/README.md +++ b/README.md @@ -800,7 +800,7 @@ ardrive drive-info -d "c7f87712-b54e-4491-bc96-1c5fa7b1da50" | jq -r '.rootFolde ### IPFS CID Tagging -Certain nodes on the Arweave network may be running the [IPFS+Arweave bridge](https://arweave.medium.com/arweave-ipfs-persistence-for-the-interplanetary-file-system-9f12981c36c3). Tagging your file upload transaction with its IPFS v1 CID value in the 'IPFS-Add' tag may allow you to take advantage of this system. It can also be helpful for finding data on Arweave via GQL based on its CID. To include the CID tag on your file uploads, you may use the '--add-ipfs-tag' flag which *can only be used* for **public** entities: +Certain nodes on the Arweave network may be running the [IPFS+Arweave bridge](https://arweave.medium.com/arweave-ipfs-persistence-for-the-interplanetary-file-system-9f12981c36c3). Tagging your file upload transaction with its IPFS v1 CID value in the 'IPFS-Add' tag may allow you to take advantage of this system. It can also be helpful for finding data on Arweave via GQL based on its CID. To include the CID tag on your **PUBLIC** file uploads, you may use the '--add-ipfs-tag' flag: ```shell ardrive upload-file --add-ipfs-tag --local-path /path/to/file.txt --parent-folder-id "9af694f6-4cfc-4eee-88a8-1b02704760c0" -w /path/to/wallet.json From 823c3e82482e5fbb2ee4bf5f907e6944e4c2b5c9 Mon Sep 17 00:00:00 2001 From: Karl Prieb Date: Wed, 31 Aug 2022 11:27:46 -0300 Subject: [PATCH 5/7] fix(temp_folder): use rmSync instead of rmdirSync --- src/utils/temp_folder.test.ts | 4 +--- src/utils/temp_folder.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils/temp_folder.test.ts b/src/utils/temp_folder.test.ts index 069b6516..c81b888b 100644 --- a/src/utils/temp_folder.test.ts +++ b/src/utils/temp_folder.test.ts @@ -1,7 +1,6 @@ import { expect } from 'chai'; import { cleanUpTempFolder, getTempFolder } from './temp_folder'; import * as fs from 'fs'; -import * as os from 'os'; describe('temp folder functions', () => { describe('getTempFolder function', () => { @@ -19,8 +18,7 @@ describe('temp folder functions', () => { it('returns a folder that contains the correct subfolders', () => { const tempFolderPath = getTempFolder(); - const expectedPathComponent = - os.platform() === 'win32' ? '\\ardrive-downloads' : '/.ardrive/ardrive-downloads'; + const expectedPathComponent = 'ardrive-downloads'; expect(tempFolderPath).to.contains(expectedPathComponent); }); }); diff --git a/src/utils/temp_folder.ts b/src/utils/temp_folder.ts index e8c8ec9b..6d682bb6 100644 --- a/src/utils/temp_folder.ts +++ b/src/utils/temp_folder.ts @@ -74,6 +74,6 @@ export function getTempFolder(): string { export function cleanUpTempFolder(): void { const tempFolderPath = platformTempFolder(); if (fs.existsSync(tempFolderPath)) { - fs.rmdirSync(tempFolderPath, { recursive: true }); + fs.rmSync(tempFolderPath, { recursive: true }); } } From 32c338f37c8698d299e2d18fd8691c92a84ee19b Mon Sep 17 00:00:00 2001 From: Mati Date: Wed, 31 Aug 2022 15:57:34 -0300 Subject: [PATCH 6/7] test(gateway flag): accepts an IP host URI PE-2193 --- src/CLICommand/parameters_helper.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CLICommand/parameters_helper.test.ts b/src/CLICommand/parameters_helper.test.ts index 03deb018..278b632e 100644 --- a/src/CLICommand/parameters_helper.test.ts +++ b/src/CLICommand/parameters_helper.test.ts @@ -590,7 +590,8 @@ describe('ParametersHelper class', () => { [ 'ar://gr8.emoji.🚀.com:1337', { hostName: 'gr8.emoji.%F0%9F%9A%80.com', protocol: 'ar:', port: '1337' } - ] + ], + ['https://192.168.0.0:1234', { hostName: '192.168.0.0', protocol: 'https:', port: '1234' }] ]; for (const [ From d971a4c0b6e0551d83854e2f49f31c279bd40ae2 Mon Sep 17 00:00:00 2001 From: Mati Date: Thu, 1 Sep 2022 12:51:02 -0300 Subject: [PATCH 7/7] doc(gateway flag): adds an example for URLs with an IP as host PE-2193 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 74a3af7c..11cd7c3e 100644 --- a/README.md +++ b/README.md @@ -1434,7 +1434,7 @@ npx arlocal curl http://localhost:1984/mint/{ your public wallet address }/99999999999999 # Create drive and root folder on ArLocal using `--gateway` flag -ardrive create-drive --gateway http://localhost:1984 -w /path/to/wallet -n 'my-test-drive' +ardrive create-drive --gateway http://127.0.0.1:1984 -w /path/to/wallet -n 'my-test-drive' # Setup ARWEAVE_GATEWAY as ENV variable export ARWEAVE_GATEWAY="http://localhost:1984"