Skip to content

Commit

Permalink
Merge pull request #151 from moleculeprotocol/feat/pins-and-peers
Browse files Browse the repository at this point in the history
scripts to backup and pin ipfs files
  • Loading branch information
elmariachi111 authored Jan 11, 2024
2 parents cc269dd + 00e1786 commit fd666e9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ node_modules
cache_hardhat/
cache_forge/
artifacts/
.openzeppelin/unknown-*
.openzeppelin/unknown-*
backup/
9 changes: 1 addition & 8 deletions deploy/001-ipfs-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ ipfs config --json Gateway.HTTPHeaders.Access-Control-Allow-Credentials '["true"

# https://web3.storage/docs/reference/peering/
# allows us to also pull w3s / pinata content from our local machine
ipfs config --json Peering.Peers '[{"ID": "bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm","Addrs": ["/dnsaddr/elastic.dag.house"]}]'
ipfs config --json Peering.Peers '[{"ID": "QmWaik1eJcGHq1ybTWe7sezRfqKNcDRNkeBaLnGwQJz1Cj","Addrs": ["/dnsaddr/fra1-1.hostnodes.pinata.cloud"]}]'
ipfs config --json Peering.Peers '[{"ID": "QmNfpLrQQZr5Ns9FAJKpyzgnDL2GgC6xBug1yUZozKFgu4","Addrs": ["/dnsaddr/fra1-2.hostnodes.pinata.cloud"]}]'
ipfs config --json Peering.Peers '[{"ID": "QmPo1ygpngghu5it8u4Mr3ym6SEU2Wp2wA66Z91Y1S1g29","Addrs": ["/dnsaddr/fra1-3.hostnodes.pinata.cloud"]}]'
ipfs config --json Peering.Peers '[{"ID": "QmRjLSisUCHVpFa5ELVvX3qVPfdxajxWJEHs9kN3EcxAW6","Addrs": ["/dnsaddr/nyc1-1.hostnodes.pinata.cloud"]}]'
ipfs config --json Peering.Peers '[{"ID": "QmPySsdmbczdZYBpbi2oq2WMJ8ErbfxtkG8Mo192UHkfGP","Addrs": ["/dnsaddr/nyc1-2.hostnodes.pinata.cloud"]}]'
ipfs config --json Peering.Peers '[{"ID": "QmSarArpxemsPESa6FNkmuu9iSE1QWqPX2R3Aw6f5jq4D5","Addrs": ["/dnsaddr/nyc1-3.hostnodes.pinata.cloud"]}]'

ipfs config --json Peering.Peers '[{"ID": "bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm","Addrs": ["/dnsaddr/elastic.dag.house"]},{"ID": "QmWaik1eJcGHq1ybTWe7sezRfqKNcDRNkeBaLnGwQJz1Cj","Addrs": ["/dnsaddr/fra1-1.hostnodes.pinata.cloud"]},{"ID": "QmNfpLrQQZr5Ns9FAJKpyzgnDL2GgC6xBug1yUZozKFgu4","Addrs": ["/dnsaddr/fra1-2.hostnodes.pinata.cloud"]},{"ID": "QmPo1ygpngghu5it8u4Mr3ym6SEU2Wp2wA66Z91Y1S1g29","Addrs": ["/dnsaddr/fra1-3.hostnodes.pinata.cloud"]},{"ID": "QmRjLSisUCHVpFa5ELVvX3qVPfdxajxWJEHs9kN3EcxAW6","Addrs": ["/dnsaddr/nyc1-1.hostnodes.pinata.cloud"]},{"ID": "QmPySsdmbczdZYBpbi2oq2WMJ8ErbfxtkG8Mo192UHkfGP","Addrs": ["/dnsaddr/nyc1-2.hostnodes.pinata.cloud"]},{"ID": "QmSarArpxemsPESa6FNkmuu9iSE1QWqPX2R3Aw6f5jq4D5","Addrs": ["/dnsaddr/nyc1-3.hostnodes.pinata.cloud"]}]'

#https://github.com/ipfs/kubo/blob/master/docs/config.md#implicit-defaults-of-gatewaypublicgateways
#axios is confused with local ipfs subdomains
Expand Down
9 changes: 9 additions & 0 deletions periphery/pin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

find . -type f -exec basename {} \; > all.cid.text

while IFS= read -r line; do
echo "$line"
ipfs dht provide "$line"
ipfs pin remote add --service=pinata "$line"
done < all.cid.text

0 comments on commit fd666e9

Please sign in to comment.