Compilation , Building , Atomated testing , Deployment of ethereum project. My first project in ethereum using solidity.
$ git clone https://github.com/tkAcharya/Inbox-Ethereum-Code
$ cd Inbox-Ethereum-Code/Inbox
$ npm install
$ npm install --save solc ganache-cli web3 mocha
$ npm test
NOTE : This should give you a sample of addresses , and should run the basic tests present to verify the compilation and message modification
The below step is not required for local setup
- Download and setup the metamask extension of chrome (Store the passphrase with you)
- You need to create a free account on infura.io
- Create a project in the infura and store the endpoint for rinkeby network
- Install the following packages(if not present)
$ npm install –-save [email protected]
$ npm install dotenv
- Write the passphrase of metamask in the mnemonic field in .env file
- Write the rinkeby test network link in the link field in .env file
- Run
node deploy.js
After running the deploy file , you would have got a message like "Contract Deployed to "
Copy the xyz and paste it in rinkebyNetwork
You will be able to view your contract info in the dashboard.
- Offline support
- Cross-platform
- Awesome sounds
- No singup/login required
- Auto launch
- Auto updates
Learnt from Udemy Course Link
-
Always remove node_modules folder and then do <node install updates> to get all the dependencies
-
If facing ganache or web3 related issues (web3 is in constant modification so , use the versioning instead .26) After that run <npm install --save mocha ganache-cli [email protected]>
-
Put the console.log and verify if any variable from the compile is coming as undefined. Now run to verify if the whole code is working
Basic Terminologies in the Solidity Code :
-
Contracts : this contains .sol file mentioning our contract
-
test : this contains the test.js file (using some mocha code)
-
package.json : we keep this inside our root directory (have some script inside it , and it also captures different dependency being used)
-
compile.js : compiles our soldity files (node compile.js)
-
deploy.js : script file to take the compiled code and deploy it.
-
Running the tests : npm run test