Skip to content

Commit

Permalink
Merge pull request #325 from ardriveapp/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
karlprieb authored Sep 1, 2022
2 parents 0e6e5c4 + e8532a8 commit a94006f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 **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
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/CLICommand/parameters_helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down
4 changes: 2 additions & 2 deletions src/CLICommand/parameters_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
4 changes: 1 addition & 3 deletions src/utils/temp_folder.test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand All @@ -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);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/temp_folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}

0 comments on commit a94006f

Please sign in to comment.