Giter VIP home page Giter VIP logo

cli's Introduction

Decentraland CLI Decentraland Logo

CI chat on Discord

This CLI provides tooling/commands to assist you in the scenes development process. Some of the commands will help you scaffold a new scene project, locally start and visualize the scene in order to test it and deploy it to a content server to be incorporated in your Decentraland parcel.

Usage

To install the latest version of dcl (Decentraland CLI), run this command:

npm install -g decentraland

To learn what you can do with the CLI run the following command:

dcl --help

See more details at Decentraland docs.

Documentation

For details on how to use Decentraland developer tools, check our documentation site

Contributing

  1. Fork this repository to your own GitHub account and then clone it to your local device.
  2. Install dependencies with npm install.
  3. Build the project by running npm run build.
  4. Link the CLI with: npm link. The dcl command should now be available.
  5. You can run tests with npm test

NOTE: you can set the environment variable DEBUG=true to see all debugging info

Releasing

Just update the version on the package.json file and merge to master.

Configuration

dcl can be configured in several ways to adapt it to another environment other than the default one. To do this you have to either set environment variables or change your ~/.dclinfo file:

Variable name Enviroment variable ~/.dclinfo
Provider RPC_URL -
MANA Token Contract MANA_TOKEN MANAToken
LAND Registry Contract LAND_REGISTRY LANDRegistry
Estate Registry Contract ESTATE_REGISTRY EstateRegistry
Content Server URL CONTENT_URL contentUrl
Segment API key SEGMENT_KEY segmentKey
Track Analytics data TRACK_STATS trackStats

Copyright info

This repository is protected with a standard Apache 2 license. See the terms and conditions in the LICENSE file.

cli's People

Contributors

abarmat avatar aviaisenberg avatar belohlavek avatar bnolan avatar braianj avatar cazala avatar dependabot-preview[bot] avatar dependabot[bot] avatar doomling avatar eordano avatar fmiras avatar gonpombo8 avatar hprivakos avatar jmoguilevsky avatar kuruk-mm avatar lauti7 avatar leanmendoza avatar m-sossich avatar marcosnc avatar marianogoldman avatar matiasbargas avatar meelrossi avatar menduz avatar michaltakac avatar moliva avatar nachomazzara avatar nchamo avatar nearnshaw avatar nicosantangelo avatar pablitar 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Problem with uglify.js in linker app (Next.js build)

> next build && next export -o dist/linker-app

