Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(preview) Fix: enforce style rules #100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
3 changes: 3 additions & 0 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
- name: Run jshint
run: npm run jshint

- name: Run fmt
run: npm run fmt

- name: Run tests
run: npm run test

Expand Down
25 changes: 10 additions & 15 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,30 @@
"esnext": true,
"freeze": true,
"immed": true,
"indent": 2,
"latedef": true,
"laxbreak": true,
"newcap": false,
"noarg": true,
"node": true,
"noempty": true,
"nonew": true,
"quotmark": "single",
"regexp": true,
"smarttabs": false,
"strict": true,
"trailing": true,
"undef": true,
"unused": true,
"maxparams": 5,
"maxstatements": 17,
"maxcomplexity": 10,
"maxdepth": 3,
"maxlen": 120,
"multistr": true,
"predef": [
"after",
"afterEach",
"before",
"beforeEach",
"describe",
"exports",
"it",
"module",
"require"
"after",
"afterEach",
"before",
"beforeEach",
"describe",
"exports",
"it",
"module",
"require"
]
}
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"printWidth": 120
}
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Dashcore Node
============
# Dashcore Node

A Dash full node for building applications and services with Node.js. A node is extensible and can be configured to run additional services. At the minimum a node has an interface to [Dash Core (dashd) v0.13.0](https://github.com/dashpay/dash/tree/v0.13.0.x) for more advanced address queries. Additional services can be enabled to make a node more useful such as exposing new APIs, running a block explorer and wallet service.

Expand All @@ -23,6 +22,7 @@ Some plugins are available :
- Insight-UI : `./bin/dashcore-node addservice @dashevo/insight-ui`

You also might want to add these index to your dash.conf file :

```
-addressindex
-timestampindex
Expand All @@ -36,25 +36,25 @@ npm install @dashevo/dashcore-node
```

```javascript
const dashcore = require('@dashevo/dashcore-node');
const config = require('./dashcore-node.json');
const dashcore = require("@dashevo/dashcore-node");
const config = require("./dashcore-node.json");

let node = dashcore.scaffold.start({ path: "", config: config });
node.on('ready', function () {
console.log("Dash core started");
node.services.dashd.on('tx', function(txData) {
let tx = new dashcore.lib.Transaction(txData);
console.log(tx);
});
node.on("ready", function () {
console.log("Dash core started");

node.services.dashd.on("tx", function (txData) {
let tx = new dashcore.lib.Transaction(txData);
console.log(tx);
});
});
```

## Prerequisites

- Dash Core (dashd) (v0.13.0) with support for additional indexing *(see above)*
- Dash Core (dashd) (v0.13.0) with support for additional indexing _(see above)_
- Node.js v8+
- ZeroMQ *(libzmq3-dev for Ubuntu/Debian or zeromq on OSX)*
- ZeroMQ _(libzmq3-dev for Ubuntu/Debian or zeromq on OSX)_
- ~50GB of disk storage
- ~1GB of RAM

Expand Down Expand Up @@ -95,7 +95,6 @@ There are several add-on services available to extend the functionality of Bitco
- [Bus](docs/bus.md) - Overview of the event bus constructor
- [Release Process](docs/release.md) - Information about verifying a release and the release process.


## Setting up dev environment (with Insight)

Prerequisite : Having a dashd node already runing `dashd --daemon`.
Expand All @@ -105,13 +104,15 @@ Insight-api (optional) : `git clone https://github.com/dashevo/insight-api -b de
Insight-UI (optional) : `git clone https://github.com/dashevo/insight-ui -b develop`

Install them :

```
cd dashcore-node && npm install \
&& cd ../insight-ui && npm install \
&& cd ../insight-api && npm install && cd ..
```

Symbolic linking in parent folder :

```
npm link ../insight-api
npm link ../insight-ui
Expand Down
Loading