Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
added new doc folder with markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ognyan Chikov committed May 20, 2019
1 parent c8a8929 commit ef532d9
Show file tree
Hide file tree
Showing 35 changed files with 1,738 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitbook.yaml
@@ -0,0 +1,8 @@
root: ./doc/

structure:
readme: README.md
summary: SUMMARY.md

redirects:
previous/page: new-folder/page.md
File renamed without changes
File renamed without changes
39 changes: 39 additions & 0 deletions doc/README.md
@@ -0,0 +1,39 @@
# Introduction

[![npm version](https://badge.fury.io/js/etherlime.svg)](https://badge.fury.io/js/etherlime) [![travis build status](https://img.shields.io/travis/LimeChain/etherlime/master.svg)](https://travis-ci.org/LimeChain/etherlime) [![code coverage status](https://img.shields.io/codecov/c/github/LimeChain/etherlime/master.svg)](https://codecov.io/gh/LimeChain/etherlime) [![Documentation Status](https://readthedocs.org/projects/etherlime/badge/?version=latest)](https://etherlime.readthedocs.io/en/latest/?badge=latest) [![Gitter chat](https://badges.gitter.im/lime-tech-talks/Lobby.png)](https://gitter.im/lime-tech-talks/Lobby)

## etherlime

**etherlime** is an ethereum development and deployment framework based on [ethers.js](https://github.com/ethers-io/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
* \[Not Ready\] Being able to verify contracts <---- Done

### Installing

```text
npm i -g etherlime
```

### Documentation

[Documentation](developer-documentation/getting-started.md)

### Community

[Join our community group](https://t.me/etherlime/)

## License

Completely MIT Licensed. Including ALL dependencies.

27 changes: 27 additions & 0 deletions doc/SUMMARY.md
@@ -0,0 +1,27 @@
# Table of contents

* [Introduction](README.md)

## Developer Documentation

* [Quick Start](developer-documentation/getting-started.md)
* [Etherlime Library API](developer-documentation/etherlime-library-api/README.md)
* [Deployer](developer-documentation/etherlime-library-api/deployers.md)
* [Deployed Contract Wrapper](developer-documentation/etherlime-library-api/wrappers.md)
* [Etherlime CLI](developer-documentation/etherlime-cli/README.md)
* [Installing and Help](developer-documentation/etherlime-cli/installing.md)
* [etherlime init](developer-documentation/etherlime-cli/init.md)
* [etherlime ganache](developer-documentation/etherlime-cli/ganache.md)
* [etherlime compile](developer-documentation/etherlime-cli/compiling.md)
* [etherlime deploy](developer-documentation/etherlime-cli/deploying.md)
* [etherlime history](developer-documentation/etherlime-cli/history.md)
* [etherlime test](developer-documentation/etherlime-cli/test.md)
* [etherlime coverage](developer-documentation/etherlime-cli/coverage.md)
* [etherlime debug](developer-documentation/etherlime-cli/debug.md)
* [etherlime shape](developer-documentation/etherlime-cli/shape.md)
* [etherlime flatten](developer-documentation/etherlime-cli/flattener.md)
* [etherlime ide](developer-documentation/etherlime-cli/ide.md)
* [etherlime zk](developer-documentation/etherlime-cli/zk.md)
* [etherlime utils](developer-documentation/etherlime-cli/utils.md)
* [Migration from Truffle to Etherlime](developer-documentation/migration-from-truffle-guide.md)

Binary file added doc/_docs_static/CompilationResult.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_docs_static/Debugger.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_docs_static/DeploymentResult.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions doc/developer-documentation/etherlime-cli/README.md
@@ -0,0 +1,2 @@
# Etherlime CLI

108 changes: 108 additions & 0 deletions doc/developer-documentation/etherlime-cli/compiling.md
@@ -0,0 +1,108 @@
# etherlime compile

Running this command will compile all smart contracts along with imported sources. The command comes with integrated solidity and vyper compiler and would automatically fetch all files with '.sol' and '.vy' extensions and would record the compiled json object in './build' folder. Note! To enable the vyper compiler you need to have running docker.

## Syntax

```text
etherlime compile [dir] [runs] [solcVersion] [docker] [list] [all]
[quiet] [output] [buildDirectory] [workingDirectory] [deleteCompiledFiles]
```

Parameters:

* `dir` - \[Optional\] By specifying `dir` you can set the root

directory where to read the contracts and place the build folder. By

default `dir` is set to the current working directory `./`

* `runs` - \[Optional\] By specifying `runs` between 1 and 999 you

enabled the optimizer and set how many times the optimizer will be

run. By default the optimizer is not enabled.

* `solcVersion` - \[Optional\] By specifying `solcVersion` you can set

the version of the solc which will be used for compiling the smart

contracts. By default it use the solc version from the node\_modules

folder.

* `docker` - \[Optional\] When you want to use a docker image for your

solc you should set `docker=true` in order `solcVersion` to accept

the passed image.

* `list` - \[Optional\] By specifying `list` you can list the

available solc versions. The following values can be used: `docker`,

`releases`, `prereleases` and `latestRelease`. By default only 10

version are listed

* `all` - \[Optional\] By specifying `all` together with `list` you

will be able to list all available solc versions.

* `quiet` - \[Optional\] Disable verboseness during compilation. By

the default `quiet` is set to false.

* `output` - \[Optional\] Defines the way that the logs are shown.

Choices: `none` - silences the output of logs, `normal` - see

verbose logs in the console and `structured` - structured output in

a file meant for inter program communication.

* `buildDirectory` - \[Optional\] Defines the directory for placing

builded contracts.

* `workingDirectory` - \[Optional\] Defines the folder to use for

reading contracts from, instead of the default one: `./contracts`.

Here can be specified also a single solidity file for compiling e.g:

`/contracts/LimeFactory.sol`.

* `deleteCompiledFiles` - \[Optional\] Delete the files in the

compilation contract directory before compiling. By the default

`deleteCompiledFiles` is set to false.

The `solcVersion` can accept the following values:

* \ - passing undefined or simply don't using the

solcVersion argument will use the solc version from the local

node\_modules

* \ - you can pass directly the version of the solc.

Example: `--solcVersion=0.4.24`

* \ - the image which will be used to load the solc into the

docker. Example:

`nightly-0.4.25-a2c754b3fed422b3d8027a5298624bcfed3744a5`

* \ - you can pass the absolute path to a local solc
* \ - when you set the solc version argument to `native` the

compiler is using the solc globally installed on your machine

Here is example of result:

![](../../.gitbook/assets/compilationresult%20%281%29.png)

59 changes: 59 additions & 0 deletions doc/developer-documentation/etherlime-cli/coverage.md
@@ -0,0 +1,59 @@
# etherlime coverage

## Syntax

```text
etherlime coverage [path] [timeout] [port] [runs] [solcVersion] [buildDirectory]
[workingDirectory] [shouldOpenCoverage]
```

Parameters:

* `path` - \[Optional\] By specifying `path` you can set a path to a

selected directory or you can set the path directly to the

javascript file which contains your tests. By default the `path`

points to `./test`.

* `timeout` - \[Optional\] This parameter defines the test timeout in

milliseconds. Defaults to 2000 ms.

* `port` - \[Optional\] The port to run the solidity coverage testrpc

\(compatible with etherlime ganache deployer\). Default: 8545.

* `runs` - \[Optional\] By specifying number runs you can enable the

optimizer of the compiler with the provided number of optimization

runs to be executed. Compilation is always performed by solidity

coverage.

* `solcVersion` - \[Optional\] By specifying `solcVersion` you can

choose a specific solc version to be used for compilation and

coverage reports.

* `buildDirectory` - \[Optional\] By specifying `buildDirectory` you

can choose which folder to use for reading builded contracts from,

instead of the default one: `./build`.

* `workingDirectory` - \[Optional\] By specifying `workingDirectory`

you can choose which folder to use for reading contracts from,

instead of the default one: `./contracts`.

* `html` - \[Optional\] By specifying `html` you can choose either to

open automatically with you default browser the html coverage report

located in: `./coverage`. Defaults to `false`.

64 changes: 64 additions & 0 deletions doc/developer-documentation/etherlime-cli/debug.md
@@ -0,0 +1,64 @@
# etherlime debug

## etherlime debug

In order to debug transaction, you will need the following:

* The transaction hash of a transaction on your desired blockchain.
* The source code of contract that transaction is executed from.

### Syntax

```text
etherlime debug <txHash> [port]
```

Parameters:

* `txHash` - Transaction hash of the transaction on your desired

blockchain.

* `port` - \[Optional\] The port that the etherlime ganache is runing.

Defaults to 8545.

Using the command will start the debugger interface with the following information:

* List of addresses involved or created during the cycle of the

transaction passed in.

* List of available commands for using the debugger.
* The entry point of the transaction, including code preview and the

source file.

### Available Commands

## Available Commands

The enter key is sending to the debugger the last command that is entered. After the initial start of the debugger, the enter key is set to step to the next logical source code element \(the next statement or expression that is evaluated by the EVM\). You can use n or enter initially.

* `(o) step over` Steps over the current line, relative to the position of the statement or expression currently being evaluated in the Solidity source file. Use this command if you don't want to step into a function call or contract creation on the current line, or if you'd like to quickly jump to a specific point in the source file.
* `(i) step into` Steps into the function call or contract creation currently being evaluated. Use this command to jump into the function and quickly start debugging the code that exists there.
* `(u) step out` Steps out of the currently running function. Use this command to quickly get back to the calling function, or end execution of the transaction if this was the entry point of the transaction.
* `(n) step next` Dteps to the next logical statement or expression in the source code. For example, evaluating sub expressions will need to occur first before the virtual machine can evaluate the full expression. Use this command if you'd like to analyze each logical item the virtual machine evaluates.
* `(;) step instruction` Allows you to step through each individual instruction evaluated by the virtual machine. This is useful if you're interested in understanding the low level bytecode created by the Solidity source code. When you use this command, the debugger will also print out the stack data at the time the instruction was evaluated.
* `(p) print instruction` Prints the current instruction and stack data, but does not step to the next instruction. Use this when you'd like to see the current instruction and stack data after navigating through the transaction with the logical commands described above.
* `(h) print help` Print the list of available commands.
* `(q) quit` Print the list of available commands.
* `(r) reset` Reset the debugger to the beginning of the transaction.
* `(b) add a breakpoint` Set breakpoints for any line in any of your source files \(see examples below\). These can be given by line number; by relative line number; by line number in a specified source file; or one may simply add a breakpoint at the current point in the code.
* `(B) remove a breakpoint` Remove any of your existing breakpoints.
* `(B all) remove all breakpoints` Remove all of your existing breakpoints.
* `(c) continue to breakpoint` Cause execution of the code to continue until the next breakpoint is reached or the last line is executed.
* `(+:) add watch expression` Add a watch on a provided expression, for example: `+:limes`
* `(-:) remove watch expression` Remove a watch on a provided expression, for example: `-:limes`
* `(?) list existing watch expressions` Display a list all the current watch expressions.
* `(v) display variables` Display the current variables and their values.

Here is example of runned debugger with txHash:

![](../../.gitbook/assets/debugger%20%281%29.png)

49 changes: 49 additions & 0 deletions doc/developer-documentation/etherlime-cli/deploying.md
@@ -0,0 +1,49 @@
# etherlime deploy

## Syntax

```text
etherlime deploy [file] [network] [secret] [-s] [compile] [runs] [output]
```

Parameters:

* `file` - \[Optional\] By specifying `--file` you can use another

file as long as you keep the structure of the file \(exporting an

`async deploy` function with `network` and `secret` params\)

* `network` - \[Optional\] By specifying `--network` you can specify

the network param to be passed to your deploy method

* `secret` - \[Optional\] By specifying `secret` you can specify the

secret param to be passed to your deploy method. Comes in very handy

for passing private keys.

* `-s` - \[Optional\] Silent - silences the verbose errors
* `compile` - \[Optional\] Enable compilation of the smart contracts

before their deployment. By default the deployment is done with a

compilation

* `runs` - \[Optional\] Enables the optimizer and runs it the

specified number of times

* `output` - \[Optional\] Defines the way that the logs are shown.

Choices: `none` - silences the output of logs, `normal` - see

verbose logs in the console and `structured` - structured output in

a file meant for inter program communication.

Running this command will deploy the file specified \(defaults to `./deployment/deploy.js`\) The deployment process is verbose and gives you real-time info about the performed actions. In addition there is a report of the actions when the deployment finishes \(as not all of us monitor the deployment process constantly\):

![](../../.gitbook/assets/deploymentresult%20%281%29.png)

24 changes: 24 additions & 0 deletions doc/developer-documentation/etherlime-cli/flattener.md
@@ -0,0 +1,24 @@
# etherlime flatten

## Syntax

```text
etherlime flatten [file] [solcVersion]
```

Parameters:

* `file` - The name of the contract from "./contract" folder that you

want to be flattened.

* `solcVersion` - \[Optional\] By specifying `solcVersion` you can set

the version of the solc which will be used for compiling the smart

contracts. By default it uses the solc version from your

node\_modules or the default one from etherlime.

Running this command will flatten the given smart contract and will record all Solidity code in one file along with imported sources. It will create "./flat" folder where you can find the flattened contract.

0 comments on commit ef532d9

Please sign in to comment.