Skip to content

Commit

Permalink
fix: remove ipfs troubleshoot from guide and apply bugfix to fetch (#590
Browse files Browse the repository at this point in the history
)
  • Loading branch information
FuzzB0t authored Nov 6, 2023
1 parent bba3ae8 commit 2fe8b42
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 50 deletions.
1 change: 0 additions & 1 deletion packages/cli/src/commands/fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ describe('fetch', () => {
await fetch(basePackageRef, chainId, ipfsHash);

expect(CannonStorage.prototype.readBlob).toHaveBeenCalledTimes(1);
expect(CannonStorage.prototype.putBlob).toHaveBeenCalledTimes(1);
});

test('should fail if IPFS hash is invalid', async () => {
Expand Down
7 changes: 0 additions & 7 deletions packages/cli/src/commands/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ async function storeDeployReference(filePath: string, content: string) {
try {
await mkdir(dir, { recursive: true });
await writeFile(filePath, content);
console.log(`File created successfully at ${filePath}`);
} catch (error) {
throw new Error(`Error creating file: ${error}`);
}
Expand Down Expand Up @@ -81,8 +80,6 @@ export async function fetch(packageRef: string, chainId: number, hash: string, m

debug('storing deploy info');

await storage.putBlob(deployInfo);

const variant = `${deployInfo.chainId || chainId}-${preset || 'main'}`;

const deployPath = localRegistry.getTagReferenceStorage(pkgName, variant);
Expand All @@ -98,10 +95,6 @@ export async function fetch(packageRef: string, chainId: number, hash: string, m

debug('reading metadata from ipfs');

const metadata = await storage.readBlob(ipfsUrl);

await storage.putBlob(metadata);

const deployMetadataPath = localRegistry.getMetaTagReferenceStorage(pkgName, variant);

await storeDeployReference(deployMetadataPath, ipfsUrl);
Expand Down
42 changes: 0 additions & 42 deletions packages/website/src/features/GetStarted/RunPackage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,48 +100,6 @@ export const RunPackage = () => {
</Link>
.
</Text>
<Heading size="md" mb={3} mt={8}>
Troubleshooting IPFS errors
</Heading>
<Text mb={4}>
Public IPFS nodes are sometimes not responsive, in which case you may
receive an error similar to:
</Text>
<Box mb={4}>
<CommandPreview command='Error: could not download cannon package data from "QmdKn7BRDd3Ugv64DcAK7mnPhyNe3PkhHRCTc34eBgExLb": AxiosError: Request failed with status code 504' />
</Box>
<Text mb={4}>
You can resolve this by adding a custom IPFS url to your configuration.
run the following command to setup your IPFS configuration:
<Box mb={4}>
<CommandPreview command="cannon setup" />
</Box>
Note that it prompts for two IPFS urls, the publish IPFS url and the
build IPFS url. They are respectively used when publishing to the
registry and building a package. If you are in development and simply
wish to test things try running a local IPFS node.
</Text>

<Text mb={4}>
To do this, firstly{' '}
<Link href="https://docs.ipfs.tech/install/#get-started" isExternal>
install IPFS
</Link>
{', '}
To start IPFS with IPFS desktop simply open the app, to start a local
IPFS server using the the IPFS cli run:
<Box mb={4}>
<CommandPreview command="ipfs daemon" />
</Box>
</Text>
<Text mb={4}>
Then run the cannon setup and when prompted, enter the following URI for
both the publishing ipfs endpoint and building ipfs endpoint:
</Text>
<Box mb={4}>
<CommandPreview command="http://127.0.0.1:5001" />
</Box>
<Text mb={4}>Running cannon commands should now succeed.</Text>
</>
);
};

0 comments on commit 2fe8b42

Please sign in to comment.