@daocasino/dc-cli
Command line interface for DC protocol
Last updated 2 years ago by kellas .
GPL-3.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @daocasino/dc-cli -g
SYNC missed versions from official npm registry.

CLI for Dao.Casino SDK

Overview

DC-CLI is a command line wizard designed to smoothly download and deploy DAO.Casino SDK elements. The idea behind it is to reduce the number of similar manual operations (e.g. changing the same value at several points) and, subsequently, to reduce the risk of errors.

SDK Documentation

Thus, whenever the game contract conditions (configuration values) are edited, the watch_contracts.js script designed to monitor contract status implements your updates environment-wide and redeploys the contract.

Prerequisites:

To use dc-cli, you need:

  • docker-compose
  • one of the recent node.js versions (10 or newer)
  • Bash Terminal (if you are using Windows)

A developer is expected to be familiar with solidity to edit the game smart contract.

Note that the whole solution has been successfully tested on .nix OS's and Mac OS. It is supposed to be compatible with Windows, but no tests have been carried out so far. You may need to install additional applications.

Installation

To install DC-CLI, call:

 npm i -g dc-cli

Commands

dc-cli offers a list (a menu) of commands; each is responsible for a specific stage of SDK setup. There is a recommended order of commands, but it can be revised at developer's discretion, also dc-cli commands can be used separately at further stages of SDK life-cycle (e.g. to reset the environment).

List

View the list of available Truffle templates (webpack, Vue, React). Choose one for your project.

Create

First command is called to pull the SDK container from the docker repository. Call the command and enter the path to folder where you want to deploy your local SDK. Then the container is pulled, the local test environment is deployed, smart contracts (.sol files) configured, accounts created. You can access the console in the browser at localhost:port_number.

Once complete, call dc-cli again and move to the next command.

To view logs, either use the relevant dc-cli command, or call: npm run

logs:bankroller

Start

This command starts the SDK browser console with a viable game example in it. Use the console to navigate between files, edit game logic.

Stop

This command stops the environment correctly. If you close the console manually, docker container will go on running in the background.

Logs

This command allows viewing dapp performance logs.

Build

This command compiles your contract settings for ropsten.

Deploy

This command publishes your contracts to ropsten and IPFS.

Publish

Makes the game available at gamemarket.

Whenever you call a command in dc-cli, you call package.json file. Acting as a "dashboard", the file, in turn, calls the relevant script to execute the selected command.

Console File Structure

The left side of the console window displays the file structure of the SDK environment within the folder where you choose to deploy it.

Basically, it contains files from Dao.Casino github repositories deployed and integrated on your local computer in way that allows you to immediately start developing games and/or launching your own platform.

The smart contract logic is stored in the contracts > tools folder. For detailed description of each contract, refer to the relevant section.

The game logic is stored in files within the dapp folder. For more details on each file, please refer to the relevant documentation section.

The dapp> config folder contains the script ensuring implementation of the protocol.

The test folder contains the tests that verify whether the protocol from DC.js is correctly implemented into the game logic (the sample game, DappTest.js, is used).

The view folder is designed for the game front-end visual elements.

Current Tags

  • 0.2.9                                ...           latest (2 years ago)

9 Versions

  • 0.2.9                                ...           2 years ago
  • 0.2.8                                ...           2 years ago
  • 0.2.7                                ...           2 years ago
  • 0.2.6                                ...           2 years ago
  • 0.2.5                                ...           2 years ago
  • 0.2.4                                ...           2 years ago
  • 0.1.15                                ...           2 years ago
  • 0.1.13                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (12)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |