VoR0220 / eris-compilers

Eris Platform Compilers Daemon

Home Page:https://monax.io/docs/documentation/compilers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eris Compilers

GoDoc Linux
Master Circle CI
Develop Circle CI (develop)

The Eris Compilers Service is a helper tool to help in grabbing necessary data such as binaries and ABIs from your preferred language for smart contracts in a simple manner. Currently that language is Solidity, but the service is easily extensible to other languages in the future.

Table of Contents

Background

A web server and client for compiling smart contract languages.

Features:

  • compiles Solidity
  • returns smart contract abis and binaries
  • handles included files recursively with regex matching
  • client side and server side caching
  • configuration file with per-language options
  • easily extensible to new languages

Monax Industries' own public facing compiler server (at https://compilers.monax.io) is hardcoded into the source, so you can start compiling smart contract language right out of the box with no extra tools required.

Installation

eris-compilers is intended to run as a service in a docker container via eris-cli. The server can be started with: eris services start compilers.

For Developers

  1. Install go
  2. go get github.com/eris-ltd/eris-compilers/cmd/eris-compilers
  3. (Optional) Install Solidity

Usage

As A Library

import (
  client "github.com/eris-ltd/eris-compilers/network"
)

url := "https://compilers.monax.io:9099/compile"
filename := "maSolcFile.sol"
optimize := true
librariesString := "maLibrariez:0x1234567890"

output, err := client.BeginCompile(url, filename, optimize, librariesString)

contractName := output.Objects[0].Objectname // contract C would give you C here
binary := output.Objects[0].Bytecode // gives you the binary
abi := output.Objects[0].ABI // gives you the ABI

Compile Remotely

eris-compilers compile test.sol

Will by default compile directly using the monax servers. You can configure this to call a different server by checking out the --help option.

Compile Locally

Make sure you have the appropriate compiler installed and configured (you may need to adjust the cmd field in the config file)

eris-compilers compile --local test.sol

Run a server yourself

eris-compilers server --no-ssl

will run a simple http server. For encryption, pass in a key with the --key flag, or a certificate with the --cert flag and drop the --no-ssl.

Support

Run eris-compilers server --help or eris-compilers compile --help for more info, or come talk to us on Slack.

If you are working on a language, and would like to have it supported, please create an issue!

Contribute

See the eris platform contributing file here.

License

GPL-3

About

Eris Platform Compilers Daemon

https://monax.io/docs/documentation/compilers

License:GNU General Public License v2.0


Languages

Language:Go 95.9%Language:Shell 4.1%