Skip to content

Commit

Permalink
fixtures use new IPNFT test metadata, should serve faster than arweave
Browse files Browse the repository at this point in the history
peers with Pinata to get the content

Signed-off-by: stadolf <[email protected]>
  • Loading branch information
elmariachi111 committed Jan 7, 2024
1 parent ffc0d89 commit 4f47e85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion deploy/001-ipfs-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ ipfs config --json Gateway.HTTPHeaders.Access-Control-Expose-Headers '["Location
ipfs config --json Gateway.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'

# https://web3.storage/docs/reference/peering/
# allows us to also pull w3s content from our local machine
# 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"]}]'


#https://github.com/ipfs/kubo/blob/master/docs/config.md#implicit-defaults-of-gatewaypublicgateways
#axios is confused with local ipfs subdomains
Expand Down
7 changes: 4 additions & 3 deletions script/dev/Ipnft.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ contract FixtureIpnft is CommonScript {
vm.startBroadcast(from);
uint256 reservationId = ipnft.reserve();

bytes32 messageHash =
ECDSA.toEthSignedMessageHash(keccak256(abi.encodePacked(from, to, reservationId, "ar://cy7I6VoEXhO5rHrq8siFYtelM9YZKyoGj3vmGwJZJOc")));
bytes32 messageHash = ECDSA.toEthSignedMessageHash(
keccak256(abi.encodePacked(from, to, reservationId, "ipfs://bafkreigmssfgo5t3ig2ghx4zk2syrezpv46cbirdg4aah5ma4gvvesxevi"))
);

(uint8 v, bytes32 r, bytes32 s) = vm.sign(deployerPk, messageHash);

ipnft.mintReservation{ value: 0.001 ether }(
to, reservationId, "ar://cy7I6VoEXhO5rHrq8siFYtelM9YZKyoGj3vmGwJZJOc", "BIO-00001", abi.encodePacked(r, s, v)
to, reservationId, "ipfs://bafkreigmssfgo5t3ig2ghx4zk2syrezpv46cbirdg4aah5ma4gvvesxevi", "CAT-101", abi.encodePacked(r, s, v)
);

vm.stopBroadcast();
Expand Down

0 comments on commit 4f47e85

Please sign in to comment.