Coder Social home page Coder Social logo

c-org's Introduction

c-org

c-org status Twitter URL

c-org is the command line tool used to create and interact with Continuous Organizations

Table of Contents

About Continuous Organizations

To learn more about Continuous Organizations, please visit: https://c-org.co

Installation

You need Python > 3.5.3 because web3.py is using typing. If you are using an older version of Python, you can use pyenv to install a new one. In this case, make sure you activate the virtual environment each time you are using c-org.

# install pyenv
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
# install python 3.6.5
pyenv install 3.6.5
# create a virtual environment
pyenv virtualenv 3.6.5 c-org
# activate it
pyenv activate c-org

You also need to install solc to compile Solidity smart contract:

# On Ubuntu:
sudo add-apt-repository ppa:ethereum/ethereum # requires python-software-properties installed
sudo apt-get update
sudo apt-get install solc

# On other Linux distros:
sudo snap install solc

# On macOS:
brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity

Then, you can easily install c-org with the following command (make sure you have the latest version of pip installed):

pip install -e .

Testing

For running tests, you need a local provider. First, download and install node.js. Then install and run ganache-cli:

npm install -g ganache-cli

Finally, on a separate terminal, run py.test:

cd /path/to/c-org/
py.test

The tests suite is launching ganache-cli, but you might want to launch it by yourself if you want to check your Continuous Organisation before launching it on mainnet.

Usage

The continuous organisation called NAME is built inside a separate folder. By default, this folder is DIRECTORY = $HOME/.c-org/NAME.

  1. Create a config.yaml as given in example or run c-org init to generate one.

  2. Create a wallet containing enough gas to deploy the continuous organisation on the ethereum blockchain. Please note that this wallet is the admin wallet, used to deploy the smart-contract, it is not the wallet of the Continuous Organization (which is specified in the config.yaml file).

c-org wallet create NAME

The wallet is stored locally and you can re-use it. Add some ethers to it. If you're using ganache, you can use Metamask set on the localhost network to do that. Otherwise, use your favorite wallet to transfer some ethers (~ 0.1 eth) to it.

  1. Deploy the continuous organisation:
c-org deploy /path/to/config.yaml [--wallet NAME]
  1. Finally, you can buy, sell, add revenues ou see statistics with the commands:
c-org {buy, sell, revenue, stats} --help

TODO

  • Node provider. Everything was tested with ganache. Adding infura and local ethereum node support is necessary. Similarly, automated tests should use testrpc instead of depending on an extern call to ganache.
  • Wallet. The local admin wallet creation process is highly insecure right now. Level 0 (minimum) is to encrypt it with a user provided passphrase. Then, using the ethereum-go API to support using an already created local wallet would be great. In the future (once WalletConnect is functional), implementing a command-line version of WalletConnect to allow users to securely use their favorite wallet would be ideal.
  • Documentation. As the API is not stable yet, the documentation is not written. Instead, the user should use --help argument.
  • Versioning. I am wondering how to deal with change in a smart contract, such as it would break the API. I am considering for now a factory pattern to instance the API corresponding to the version.
  • Generating static files. A user interface is required to burn/mint tokens. User interfaces will be developed in separated repository and a link to this repository will be given as a parameter in params.yaml.

c-org's People

Contributors

guhur avatar thibauld avatar vrde 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.