Let’s Use The Filecoin Truffle Box!
�Anthony Albertorio
Community Builder, DeFi, Instructor, ConsenSys Academy�
Tom Hay
Head of Developer Relations, ConsenSys
What is Truffle?
What are Truffle Boxes?
Why Truffle Boxes?
What is libp2p, IPFS and IPFS
Why Filecoin?
Truffle + Filecoin
Technical Overview: Filecoin Box
First Things First - Checking Requirements
Setting Up The Requirements
Unboxing The Filecoin Box
Set up Truffle Preserve
Note: This will override your current truffle version. But it is scoped to your current node version (14.14.0). You can change your node version using nvm if you need regular truffle for another project.
Changing Node Version
Set up Truffle Preserve
Preserve to IPFS:
$ truffle preserve ./path/to/directory --ipfs�
�
Under the hood
Note: this config adds a new top-level environments object. We'll be using this new configuration object as we upgrade to Truffle version 6 in the future.
👀
Starting Ethereum on the Ganache Local Testnet
Starting Filecoin on the Ganache Local Testnet
Or Starting the DApp - Ganache UI
What is the Filecoin Network Inspector?
Note: Lotus is the Protocol Labs’ GoLang implementation of the Filecoin.�Lotus JS is written in JavaScript.
Setting Up and Running the Filecoin Network Inspector
Setting Up and Running the Filecoin Network Inspector
What are Deals? 🤝
�
Creating a Storage Deal via the Filecoin Explorer UI🤝
Note: On Filecoin's mainnet, a deal must be secured with a miner before data is stored. ��In Filecoin Ganache a deal is reached automatically.
Creating a Storage Deal via Truffle Preserve 🤝
Creating a Storage Deal via Curl 🧠 🤝
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":0,"method":"Filecoin.ClientStartDeal","params":[{"Data":{"TransferType":"graphsync","Root":{"/":"QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V"},"PieceCid":null,"PieceSize":0},"Wallet":"t3s3la37547tijmoeiep7ktogws3tep2eqrralh7rhi2mpe46q574gceyy467356onblzvwf7ejlelo2rdsg4q","Miner":"t01000","EpochPrice":"2500","MinBlocksDuration":300}]}' \
Overview: Minting the NFT in Ethereum
�Thumbnail - (QmbAAMaGWpiSgmMWYTRtGsru382j6qTVQ4FDKX2cRTRso6)��Asset - (QmUWFZQrJHfCVNHXVjjb2zeowVvH7dC6rKpbdHsTdnAgvP)
Overview: Minting the NFT on Ethereum
�truffle(development)> const gallery = await MyGallery.deployed()��truffle(development)> gallery.mint(accounts[0], "QmS4t7rFPxaaNriXvCmALr5GYRAtya5urrDaZgkfHutdCG")�
Overview: Transferring ownership of the NFT on Ethereum
�$ truffle console
truffle(development)> gallery.transferFrom(accounts[0], accounts[1], 1)�
Overview: Starting the DApp locally
Test Out the Filecoin Developer Preview
More Resources - Go Deeper! 📓
A helpful Filecoin-box README.��Learn more with Proto School��IPFS Shipyard: Cool community projects��Build a Tutorial at Proto School
�IPFS Docs��Filecoin Docs��Truffle Docs
More Resources- Reach out to us 📣
Talk to us! �#browsers3000 channel��ConsenSys Discord�(@CryptoHamilton-Never-DMsMetaMask)��(@Tom Hay)��Filecoin Slack�(Anthony Albertorio)
Stay SAFE: Never share your seed phrase 📣
Happy Building!
👷♂️👷♀️�🏗 🛠