Blockchain

 
 
A blockchain is a distributed database managed by a peer-to-peer network. The distributed database is also called a ledger which is a continuously growing chain of blocks. Each block contains a number of records and each block is linked to a previous block.

It is extremely difficult to change a record in any given block without the alteration of all subsequent blocks and the collusion of the network.

The first implementation of a blockchain was Bitcoin in 2009 invented by an unknown programmer, or a group of programmers, under the name Satoshi Nakamoto.

After the Bitcoin success many blockchain implementations followed such as Litecoin and Peercoin.

Other blockchain implementations introduces new kind of functionalities such as Ethereum and Dash.






How to build solidity on macOS



Information
Solidity is a contract-oriented, high-level language whose syntax is similar to that of JavaScript and it is designed to target the Ethereum Virtual Machine (EVM).

This tutorial shows how to build Solidity from source, meaning building the Solidity compiler also known as solc.

Information about Solidity, see: https://solidity.readthedocs.io/en/latest/index.html
Solidity code, see: https://github.com/ethereum/solidity

Operating system used
macOS 10.12 Sierra

Software prerequisites
Xcode
Homebrew


Procedure
  1. Checkout solidity from the remote git repository.
    • Type: mkdir ~/tools
    • Type: cd ~/tools
    • Type: git clone https://github.com/ethereum/solidity.git
    • Type: cd solidity

  2. Checkout the solidity version you want, for example v0.4.11.
    • Show all local tags: git tag -l

      This command shows the following:

      :
      v0.3.2
      v0.3.3
      v0.3.4
      v0.3.5
      v0.3.6
      v0.4.0
      v0.4.1
      v0.4.10
      v0.4.11
      :


    • Checkout tag v0.4.11, type: git checkout tags/v0.4.11
    • Check if the correct tag is checked out, type: git branch

      You should see:

      * (HEAD detached at v0.4.11)

  3. Update submodules.
    Type: cd ~/tools/solidity
    Type: git submodule update

  4. Install all required external dependencies on macOS.
    Type: cd ~/tools/solidity/scripts
    Type: ./install_deps.sh
    This will install several homebrew pacakges in /usr/local/Cellar/

  5. Building Solidity.
    Type: cd ~/tools/solidity/scripts
    Type: ./build.sh
    it takes several minutes to build....

    You will see the following:

    :
    [100%] Linking CXX executable soltest
    [100%] Built target soltest
    Installing solc and soltest


  6. When the build is finished, checkout the version:
    Type: solc --version

    You will see the following:

    solc, the solidity compiler commandline interface Version: 0.4.11-develop.2017.6.28+commit. 68ef5810.Darwin.appleclang

  7. The solc program is also installed in /usr/local/bin/solc.
    Type: which solc to find the solc location.

    There is NO need to update your ~/.bash_profile file and add the following line:
    # Solidity
    export PATH=$PATH:/Users/robertlie/tools/solidity/build/solc


  8. If you want to build another solidity version, you need to undo all changes in the solidity folder.
    Type: cd ~/tools/solidity
    Type: git checkout -f
    Type: git clean -fd
    Type: git pull and start again with step 2.