Install Compiler

Dipc is a compiler that compile Dipperin C++ smart contract code to WebAssembly program.

Build From Source Code

Required

  • GCC 5.4+ or Clang 4.0+
  • CMake 3.5+
  • Git
  • Python

Ubuntu

Required: 16.04+

  • Install Dependencies
sudo apt install build-essential cmake libz-dev libtinfo-dev
  • Get Source Code
git clone https://github.com/dipperin/dipc.git
cd dipc
git submodule update --init --recursive
  • Build Code
cd dipc
mkdir build && cd build
cmake .. 
make && make install

Windows

Required: MinGW-W64 GCC-8.1.0

NOTES: MinGW and CMake must be installed in a directory without space.

  • Get Source Code
git clone https://github.com/dipperin/dipc.git
cd dipc
git submodule update --init --recursive
  • Build Code
cd dipc
mkdir build && cd build
cmake -G "MinGW Makefiles" .. -DCMAKE_INSTALL_PREFIX="C:/dipc.cdt" -DCMAKE_MAKE_PROGRAM=mingw32-make
mingw32-make && mingw32-make install

Use Dipc

Skeleton Smart Contract Without CMake Support

  • Init a project
dipc-init -project example -bare
  • Build contract
cd example
dipc-cpp -o example.wasm example.cpp -abigen

Skeleton Smart Contract With CMake Support

  • Init CMake project
dipc-init -project cmake_example
  • Build contract

    • Linux
    cd cmake_example/build
    cmake ..
    
    • Windows

    Required:

    cd cmake_example/build
    cmake .. -G "MinGW Makefiles" -DCMAKE_PREFIX_PATH=<cdt_install_dir>