Code Monkey home page Code Monkey logo

create-nos-dapp's Introduction

create-nos-dapp

This is a CLI tool to generate a dApp project for the nOS platform, in your favorite frontend technology.

Purpose

The goal of this project is to provide a quickstart for creating nOS dApps with various frontend technologies already installed and configured to work with the nOS platform.

Installation

Before we start, we want to make sure npm is installed via a version manager. To avoid permission issues on different OS, we suggest using nvm. You can follow the install instructions here.

After successfully installing npm, we need to install the npm package. This will make the create-nos-dapp command available in your command prompt. You can install the npm package by executing one of the following commands

# Using yarn
yarn global add @nosplatform/create-nos-dapp

# Using npm
npm i -g @nosplatform/create-nos-dapp

Usage

Direct usage

At this point the create-nos-dapp command should be available. To create a dApp for nOS, simply open up your command prompt and execute:

create-nos-dapp

It will now ask you to choose a project template and what name you'd like to give it. The CLI-tool will create the project in the current working directory.

Usage with flags

If you'd like to get started even faster - you could also pass some arguments to the create-nos-dapp.

usage: create-nos-dapp [-h] [-v] [-t TYPE] [-n NAME]

create-nos-dapp

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  -t TYPE, --type TYPE  Template type (react/vanilla/vue)
  -n NAME, --name NAME  Project name, f.e. my-nos-dapp

Resources to get started with the generated project

API Documentation

Getting started with the project templates

create-nos-dapp's People

Contributors

12bits avatar dependabot[bot] avatar fmanea avatar jeroenptrs avatar mhuggins avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-nos-dapp's Issues

Invoking Smart Contract from dApp

Invoketest SC from dApps via nOS client: When trying to invoke domain service SC and passed following args:
const neoAuth = "0xe60a3fa8149a853eb4dff4f6ed93c931646a9e22";
const operation = "RegisterDomain";
const args = [
'AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y',
'bucket.nos',
'AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y',
'https://ihasabucket.com/'
];

Expected Behavior

It should invoke SC and write the new entries (as given in args) on blockchian and return results properly. Such as True in case operation successful or False in case operation failed.

Current Behavior

At present, I think args from dApp is not properly readable by nOS client.

Possible Solution

We need to change the following thing in our dApp starter kit:

  1. "const neoAuth" to "const contractHash" because it is contract hash.
  2. In /src/nos/index.js changes:
    // Smart Contract Actions
    testInvoke: (scriptHash, operation, args) =>
    nos.testInvoke(scriptHash, operation, ...args),
    invoke: (scriptHash, operation, args) =>
    nos.invoke(scriptHash, operation, ...args),
  3. Instead of return hexString in popup windows, nOS client should return True or False.

Context

I am trying to test dApp full functionality via nOS client but still facing some issues of communication with blockchain by using nOS client.

Your Environment

  • Version used:
  • Environment name and version (e.g. node.js 9.6.1, yarn 1.6.1, npm 5.6.0):
  • Operating System and version (desktop or mobile):
    npm version = 5.6.0
    yarn version = 1.6.0
    node.js version = 9.11.1
    OS: Ubuntu 16.2 (Desktop)

Linux support

Expected Behavior

I should be able to create a Reactapp under Linux

Current Behavior

When I run npm run start I get

Success: Created new project folder My-nOS-dApp
{ Error: ENOENT: no such file or directory, lstat '/home/ianaz/workspace/my-dapp/lib/..\packages\reactjs'
    at Error (native)
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/home/ianaz/workspace/my-dapp/lib/..\\packages\\reactjs' }
Done in 5.07s.

Possible Solution

I think that's because of the backslashes. Using normal slashes could fix.

Your Environment

Linux 4.13.0-38-generic 43~16.04.1-Ubuntu 64bit GNU/Linux

  • NodeJS 8.10

I'll try the possible solution right now and create a PR

deploy instructions

yarn build generates index.html but it does not find the javascript? index.html in console shows
Failed to load resource: net::ERR_FILE_NOT_FOUND

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Add ember support

Add support for Ember JS

Aim of this issue is to attempt to add ember support for the nos dapp environment

  • add ember application to the structure
  • add ember addon support to the structure (nice to have)
  • add ember to the cli choices
  • add all relevant tests

New dApp failed to build with stand-alone file structure

I've created a new dApp with create-nos-dapp called hot-tokens. The file structure look like this:

create-nos-dapp/hot-token

I'm able to build the new dApp if I run yarn install/start under directory:

create-nos-dapp/hot-token.

The problem happens when I try to move the folder of hot-token out of create-nos-dapp folder. When I run yarn install/start, it compains with the follow error:

.../hottokens/src/views/App/index.jsx:52:18: Unexpected token (5  50 |   }
  51 | 
> 52 |   getInitialState = () => {
     |                   ^
  53 | 
  54 |     return {
  55 |       playerAddress: "",

It looks like yarn failed to build javascript in ES6.

The command I tried:

 mkdir hottokens
 cp -R hot-tokens/hot-tokens/* hottokens/
 cd hottokens/
  yarn install
  yarn start

Expected Behavior

The project should be able to build in its own location

Current Behavior

The project can be built successfully under create-nos-dapp/hot-token, but failed if moved location.

Possible Solution

Steps to Reproduce (for bugs)

The command I tried:

 mkdir hottokens
 cp -R hot-tokens/hot-tokens/* hottokens/
 cd hottokens/
  yarn install
  yarn start

Context

At the moment, I have to submit the project to github with the parent folder as a workaround

e.g.

https://github.com/jaszhou/hot-tokens/hot-tokens

It should be a cleaner way.

Your Environment

yarn 1.7.0
node 8.11.3
npm 5.6.0

  • Operating System and version (desktop or mobile):

MacOS 10.13.4

Failed to create new dapp with node version 10

Error:

node:59289) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=4 <=9".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
✖ Something went wrong while copying the template or installing the dependencies
Please check the console output and report it at 'https://github.com/nos/create-nos-dapp/issues'

Expected Behavior

It should also work with higher version of node.

Current Behavior

Failed with error message

Possible Solution

code update

Steps to Reproduce (for bugs)

Just try to run the command with node version 10.4.1

Context

Not able to ceate a new template

Your Environment

  • Version used: 0.2.2
  • Environment name and version (e.g. node.js 10.4.1, yarn 1.7.0, npm 6.1.0):
  • Operating System and version (desktop or mobile): MacOS High Sierra

dApp names with numbers in them are not allowed in prompt

Expected Behavior

I should be allowed to choose a dApp name such as my-test-dapp-1 when prompted

Current Behavior

In the prompt, choosing a dApp name with a number in it fails with Please enter a valid project name

Entering the name on the command line with -n or --name does not have the regex check on name characters so it is possible to specify a dApp name with a number in it

Possible Solution

Add 0-9 to the regex for name sanity checks. Also, add sanity checking to the command-line arg parser to make the behavior consistent in both methods.

Steps to Reproduce (for bugs)

  1. Run create-nos-dapp with no arguments
  2. When prompted for the dApp name, enter a name with a number in it

Context

Minor impact, easy workaround, just reporting this for improved consistency/user-experience

Your Environment

  • Version used: 0.2.3
  • Environment name and version (e.g. node.js 9.6.1, yarn 1.6.1, npm 5.6.0): node.js 10.4.1, npm 6.4.1
  • Operating System and version (desktop or mobile): OSX 10.14.3 Mojave

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.