Giter Club home page Giter Club logo

etherlime's Introduction

README

npm version travis build status code coverage status Documentation Status Gitter chat

[OBSOLETE]etherlime

etherlime is an ethereum development and deployment framework based on ethers.js.

This framework provides alternative to the other web3.js based frameworks and allows for ultimate control by the developer. It also adds much needed verboseness in the deployment process so that you can be aware of what is really going on (as opposed to the general shooting in the dark technique).

This framework was born out of necessity, hardships and trouble in the development and deployment of ethereum smart contract. We are trying to ease the pain of deployment, compilation and unit testing and add much needed stability to the process. In our mind ethers is much more stable alternative than web3.js for the moment therefore this framework is born.

Milestones:

  • [Ready] Being able to deploy compiled contracts (compiled in the truffle format) on local and infura nodes <---- Done
  • [Ready] Being able to compile contracts to the desired formats for deployment <---- Done
  • [Ready] Being able to run unit tests on the compiled contracts <---- Done
  • [Ready] Being able to run unit tests with code coverage <---- Done
  • [Ready] Being able to debug transactions <---- Done
  • [Ready] Being able to verify contracts <---- Done

Installing

npm i -g etherlime

Documentation

Documentation

Community

Join our community group

License

Completely MIT Licensed. Including ALL dependencies.

Developed by LimeChain

etherlime's People

Contributors

desimira avatar dimitarsd avatar failfmi avatar jparyani avatar nfurfaro avatar nikolayangelov avatar ochikov avatar perseverance avatar rkalis avatar thegostep avatar vlad0 avatar vladislavivanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

etherlime's Issues

Add code coverage report to the etherlime test functionality

Overview

Unit tests, by themselves are awesome tool, however in smart contracts it is important to cover all scenarios. In order to achieve this code coverage tool is needed. Use solidity-coverage tool to augment the experience of the developers and give them better perspective on their work.

Changes needed:

Augment etherlime test to include test coverage report

Create linking functionality in the deployer object, allowing for deployment of contracts relying on linking

Overview

As a developer I would frequently need to use libraries an would need to be able to link such libraries in the smart contracts I develop. Obviously I would need to deploy them. I need to have a mechanism to deploy libraries (already on place as they are normal contracts) and link them to other smart contracts that use them.

Changes needed:

Add optional second parameter to the deploy function of deployer that allows to specify object that describes the libraries to be linked and their addresses.

deploy(contract,[libraries],[params])

Important: This will introduce braking change to the API of the deployer.

The format of this object should be:

{
    libraryName0: '0xAddressOfLibrary0',
    libraryName1: '0xAddressOfLibrary1'
}

In the cases you need to add params, but do not want to link any libraries you can pass any false value or empty object.

Examples:

Linking libraries


const contractUsingQueueAndLinkedList = require('...');

const libraries = {
    Queue: '0x655341AabD39a5ee0939796dF610aD685a984C53,
    LinkedList: '0x619acBB5Dafc5aC340B6de4821835aF50adb29c1'
}

await deployer.deploy(contractUsingQueueAndLinkedList, libraries);

Skipping linking on contract without arguments

const contractWithoutLibraries = require('...');

await deployer.deploy(contractWithoutLibraries);

Skipping linking on contract with arguments

const contractWithoutLibraries = require('...');

await deployer.deploy(contractWithoutLibraries, false, param1, param2);

Show network ID in history

etherlime history is a really handy way to look back later and check what you deployed and which address it went to.

It would be useful if it showed the network ID, so you could see what you deployed to which network.

Add compilation ability of the etherlime CLI

Overview

As a developer I want to be able to use etherlime in order to compile my solidity contract into the required JSON files needed for deployment.

Changes needed:

Augment etherlime init to create contracts folder that will be used to store the solidity contracts being developed. Make this non-intrusive with Truffle (do not throw an error if such dir already exists)

Add etherlime compile [dir] command that will take the contracts folder specified in the dir param (defaults to ./contracts). It should search recursively.

The output of the compilation should be very similar to truffle both in the console and in the resulting build folder with .json output files

Implement structured output of commands

Overview

The idea of this issue is to create proposition of a structure for the structured output. This output will be used for inter app communication and integration.

Protocol Definition

We will use JSONRPC like structure for our protocol. One important consideration is that if we want to use this structured output as file descriptor stream, we would need to be writing the info into a file and only do appends. This might require a little bit of implementation flexibility on the readers part as we would have to be appending new events instead of writing in the middle of the file.

Every log line (record) will be in a json format. Every record will be separated with , as delimiter. This will allow the interpreter of these records to wrap them in [] and treat them as normal json array. The general structure of a record can be seen below

General structure of a record

This section will outline the fields that all the different command records will have in common

Example

{
    "version": "1",
    "command": "compile",
    "timestamp": 1538730411,
    "type": "log",
    "data": {}
}

Fields

  • version - The version of the protocol we are using. This will be used in order to be able to support multiple versions of this protocol.
  • command - The etherlime command used. Currently includes init, compile, deploy, history, test, coverage
  • timestamp - unix timestamp of the record
  • type - type of the record. Currently can be one of the following log, error, warning
  • data - record type specific data of the log. This field contents will differ based on the type of the record.

Error records

When the record is in fact an error it will contain the following data:

Example

"data": {
    "errorMessage": "File not found",
    "errorStackTrace": "..."
}