> Using external babel configuration
> Location: "/Users/michaltakac/Projects/decentraland/cli/.babelrc"
> Using "webpack" config function defined in next.config.js.
> Failed to build on /var/folders/2c/2qvfylfn2yqgcr87n4_drd9r0000gn/T/cf3f556d-4a01-42c5-b3d9-7c54e01ffd44
{ Error: commons.js from UglifyJs
Unexpected token: name (first) [commons.js:47746,6]
    at /Users/michaltakac/Projects/decentraland/cli/node_modules/next/dist/server/build/index.js:183:21
    at emitRecords.err (/Users/michaltakac/Projects/decentraland/cli/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/Users/michaltakac/Projects/decentraland/cli/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Users/michaltakac/Projects/decentraland/cli/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Users/michaltakac/Projects/decentraland/cli/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/michaltakac/Projects/decentraland/cli/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/michaltakac/Projects/decentraland/cli/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/michaltakac/Projects/decentraland/cli/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/michaltakac/Projects/decentraland/cli/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/Users/michaltakac/Projects/decentraland/cli/node_modules/webpack/lib/Compiler.js:354:15)
  errors:
   [ 'commons.js from UglifyJs\nUnexpected token: name (first) [commons.js:47746,6]' ],
  warnings: [] }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] linker:build: `next build && next export -o dist/linker-app`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] linker:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/michaltakac/.npm/_logs/2018-01-16T12_27_16_642Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `npm run clean && tsc && npm run linker:build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/michaltakac/.npm/_logs/2018-01-16T12_27_16_692Z-debug.log

vercel/next.js#1582

Verification for renderer

How do we verify that the parcels in scene.json#scene.parcels belong to the same user that is publishing the parcel?

Pin scenes to decentraland ipfs node

Motivation

As we are developing an own Decentraland IPFS node, we could pin created/updated scenes.

With this, we are not going to be dependent on the local user IPFS node to be up when getting the scene from our apps.

Concept Implementation

I've worked in an experimental branch, only focused on functional things.

We need to:

Endpoint (@Alpha stage)

@GET http://ipfs.decentraland.zone:3000/api/pin/:peerid/:x/:y

Response: { ok: 'true' } or {'ok': false}
  • Needs https
  • We can make it more verbose to handle errors better.

Test

npm start -- init

Fill at least the parcels you own

Pin new scene

npm start -- upload

npm start -- link

Update Scene

Make a change in your scene, then run:

npm start -- upload

To see them reflected you can use:

http://ipfs.decentraland.zone:3000/api/resolve/:ipns?dependencies=true

E.g: http://ipfs.decentraland.zone:3000/api/resolve/QmTZZnwcsUJuQL2EH3oLZBaA6HZvhv8KJ7Qd9QP9LpEjW1?dependencies=true

Thanks @menduz for the early catch.

Validate full use case

  • Test for init
  • Verify integration between scene and client preview.
  • Verify upload to eth
  • Verify upload to IPFS

Run `dcl init` from inside of folder

Don't create new folder under project title we get from prompt by running dcl init, but instead just use current working directory.

It should simplify the code and get rid of all the

if (isDev) {
    projectName = await prompt('(Development-mode) Project name you want to upload: ', projectName);
}

and

`tmp/${projectName}`

"dcl link" command with no need for Metamask

We can make the dcl link command to use a Geth node to do all the validations about ownership of parcels and even sign the transaction to update the parcel and avoid having a web interface for that.

To do this we can use: an Infura node, a Decentraland hosted node, or an Ethereum node hosted by the user.

Error: get-installed-path: module not found "decentraland" in path

Seems like on Windows, the get-installed-path package doesn't work well - it cannot find the path to where the cli is installed (globally):

$ dcl help
C:\Users\Takacovci\AppData\Roaming\nvm\v8.8.1\node_modules\decentraland\node_modules\get-installed-path\dist\index.js:164
    throw new Error(msg);
    ^

Error: get-installed-path: module not found "decentraland" in path C:\Users\Takacovci\AppData\Roaming\npm\node_modules\decentraland
    at getInstalledPathSync (C:\Users\Takacovci\AppData\Roaming\nvm\v8.8.1\node_modules\decentraland\node_modules\get-installed-path\dist\index.js:164:11)
    at Object.<anonymous> (C:\Users\Takacovci\AppData\Roaming\nvm\v8.8.1\node_modules\decentraland\dist\utils\cli-path.js:4:19)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Module.require (module.js:556:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\Takacovci\AppData\Roaming\nvm\v8.8.1\node_modules\decentraland\dist\commands\init.js:15:20)

OS: Windows 10 64bit
Node: v8.8.1
Using Git Bash.

Empty defaults look weird

Running dcl init prompts the user for information. Some of if has a default value shown in parens but some fields don't have a default and look like this:

? Project title:  (DCL app) # <--- WITH DEFAULT

? Your MetaMask address: () <--- WITHOUT

It would be nice if we can remove the (), by removing the default: '' value on inquirer.prompt

Error with Upload

Hi!

I installed 0.2.9 v. and I cant to start dcl upload. in 2.7 it was worked.

there is log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start', 'upload' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/hsbs/Documents/GitHub/cli/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/hsbs/anaconda2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin
9 verbose lifecycle [email protected]start: CWD: /Users/hsbs/Documents/GitHub/cli
10 silly lifecycle [email protected]
start: Args: [ '-c', './dev.js "upload"' ]
11 silly lifecycle [email protected]start: Returned: code: 1 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: ./dev.js "upload"
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/hsbs/Documents/GitHub/cli
16 verbose Darwin 17.4.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "upload"
18 verbose node v8.9.4
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: ./dev.js "upload"
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

MacBook-Pro-2:cli hsbs$ npm start upload

[email protected] start /Users/hsbs/Documents/GitHub/cli
./dev.js "upload"

You're now in development mode.
Could not find .decentraland/project.json
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: ./dev.js "upload"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hsbs/.npm/_logs/2018-02-02T06_47_27_120Z-debug.log
MacBook-Pro-2:cli hsbs$

Error when running `dcl init`

I'm getting the following error when running dcl init after installing the cli globally using sudo npm install -g decentraland:

/usr/local/lib/node_modules/decentraland/dist/index.js:18
    init(options = {}) {
                 ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/decentraland/bin/dcl:5:11)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

Pretty sure the above syntax isn't allowed in ES6. What specific node version does the cli require?

I'm running Windows 10 64-bit and have the cli installed inside the bash subsystem.

Land data is not updated after doing `land.updateManyLandData`

So I deployed a parcel in ropsten (200, 200), I transfered it to my metamask address, and I authorized myself as an operator (which should allow me to update that parcels data using updateManyLandData according to the LANDRegistry contract).

I created a new project dcl init and I pushed it dcl push. It uploaded it to IPFS, it updated IPNS and then I was prompted to link the project to ethereum. I sent the transaction, sending the right x and y and the IPNS hash as the data (I console.log'd it to verify), it did go thru successfully (here) so finally I went to truffle, connected to ropsten and did a landData of my parcel, and it return "" :(

So from the CLI it looks like everything is working, but then I can't retrieve the IPNS hash using the contract... idk if it's an issue with updateManyLandData when writing or with landData when reading.

Any ideas?

Cannot load obj file: Uncaught SyntaxError: Unexpected token {

With this sample scene:

    <a-scene>
      <a-obj-model src="./models/tree.obj" color='#00ffaa' scale='4 4 4' />
    </a-scene>

It seems to me some kind of typo in this blob script

/**
  * This code was constructed by OBJLoader2 buildCode.
  */

Validator = {
	isValid: function (t){return null!==t&&void 0!==t},
	verifyInput: function (t,e){return null===t||void 0===t?e:t},
}

ConsoleLogger = (funcConsoleLoggerion () {

	function t(t,e){this.enabled=!1!==t,this.debug=!0===e}

but since it is autogenerated, i believe that some text replacement is not working well: look at funcConsoleLoggerion ... i would say that the t of function has been replaced by ConsoleLogger

Release tasks from first release test

Release tasks to fix from latest test:

  • Add Protocol to metadata (ipns, ipfs)
  • In the frontend the tx URL points to Ropsten instead of Mainnet
  • Contract address is wrong (using the Registry)
  • No warning that the IPFS daemon is down

Cannot install cli

Hi,
I am running "sudo npm install -g decentraland" on ubuntu 16.04 Here is what I got from the output of terminal

npm WARN deprecated [email protected]: Check out CommitLint which provides the same functionality with a more user-focused experience.
npm WARN deprecated [email protected]: ๐Ÿ™Œ  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone -q https://github.com/decentraland/eth-sig-util.git /home/reggie/.npm/_cacache/tmp/git-clone-52ea3433
npm ERR! /home/reggie/.npm/_cacache/tmp/git-clone-52ea3433/.git: Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/reggie/.npm/_logs/2018-02-22T22_58_30_211Z-debug.log

Deprecated dependencies

Remove the following warnings:

  • validate-commit-msg: Use CommitLint
  • semantic-release: Use semantic-release/npm
  • babel-preset-es2015: A dependency is using this outdated package (preset env has an up-to-date ecmascript version).
  • github: Use octokit/rest

Add protocol to IPFS/IPNS hash

When storing the metadata format in the LANDRegistry, add the protocol in front of the IPFS hash for the client to know what type of gateway to use.

Example:
0,,,ipns:QmVP3WAkJRcc9AkS83r5fwaWAxpgtP7cpDupVWRos9qStY
0,,,ipfs:QmVP3WAkJRcc9AkS83r5fwaWAxpgtP7cpDupVWRos9qStY

Try to upload and link scene

have that problem:

MacBook-Pro-2:cli hsbs$ npm start upload

[email protected] start /Users/hsbs/Documents/GitHub/cli
./dev.js "upload"

You're now in development mode.
Generating IPFS key...
connect ECONNREFUSED 127.0.0.1:5001
MacBook-Pro-2:cli hsbs$ npm start push

[email protected] start /Users/hsbs/Documents/GitHub/cli
./dev.js "push"

You're now in development mode.
Generating IPFS key...
(node:46288) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: connect ECONNREFUSED 127.0.0.1:5001
(node:46288) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Fix `dcl serve` in dev mode

Now that projects have docker names the command dcl serve fails because it was hardcoded to ./tmp/dcl-app

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.