Git Product home page Git Product logo

tokesim's Introduction

Tokesim

CI

Tokesim

A Tokeneconomics Simulator.
View Demo

Table of Contents

About The Project

Tokesim is an Agent Based Modeling tool that makes it easy to test token economic models. It's built using mesa-behaviors an extension to Mesa that makes models,agents,utility functions and strategies shareable and more extensible. The goal of Tokesim is to help developers run simulations against smart contracts, in a blockchain agnostic way, using shareable and reusable modules and libraries to do so.

Tokesim Features:

  • Type hints to make agents and models extensible
  • Ability to run against and simulation against your smart contracts
  • An architecture to make the simulations portable to multiple chains
  • ChartJS integration from Mesa framework
  • Support for testing Ethereum based smart contracts directly

Getting Started

Prerequisites

  • node v10.15.3 or later
  • npm v6.4.1 or later
  • python 3.7 or later but not 3.8 ;)

Installation

Clone/ download the project, and install dependencies. For development

git clone https://github.com/tokesim/tokesim.git && cd tokesim 
python3.7 -m venv venv
source venv/bin/activate
pip install poetry
poetry build
npm install -g @tokesim/tokesim-chain
# in a new terminal window
tokesim-chain --port 5554

or

pip install tokesim
npm install -g @tokesim/tokesim-chain
# in a new terminal window
tokesim-chain --port 3004

Usage

Run simulation

In order to run a simulation against a chain the default init will create a simulation for you to modify as you see fit. You'll need to start the chain simulation service.

# remember to activate your venv
source venv/bin/activate
pip install tokesim

# just like create react app generate template
tokesim init --dir simple-token --agents 20

#start chain simulator
tokesim-chain -c ethereum --port 3004

#run the simulation defaults to terminating after 100 steps
tokesim run --config ./simple-token/simulation.json --port 3004

Simulation App Layout

By default tokesim init will generate a default application layout, that specifies the accounts used a balance for each of the agents as well as configuration file and some simple bonded token curve agents. The contracts specified are a listed here

# ./simple-token/
.
└── simple-token    
    └── contracts 
    |    |── SimpleToken.bin
    |    └── SimpleToken_abi.json
    |── accounts.json    
    |── config_schema.json       
    |── simple_token_agent.py
    |── simple_token_model.py
    |── simple_token_config.py
    └── simulation.json

Configurations

Explanation coming soon

Roadmap

Coming soon

Contributing

How to contribute, build and release are outlined in CONTRIBUTING.md, BUILDING.md and RELEASING.md respectively. Commits in this repository follow the CONVENTIONAL_COMMITS.md specification.

License

Apache License 2.0

Resources

tokesim's People

Contributors

zcstarr 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.