Ankr: Create a Truffle Project with Ankr and Filebase
Learn how to create a Truffle Project with Ankr and Filebase.
What is Ankr?
1. First, we need a Filebase IPFS bucket.
2. Select ‘Buckets’ from the left side bar menu, or navigate to console.filebase.com/buckets.

3. Enter a bucket name and choose the IPFS storage network to create the bucket.

4. Next, download and install S3FS-FUSE on a Linux or macOS system.
5. Set up an Access Key file for use with S3FS-FUSE.
6. Mount your bucket.
7. Now, navigate into the mounted Filebase bucket.
8. Next, create a new folder to house your project scripts and navigate inside of it.
9. Initialize your npm workspace:
10. Install Truffle, Ganche and Webpack into your project:
11. Unbox the truffle package:
12. Next, let’s create a sample contract. In the contracts folder, create a new file called example.sol with the following content:
example.sol with the following content:13. Then in the migrations folder, create a new file called 2_deploy_contracts.js with the following content:
2_deploy_contracts.js with the following content:14. Now we need a wallet in order to sign our contract transactions. Install the truffle-hdwallet-provider and the babel-register packages with the following commands:
truffle-hdwallet-provider and the babel-register packages with the following commands:15. Open the existing truffle-config.js file and replace it’s contents with the following code:
16. Compile your contract with the following command:
17. Deploy your contract on the network with the following command:
Last updated