Welcome to the world of Ethereum blockchain development! If you’re looking to streamline your smart contract deployment and testing processes, you’ve landed in the right place. In this guide, we will explore how to set up Clevis for Ethereum blockchain orchestration, testing, and DApp scaffolding. Let’s dive in!
Requirements
Before you start your adventure, you need a local Ethereum blockchain to develop against. If you haven’t decided on your preferred method yet, we recommend using Ganache from Truffle for its ease of use. You can easily set it up by following these steps:
- Install Ganache CLI globally by running:
npm install -g ganache-cli
ganache-cli
Start a New Project with Clevis
Once you have your local blockchain running, it’s time to initiate a Clevis project. Navigate to your empty project directory and execute the following command:
npx clevis init
This command will prompt you with a few questions and proceed to create a new Clevis-powered project in your current directory.
Using Clevis
By default, the Clevis setup does not install globally, but you can do so by running:
npm install -g clevis
If you prefer to use Clevis without global installation, you can access it in your local node modules directory:
node_modules/clevis/bin.js
For convenience, consider adding an alias in your ~/.profile
or ~/.bashrc
file:
alias clevis=./node_modules/clevis/bin.js
After setting this up, you can invoke Clevis commands using just the letter ‘c’. For example:
clevis randomhex 100
Alternatively, you can add Clevis as an npm script in your package.json
:
"scripts": {
"clevis": "clevis"
}
This allows you to use Clevis with:
npm run clevis randomhex 100
Optional: Docker Setup
If you face challenges with the setup instructions above, Docker provides a convenient solution. To pull a repeatable environment, run:
docker run -ti --rm --name clevis -p 3000:3000 -p 8545:8545 -v ~your-dapp-directory:dapp austingriffith/clevis:latest
Troubleshooting Tips
While setting up Clevis, you may run into some issues, particularly with Web3 dependencies. Here are a few common problems and their solutions:
- If you encounter errors around permissions, like:
Try running:gyp ERR! stack Error: EACCES: permission denied
sudo npm install --unsafe-perm -g clevis@latest
- For a “Cannot find module web3” error, go to your Clevis directory and run:
npm link
node_modules
and regenerate your environment:
rm -rf node_modules package-lock.json
Followed by:
npx clevis init; npm install
For additional insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
By following this guide, you are now equipped to harness the power of Clevis for your blockchain development projects. Don’t hesitate to explore the various commands available to unleash Clevis’s full potential. Start building today!
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.