Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bgaughran/solidity_sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solidity_sandbox

Sandbox for experiments and code samples pertaining to all things Solidity

Environment setup

  • install nodeJS

  • install npm (does this come with node?)

  • update npm to the latest using sudo npm i -g npm

  • install homebrew

  • install truffle sudo npm install -g truffle

  • install Ganache (https://truffleframework.com/ganache)

    • alternatively install Ganache CLI npm install -g ganache-cli
  • OPTIONAL: install geth Ethereum client by running brew install ethereum (can take a while)

    • WARNING: you may not wanna run a full node on laptop (takes a lot of hared drive space and days to sync from Internet the first time)
  • OPTIONAL: Mist Ethereum Wallet (install from from `https://github.com/ethereum/mist/releases) - user friendly UI to interact with Ethereum (Mist = wallet + built-in own browser, and Etherum Wallet = exactly the same wallet, but the built-in browser is disabled.) WARNING: you may not wanna run a full node on laptop (takes a lot of hared drive space and days to sync from Internet the first time)

  • install metamask in your browser

  • install Octotree (usefull for easily navigating www.github.com on LHS of browser)

  • copy https://github.com/ethereum/web3.js/blob/develop/dist/web3.min.js to a local directory to use Web3

    • always choose the latest beta (not the 'develop' branch. Instead pick the tag with the highest release version)
  • install lite-server (very simple web server) by running sudo npm install -g lite-server

    • run lite-server to get it running
    • configure lite-server using bs-config.json to include path to web app source and contract Solidity build files
  • to use Infura with Truffle, install the following npm install truffle-hdwallet-provider

--update 25/11/2018

  • install VirtualBox & Vagrant
  • install Blockgeeks development environment: https://app.vagrantup.com/blockgeeks/boxes/env
    • run vagrant init blockgeeks/env in the root of your development environment folder
    • update 'VagrantFile' to include the following: config.vm.box = "blockgeeks/env" config.vm.box_version = "0.0.1" config.vm.synced_folder ".", disabled: false
    • run vagrant up to provision the Vagrant environment
    • run vagrant ssh to connect to the vagrant environment
    • In vagrant shell cd /vagrant to go to the folder that launched the vagrant instance to provide access to all the files in that folder

??????CHECK ALL BELOW????????

  • Note: Latest versions of these nodejs dependencies in setup/package.json taken from github at the time of writing. Later versions may be available when running this
  • run npm install from setup folder where package.json resides
  • run sudo npm install -g remixd --unsafe-perm=true --allow-root to allow Remix use source code from hard drive then run the following to choose a shared folder remixd -s /Users/bgaughran/IdeaProjects/solidity_sandbox/contracts then click the 'link' icon in remix to load the files. See https://remix.readthedocs.io/en/latest/tutorial_remixd_filesystem.html for more details

Environment setup verification

  • start ganache-cli from the command line in the project root by running: ganache-cli (should start a local Ethereum node)

  • confirm web3js is available from the node command line by running in the project root: node then require("solc") and require("web3") and require("ganache-cli")

  • confirm ethereumjs-util is available from the node command line by running in the project root: node then require("ethereumjs-util") util = require("ethereumjs-util")

  • run geth version

To build our election DaPP

mkdir election cd election truffle init (Truffle command to initialize empty Truffle project in current directory) truffle version (prints out currently installed Truffle version) truffle compile (Truffle command to compile all Solidity smart contracts located in contracts folder) truffle compile --all (Truffle command to force compilation of all Solidity smart contracts) truffle migrate (Truffle command to run all migration scripts located in migrations folder) truffle migrate --reset (Truffle command to force running all migrations from beginning)

About

Sandbox for experiments and code samples pertaining to all things Solidity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors