-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add Dappnode Peer to Local Ipfs Node (#1804)
* - Add Dappnode Peer to Local Ipfs Node * - Corrections * - More corrections --------- Co-authored-by: dappnode <[email protected]>
- Loading branch information
1 parent
3621f2c
commit acfb48c
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { logs } from "@dappnode/logger"; | ||
|
||
//Adds Dappnode IPFS peer to the local IPFS node for more stability when fetching IPFS content | ||
export async function addDappnodePeerToLocalIpfsNode() { | ||
const dappnodeIpfsPeer = | ||
"/ip4/167.86.114.131/tcp/4001/p2p/QmfB6dT5zxUq1BXiXisgcZKYkvjywdDYBK5keRaqDKH633"; | ||
const ipfsAlias = "ipfs.dappnode"; | ||
|
||
logs.info("adding dappnode peer to local ipfs node"); | ||
await fetch( | ||
`http://${ipfsAlias}:5001/api/v0/swarm/peering/add?arg=${dappnodeIpfsPeer}`, | ||
{ | ||
method: "POST", | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { expect } from "chai"; | ||
import { addDappnodePeerToLocalIpfsNode } from "../../src/addDappnodePeerToLocalIpfsNode.js"; | ||
|
||
describe.skip("Add Dappnode Peer to Local IPFS Node Test", () => { | ||
it("should add a DAppNode peer to the local IPFS node", async () => { | ||
expect(await addDappnodePeerToLocalIpfsNode()).to.not.throw(); | ||
}); | ||
}); |