Coder Social home page Coder Social logo

shiftcoins's Introduction

ShiftCoin Prototype

Overview

This project is a blockchain backed prototype of ShiftCoins for the ShiftAppens2018 event. It allows you to deploy a private blockchain node, an ERC20 token smart-contract and a NodeJS server that receives commands from Slack and allows you to trade the ShiftCoin currency between users.

Private ethereum cluster network

Deploy local cluster

The ethereum scripts in the ethereum directory allow you to easily deploy a local private network. This network will run as docker containers. Check the makefile for the most commun operations and examples commands on the javascript console on the node. The main commands are:

  • make init - will start the network, create an account, unlock it and start mining. The mining rewards will be given to the created account.
  • make console - will attach your terminal to the javascript/web3 console running in the node.
  • make stop - will pause the containers.
  • make start - will restart the containers.

Monitoring

You can monitor your private netwokr through the netstats tool. When you create your network, go to 'localhost:3000' or make open-netstats to open the dashboard.

Note

The ethereum node docker-compose configuration sets a cpus: 2 cpu limit on the mining container. This will make the node mutch slower, but will keep your pc from frying. If you want to speed up the blockchain creation, or increase mining speed remove it.

Application

Local private node

In the geth directory you have the scripts to run a single ethereum private node which you can use for local development.

NodeJS server

Also in the geth directory you have all the code you need to deploy a local NodeJS server that makes use of the Web3 library. To run this server, make use of the regular npm commands, like npm install and npm start. You can check the node code in the src directory.

Smart Contract

The smart-contract directory is a truffle project which contains all the smart-contract code in solidity and the tools necessary to test it and deploy it. Take a look in particular to the ShiftCoin.sol file inside the contracts directory. It contais all the code you need to build the ERC20 token. In order to compile and deploy this contract, take a look at the documentation for the truffle framework.

Resources

Private Network

This blog post will give you an introduction on running your own private network: https://hackernoon.com/heres-how-i-built-a-private-blockchain-network-and-you-can-too-62ca7db556c0

Smart Contracts

In order to build and interact wil smart contracts you should use the Truffle framework. It will simplify the process of compiling and deploying smart contracts to the network. Learn how write smart contracts through the cryptozombies tutorials.

Token Standards

This post illustrates the creation of an ERC20 token using truffle: http://truffleframework.com/tutorials/robust-smart-contracts-with-openzeppelin

shiftcoins's People

Contributors

pmdcosta avatar lobosque avatar nunosilva800 avatar

Watchers

Diogo Laginha avatar Rafael Jegundo avatar Samuel Moreira avatar  avatar James Cloos avatar  avatar  avatar Nuno Correia avatar Diogo Lucas avatar Pedro Janeiro avatar Renato de Leão avatar  avatar Rafael Ferreira avatar  avatar Beatriz Beato avatar chris eliezer avatar  avatar  avatar Catarina Lucas avatar João Marques avatar  avatar

shiftcoins's Issues

As an admin, I want to see confirmation of a transfer.

I think currently the staff can take coins from users. For example if I go to the bar and buy something, they remove coins from my account. I think we should do the oposit, users should pay themselves they we do we credit cards and stuff.

But the staff needs to see payment confirmations to avoid issues. We can send a notification to the staff account whenever they receive coins.

As an admin, I want to give coins to users.

The organisation needs to be able to give coins to users.
I guess the best solution is to give a lot of coins to some wallets that the organisation can use.
They would use the same interface as the users.

As a user, I want to export my wallet.

I think we should allow users to export their private key\wallet, so that they can use ther blockchain directly.
This command would send a message to the user with his key.

As a user, I want to transfer coins to another user.

Users should be able to send coins to another user.
They need to supply the username of the other use. We would need to check the address of that user in the smart contract and request the transfer to that address.

As a user, I want to create my shiftcoins account/wallet.

I am guessing we can register a user the first time they enter a shiftcoin channel. We can get their username and build a new wallet for them.
A smart contract should take care of the registration. That operation should:

  • send ether to the user.
  • send 1 coin to the user.
  • add the user to a mapping (username => address)

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.