Fields

  • errorMessage - Message describing the error
  • errorStackTrace (Optional) - The stack trace of the error, might not be present always

Warning records

When the record is warning it will contain the following data:

Example

"data": {
    "warningMessage": "File present at this path. Skipping recreation.",
    "warningStackTrace": "..."
}

Fields

  • warningMessage - Message describing the warning
  • warningStackTrace (Optional) - The stack trace of the warning, might not be present always

Log records

When the record is in fact an error it will contain the following data:

Example

"data": {
    "logMessage": "File not found",
    "logData": {}
}

Fields

  • logMessage - Message describing the log. Normally human presentable
  • logData - object command specific data of the log. This field contents will differ based on the command and can/will be highly complex.

etherlime init

Will be updated during development if needed

etherlime compile

Will be updated during development if needed

etherlime deploy

Will be updated during development if needed

etherlime history

Will be updated during development if needed

etherlime test

Will be updated during development if needed

etherlime coverage

Will be updated during development if needed

Add Code Scaffolding for different languages based on the deployment

Overview

As a developer I would like etherlime to generate for me code snippets that can be directly integrated in my codebase and used to interact with the deployed smart contracts.

Changes needed:

Augment etherlime deploy to allow for additional parameter that will be used for scaffolding snippets of code to be later by the developer.
More details to be added

Create a new view for console reports.

When console window size is small console report is broken and rows are over-layered. Console output should be more responsive and readable in any resolution/window size.

View from high resolution:
1
View from low resolution:
2

Add functionality for writing and executing unit tests with etherlime

Overview

As a developer it is a standard practice to use unit tests. When you develop smart contracts it is especially critical to write such tests due to the immutable nature of the blockchain. Currently mocha is one of the best testing frameworks out there and one that most developers are used to. The idea is to create unit testing functionality similar to what Truffle does

Changes needed:

Augment etherlime init to create test folder that will be used to store the javascript test
Add etherlime compile [dir] command that will take the contracts folder specified in the dir param (defaults to ./contracts). It should search recursively.

The output of the compilation should be very similar to truffle both in the console.

Add setters for optional parameters for the deployers

When we create a new instance of any deployer (EtherlimeGanacheDeployer) for example, we need to provide all of the parameters (privatekey, port, defaultOverrides) or none of them.

If someone wants to provide only the port or only the defaultOverrides he should set the other properties as undefined. This approach is not friendly.

Task:
Provide setters for the different properties (for e.g setPrivateKey; setPort etc)
Add unit tests for the upper functionality

What is missing in etherlime and should be there for you to use it? [Ideas]

This is a cooperative bounty. Each eligible submission will be worth $20

Etherlime is open-source Dapp development and deployment framework made with the developer in mind. Therefore we need you - the Dapp developers to guide us towards what is needed. Is there a functionality missing, or do you want etherlime integrated with your favourite IDE? Feel free to dream and help us help you along your development hours.

We are looking for list of items in the following categories:

  • "Must have"
  • "Nice to have"
  • "Would be cool if etherlime ..."

Please add at least 2 items in each category.

Solc compiler set latest despite explict environment setting

Expected behavior

This is my first run at EtherLime but I expected that after running the test command would compile and it fails to deploy due to compiler mismatch, I have force installed [email protected] both globally and locally in the project but the same issue persists

Environment

Windows 10 Latest

Steps to reproduce

  1. Globally install etherlime through npm as per docs
  2. run etherlime init in a new directory
  3. run etherlime test

Error:
/contracts/LimeFactory.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version pragma solidity ^0.4.24; ^----------------------^

solidity-coverage path is wrong because it references node_modules folder

Hello,

Node.js version: 9.11.2
npm version: 5.6.0

FIle: etherlime/cli-commands/etherlime-test/test.js
Line: https://github.com/LimeChain/etherlime/blob/master/cli-commands/etherlime-test/test.js#L6

Code sample:

let App = require('./../../node_modules/solidity-coverage/lib/app');

Package shouldn't be referenced by its path to node_modules, e.g.:
File path: node_modules/etherlime/cli-commands/etherlime-test/test.js
Referenced relative path: ./../../node_modules/
The above will look for node_modules @ etherlime folder which will not exist always.

Proposal:

let App = require('solidity-coverage/lib/app');

OSx EACCESS on sha3 - Issues during installation of etherlime

Trying to install etherlime, I got the following error:

npm ERR! path /usr/local/lib/node_modules/node/lib/node_modules/etherlime
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/node/lib/node_modules/etherlime'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/node/lib/node_modules/etherlime']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules/node/lib/node_modules/etherlime\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path:
npm ERR!    '/usr/local/lib/node_modules/node/lib/node_modules/etherlime' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

Possible solutions:

  • add write perms to the /usr/local/lib/node_modules: "sudo chmod -R add a+w node_modules"
  • change owner of folder /usr/local/lib/node_modules: "sudo chown {username} node_modules"
  • use 'sudo' running the installation: "sudo npm i -g etherlime" (not recommended, because it could make the things even worse so try to avoid this workaround)

Add parameter to remove the verboseness of the deploy API command

Add parameter to remove the verboseness of the deploy API command. This would be useful when running unit tests and coverage as the verboseness clutters the console somewhat unnecessary. Add this as parameter as default overrides.

In addition add cli option --option that can be one of the following:

  • none - stop the output of the cli
  • console - print on stdout

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.