Giter Site home page Giter Site logo

silentbyte / kittycoin-club Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fluffycatware/kittycoin-club

0.0 2.0 2.0 2.06 MB

Donation site for cats in foster care built on smart contracts

License: MIT License

JavaScript 95.53% Shell 0.86% CSS 1.18% HTML 2.43%

kittycoin-club's Introduction

KittyCoin Club DApp

Donation site for cats in foster care built on smart contracts.

Build Status Coverage Status Ethereum Solidity Node.js

About

This repository houses the kittycoin.club's donation system. It has been built using Ethereum smart contracts.

Developing This Contract

In order to develop this contract the following steps were taken to setup the environment.

Install and run Ganache CLI (formally you would have used TestRPC). Alternatively you can install Ganche UI.

$ npm install -g ganache-cli
$ ganache-cli

When you run Ganache you'll be presented with 10 accounts with private keys. The RPC service that you can interact with the blockchain through is also available on localhost:8545 for the CLI version and localhost:7545 for the GUI.

Navigate into the root of this project and install truffle (if you haven't already got it). Run the truffle test command to compile and test the contracts.

$ npm install -g truffle
$ npm run test

If you watch the ganache-cli output you'll see various transactions taking place while your the contracts unit tests are executed.

Here's and example of a transaction:

Listening on localhost:8545
net_version
eth_accounts
eth_accounts
eth_accounts
net_version
net_version
eth_sendTransaction

  Transaction: 0x0c53488c3db64d41f972dfa9ce4d96f123f404f2a72fc7e843e5c8265b34c8ee
  Contract created: 0x926f5105ea9e1cbf4476a5437e42c5880b78309a
  Gas usage: 269607
  Block Number: 1
  Block Time: Wed Jan 17 2018 22:42:34 GMT+0800 (AWST)

When npm run test is executed it uses the config within the truffle-config.js file. This runs the test against a network run with lite-server and testrpc (this method is not longer the defacto way of working, however its easier for us to deploy and use with travis.ci).

The configuration for running the network locally using truffle is in the truffle.js file with the configuration below.

    test: {
        host: "localhost",
        gasPrice: 1,
        gas: 0xffffffff,
        port: 7545,
        network_id: "*", // Match any network id
    },

Note: I have 7545 in this file as I've been using the GUI version of Ganache which defaults to this port.

When you are ready to test, run the ganache-cli or ganache gui client and then execute the following to compile and deploy the contracts to the blockchain

$ truffle compile
$ truffle migrate

then to run the dev application use the following

$ npm install
$ npm run dev

Screenshots

Attribution

This smart contract used Giveth's Base layer contract structure. Check out the amazing work they are doing at Giveth's website.

Ownable.sol contract is provided by the zeppelin-solidity repo.

kittycoin-club's People

Contributors

t04glovern avatar silentbyte avatar

Watchers

James Cloos 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.