Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
valzav committed Jun 8, 2015
0 parents commit f08ebde
Show file tree
Hide file tree
Showing 186 changed files with 24,952 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// see http://eslint.org/docs/rules/
{
"parser": "babel-eslint",
"plugins": [
"react"
],
"env": {
"browser": true,
"node": true,
"es6": true
},
"globals": {
"__DEV__": true,
"__SERVER__": true,
"jest": true,
"it": true,
"describe": true,
"expect": true,
"beforeEach": true
},
"ecmaFeatures": {
"jsx": true
},
"rules": {
// Strict mode
"strict": [2, "never"],
// Code style
"no-underscore-dangle": [0],
"indent": [4, 4],
"camelcase": [0],
"new-cap": [0],
"no-trailing-spaces": [0]
}
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
.idea
*/node_modules
*/npm-debug.log
cli/bundle.js*
*.map
*.log
cli/examples.txt
15 changes: 15 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Copyright (c) 2015, Cryptonomex, Inc.
All rights reserved.

This source code is provided for evaluation in private test networks only, until September 8, 2015. After this date, this license expires and
the code may not be used, modified or distributed for any purpose. Redistribution and use in source and binary forms, with or without modification,
are permitted until September 8, 2015, provided that the following conditions are met:

1. The code and/or derivative works are used only for private test networks consisting of no more than 10 P2P nodes.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Graphene GUI
============

## Install

```
cd cli; npm install
cd ../dl; npm install
cd ../ios; npm install
cd ../web; npm install
```

## Run it

Go to cli or web dir and run:

```
npm start
```

## Testing
Jest currently doesn't work with node (see https://github.com/facebook/jest/issues/243), so in order to run the tests you need to install iojs. Under Ubuntu instructions can be found here:

[Nodesource Ubuntu io.js installation](https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories "Nodesource iojs")

In order for jest to correctly follow paths it is necessary to add a local path to your NODE_PATH variable. Under Ubuntu, you can do so by running the following from the web directory:

```
export NODE_PATH=$NODE_PATH:.
```

Tests are then run using

```
npm test
```


33 changes: 33 additions & 0 deletions cli/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
var repl = require("repl");
var repl_history = require("repl.history");
var promisify = require("repl-promised").promisify;

var Apis = require('../dl/src/rpc_api/ApiInstances');
var ApplicationApi = require('../dl/src/rpc_api/ApplicationApi');
var WalletApi = require('../dl/src/rpc_api/WalletApi');

Apis.instance().init_promise.then(() => {
var repl_instance = repl.start({
prompt: "Graphene > ",
input: process.stdin,
output: process.stdout,
ignoreUndefined: true
});
promisify(repl_instance);
repl_instance.on("exit", function () {
Apis.instance().close();
});
var database_api = Apis.instance().db_api();
var network_api = Apis.instance().network_api();
repl_instance.context.$g = {}
repl_instance.context.$g.db = database_api;
repl_instance.context.$g.net = network_api;
repl_instance.context.$g.app = new ApplicationApi();
repl_instance.context.$g.wallet = new WalletApi();
var hist_file = process.env.HOME + "/.graphene_history";
repl_history(repl_instance, hist_file);
}).catch(error => {
console.log("[App.js] ----- ERROR ----->", error, error.stack);
this.setState({loading: false});
});

35 changes: 35 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "cli",
"description": "cli powered by graphene",
"homepage": "https://github.com/cryptonomex/graphene_ui",
"author": "Cryptonomex, Inc.",
"license" : "LicenseRef-LICENSE",
"version": "0.0.1",
"description": "graphene cli",
"engines": {
"node": "0.12.2",
"npm": "2.8.3"
},
"repository": {
"type": "git",
"url": "git://github.com/....git"
},
"scripts": {
"postinstall": "",
"test": "",
"start": "webpack; node ./bundle.js"
},
"dependencies": {
"babel-core": "~5.1.11",
"babel-loader": "~5.0.0",
"coffee-loader": "^0.7.2",
"json-loader": "^0.5.1",
"repl": "^0.1.3",
"repl-promised": "^0.1.0",
"repl.history": "^0.1.3",
"webpack": "~1.8.7"
},
"devDependencies": {
"source-map-support": "^0.2.10"
}
}
34 changes: 34 additions & 0 deletions cli/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var path = require("path");
var webpack = require("webpack");

var config = {
entry: path.resolve(__dirname, "app.js"),
target: "node",
output: {
path: path.resolve(__dirname),
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel"},
{ test: /\.json/, loader: "json" },
{ test: /\.coffee$/, loader: "coffee" }
]
},
resolve: {
root: [path.resolve(__dirname, "./"), path.resolve(__dirname, "../dl/src")],
extensions: ["", ".js", ".jsx", ".json", ".coffee"],
modulesDirectories: ["node_modules"],
fallback: [path.resolve(__dirname, "./node_modules")]
},
resolveLoader: {
fallback: [path.resolve(__dirname, "./node_modules")]
},
plugins: [
new webpack.IgnorePlugin(/\.(css|less)$/),
new webpack.BannerPlugin("require('source-map-support').install();", { raw: true, entryOnly: false })
],
devtool: "sourcemap"
};

module.exports = config;
Loading

0 comments on commit f08ebde

Please sign in to comment.