Code Monkey home page Code Monkey logo

eos-vscode-smart-contract-boilerplate's Introduction

EOS VSCode Starter Kit

This is a set of boilerplate in order to develop smart contracts using VSCode. It includes the needed c_cpp_properties.json file in .vscode for recognizing #includes from eosiolib.

Prior knowledge required

You should have at least completed the "start here" section on dev docs

Important notes

This setup is intended for users running mac OSX... but I would imagine the same would work for most popular versions of linux by just replacing brew with whatever use use... perhaps apt?

This will not work on its own! Before attempting to use this you must do the following:

  1. install nodeos, keosd, & cleos via docker
  1. install EOS contract development toolkit
  • brew tap eosio/eosio.cdt
  • brew install eosio.cdt
  1. create needed symlinks
  • navigate to /usr/local/include/
  • ln -s /usr/local/Cellar/eosio.cdt/1.3.2/opt/eosio.cdt/include/eosiolib
  • navigate to /usr/local/include/eosiolib
  • lin -s /usr/local/Cellar/eosio.cdt/1.3.2/opt/eosio.cdt/include/boost

After completing the above steps your VSCode should recognize #includes and intellisense should work.

Compiling/Deploying Contracts

Comple the contract:

eosio-cpp -o hello.wasm hello.cpp --abigen

Open wallet:

cleos wallet open

Unlock wallet:

cleos wallet unlock

Create an account for the contract:

cleos account create hello $EOS_PUBLIC_KEY

Create the contract:

cleos set contract hello $EOS_CONTRACT_DIR/hello

Update the contract:

  1. make changes
  2. compile
  3. Same as create
  4. done

Interacting with the contract

Create another account if you dont have one:

cleos account create bob $EOS_PUBLIC_KEY

Call hi on hello:

cleos push action hello hi '["bob"]' -p bob

You should get the following back:

>> Hello bob

Call bye on hello:

cleos push action hello bye '["bob"]' -p bob

You should get the following back:

>> Bye bob

Creating your own contract

clone/fork/do whatever ytou want with this. The important files are in .vscode.

eos-vscode-smart-contract-boilerplate's People

Contributors

tovarishfin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.