Return to site

DEV NOTES: resources to self-start with blockchain

The list to resources to make it easier to start develop projects on Ethereum

Intro

Last few weeks I had been working on gaining enough development experience with blockchain to start work on project for our client. Here is a list of resources which I found the most useful and share with you to make easier for you to start work with Ethereum.

Resources

Official documentation to get general overview
https://solidity.readthedocs.io/en/develop/solidity-in-depth.html

How to setup and run nodes on ethereum
https://pragmaticintegrator.wordpress.com/2017/10/28/set-up-private-blockchain-with-ethereum-part-1/

How to deploy smart contracts on low level
https://medium.com/@gus_tavo_guim/deploying-a-smart-contract-the-hard-way-8aae778d4f2a

The same as above, but with truffle - high level API
https://medium.com/@gus_tavo_guim/using-truffle-to-create-and-deploy-smart-contracts-95d65df626a2

Development environment
Remix https://ethereum.github.io/browser-solidity
Visual studio code https://code.visualstudio.com/Download
Plugins
https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig
https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity
https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight

Known bugs and tips for common operations

Invalid number of arguments to Solidity function:
https://github.com/trufflesuite/truffle/issues/596

Proper truffle.js configuration (you also have to add gas value)
https://github.com/leopoldjoy/truffle-init-default/blob/d7931872e85e1e43e69292663d790e63f01f77b6/truffle.js#L7

Get available funds
web3.fromWei(eth.getBalance(eth.coinbase), "ether")

web3.fromWei(eth.getBalance(eth.accounts[1]), "ether")

Setup right account for miner
miner.setEtherbase(eth.accounts[1])

truffle: assign a variable with accounts
web3.eth.getAccounts(function(err, res) { accounts = res; });

truffle: convert bytes32 back to string and backwards:
web3.toUtf8
web3.fromAscii

transfer currency from one account to another:

function sell(address transferTo)
      public
      payable // make function payable
    {
      // change the amount to the amount sent with the call (msg.value)          
      transferTo.transfer(msg.value);
    }
// call from truffle console:

Test.deployed().then(instance => instance.sell( accounts[1],  {from: accounts[0], value: web3.toWei(1, 'ether') } )) How to get instance of the contract from address you supply https://ethereum.stackexchange.com/questions/17896/how-is-this-code-feasibly-valid
All Posts
×

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!

OKSubscriptions powered by Strikingly