Git Product home page Git Product logo

loomchain's Introduction

Loom Protocol

Loom Protocol powers Basechain, an interoperable DPoS blockchain that is live in production, EVM-compatible, audited, and battle-tested.

Prerequisites

  • A running Linux or macOS system.

  • Go 1.9+.

  • Dep. For details about installing Dep, see the Dep page.

  • (OPTIONAL) LevelDB.

    If you're running macOS, you can enter the following command to install LevelDB:

    brew install leveldb

    If you're running Linux, you can enter the following command to install LevelDB:

    apt-get install libleveldb-dev libleveldb1v5
  • The GOPATH environment variable is defined.

Build the binary

  1. Set the value of the LOOM_SRC environment variable as follows:
LOOM_SRC=$GOPATH/src/github.com/loomnetwork/loomchain
  1. Clone the repository into the $LOOM_SRC directory:
git clone [email protected]:loomnetwork/loomchain.git $LOOM_SRC
  1. Install dependencies:
cd $LOOM_SRC && make deps
  1. Build the binary:
make
  1. Copy the ./loom binary to a directory of your choice.

Run

  1. Use the following command to initialize the blockchain with the built-in contracts:
./loom init
  1. Enter the following command to run the node:
./loom run

Generate keys

Use the loom genkey command. It will create two files with the given names.

./loom genkey -a publicKeyFilename -k privateKeyFilename

Ethereum smart contracts

  1. Deploy smart contract by entering the loom deploy command:
./loom deploy -a pubkeyFile -k prikeyFile -b contractBytecode.bin
New contract deployed with address:  default:0xB448D7db27192d54FeBdA458B81e7383F8641c8A
Runtime bytecode:  [96 96 96 64 82 96 .... ]
  1. Make a call to an already deployed contract with the loom cal call command:
./loom call  -a pubkeyFile -k prikeyFile -i inputDataFile -c 0xB448D7db27192d54FeBdA458B81e7383F8641c8A
Call response:  [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 219]

Details of encoding contract input data can be found in the Solidity ABI documentation. You can use static-call similarly to run a read only method.

Update Protobuf Messages

Enter the following command to update protobuf messages:

# build the Go plugin for protoc
make proto

See the Go Generated Code page for more details about how you can use the generated protobuf messages.

Update vendored Go dependencies

Some of the Go dependencies are vendored using Dep. Most common operation when dealing with the vendored dependencies is to update the Tendermint or IAVL branch/revision. This can be done by updating the branch/revision in Gopkg.toml and then running dep ensure -update.

For example:

dep ensure -v -update github.com/tendermint/iavl

Useful Links

loomchain's People

Contributors

adityagodbole avatar adyromantika avatar andreipope avatar atchapcyp avatar aupiff avatar bikashdas avatar dependabot[bot] avatar eduardonunesp avatar enlight avatar extrodox avatar gakonst avatar ksandom avatar kyteague avatar linuxdev53 avatar mattkanwisher avatar mukuls9971 avatar nightingaleash avatar nishantmodak avatar parthdesai avatar pathornteng avatar phoorichet avatar sriep avatar suhasagg avatar surabhiborgikar avatar tstxni97 avatar zimm-lostpolygon 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.