To use the specific version of solidity compiler, add this in the truffle-config.js inside module.exports
compilers: {
solc: {
version: "0.4.2"
}
},
- In solidity, there is no way to determine the size of the mapping, and no way to iterate over it either.
- You can access any default key in the mapping and it won't throw and error. It will return the default value.
Ref commands:
> truffle console
con> Election.deployed().then(function(instance){app=instance}) # this will get you the instance of the smart contract. from here you can also call the functions of the smart contract manually
> truffle migrate # will put the compiled code on the local blockchain (this will depend on the local env specified)
- how to install
geth
on Mac:
brew update
brew tap ethererum/ethererum
brew install ethereum
brew updgrade ethererum
To have ganache attach to development network
geth attach http://0.0.0.0:7545
-
geth and mine ether too
-
mist is the browser for decentralized apps.
-
to start mist on macos
/Applications/Mist.app/Contents/MacOS/Mist --rpc 0.0.0.0:7545