This template is here to help you developping solidity localy with docker.
This bootstrap works with truffle and you already have a truffle friendly environment.
You will only have to add your contract in the contracts
directory and add a migration to deploy your contract on ganache.
Then feel free to add test in the tests
directory and play with make commands
This template use Docker, a container tool to let people have a development environment quickly. There is only 3 dependencies:
- Docker
- docker-compose
- GNU make
To install docker, please go to the official docker installation page : https://docs.docker.com/engine/installation/.
When docker is installed, check it with docker -v
, you should find something like following:
$ docker -v
Docker version 20.10.7, build 20.10.7
To install docker-compose, you can also find it under docker official documentation : https://docs.docker.com/compose/install/.
When it's installed, check it with docker-compose -v
, you should have something like this
$ docker-compose -v
docker-compose version 1.25.0
git clone [email protected]:JeremieSamson/solidity_docker_bootstrap.git
Then you can use make commands
// This will build images, up them and install node_modules
make install
// This will launch migration
make truffle migrate
// This will launch tests
make truffle test
ESLint let you find and fix problems in your javascript code. It is a nice plugin to lint your code.
// To see errors
make esnlint
// To fix errors
make esnlintfix
Customizable linter for ethereum's solidity smart contract.
// To see errors
make solium
// To fix errors
make soliumfix
Coveralls is a web service to help you track your code coverage over time, and ensure that all your new code is fully covered.
Your code must be hosted on GitHub, BitBucket, or GitLab. Then, you only need to login to your coveralls accoutn with github.
To add your badge, you need to first link a repository to coveralls.
When you are on you repositoru page like https://coveralls.io/github/ACCOUNT/REPOSITORY_NAME
, just clic on the embed dropdown under the badge card
Then, just copy past the markdown in your readme
[![Coverage Status](https://coveralls.io/repos/github/JeremieSamson/alyra_voting/badge.svg?branch=main)](https://coveralls.io/github/JeremieSamson/alyra_voting?branch=main)
When you have your contract and your tests, you are ready to go to open a pull request on your repository and start pushing your code to your teammates. The github action workflow installed will
- Check that your javascript files are properly lints (ESLint)
- Check that your solidity files are properly lints (Ethlint)
- Run your tests
- Run your coverage
- Push the coverage result to coveralls