Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electra-cli

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electra-cli - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

src/helpers/download.js

10

bin/electra-start.js

@@ -5,2 +5,10 @@ #!/usr/bin/env node

require('../src/start')()
commander
.option('-r, --rebuild', `Let the wallet.dat as is but remove all the other Electra user
directory files before starting the daemon.
`)
.parse(process.argv)
require('../src/start')({
rebuild: Boolean(commander.rebuild),
})

@@ -0,0 +0,0 @@ #!/usr/bin/env node

19

package.json
{
"name": "electra-cli",
"version": "1.2.0",
"version": "1.3.0",
"description": "CLI tools for Electra daemon and blockchain.",
"license": "MIT",
"main": "./bin/electra.js",

@@ -11,2 +12,3 @@ "bin": {

"scripts": {
"start": "node src/serve",
"test": "echo \"Error: no test specified\" && exit 1"

@@ -16,5 +18,13 @@ },

"@inspired-beings/log": "^1.2.0",
"axios": "^0.18.0",
"chalk": "^2.4.1",
"commander": "^2.15.1",
"electra-js": "0.15.0",
"moment": "^2.22.2"
"electra-js": "0.16.1",
"extract-zip": "^1.6.7",
"moment": "^2.22.2",
"numeral": "^2.0.6",
"progress": "^2.0.0",
"request": "^2.87.0",
"request-progress": "^3.0.0",
"rimraf": "^2.6.2"
},

@@ -33,2 +43,3 @@ "author": {

],
"keywords": [],
"repository": {

@@ -38,4 +49,2 @@ "type": "git",

},
"keywords": [],
"license": "MIT",
"bugs": {

@@ -42,0 +51,0 @@ "url": "https://github.com/Electra-project/electra-cli/issues"

@@ -1,2 +0,2 @@

# electra-cli
# Electra CLI

@@ -11,16 +11,59 @@ NodeJS CLI tools for Electra daemon and blockchain.

[![NSP Status](https://nodesecurity.io/orgs/electra-project/projects/60adf17a-da9b-467c-96ef-84ae7e4280b6/badge)](https://nodesecurity.io/orgs/electra-project/projects/60adf17a-da9b-467c-96ef-84ae7e4280b6)
[![Known Vulnerabilities](https://snyk.io/test/github/Electra-project/electra-cli/badge.svg)](https://snyk.io/test/github/Electra-project/electra-cli)
## Installation
**Prerequisites**
### Local
The local installation is useful if you want to use Electra CLI tools.
**Prerequisites:**
- [Node v8+ (with npm)](https://nodejs.org)
Then:
```bash
npm i -g electra-cli
```
npm i -g electra-cli
### Remote
The remote installation is useful if you want to run a Server Node to help the network and eventually publish it as a bootstrap node for new Electra wallet users.
#### Deploy a Server Node
**Prerequisites:**
- APT-based OS (Debian, Ubuntu, etc).
- Full root access.
```bash
cd ~
sudo apt-get update
sudo apt-get install git -y
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# or: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
source ~/.bashrc
nvm install 10
git clone https://github.com/Electra-project/electra-cli.git
cd electra-cli
npm i
npm start
```
> **Note**<br>
> You may need to bind your internal IP port (5817) to your external IP one (same port) via your host online management website (Azure, AWS, etc).
#### Update a Server Node
```bash
cd ~/electra-cli
git pull
npm i
npm start
```
## Usage
The usage part only concerns local installtions as a tool belt.
electra <command>
Just type `electra` to show the manual and list the available commands.

@@ -1,3 +0,1 @@

#!/usr/bin/env node
const ElectraJs = require('electra-js')

@@ -9,3 +7,6 @@ const fs = require('fs')

const path = require('path')
const rimraf = require('rimraf')
const onSigint = require('./helpers/onSigint')
const LOG_LENGTH = 20

@@ -22,3 +23,3 @@ const VERSION = require(path.resolve(__dirname, '..', `package.json`)).version

.split(os.EOL)
.filter(line => !line.startsWith('ThreadRPCServer'))
.filter(line => !line.startsWith('ThreadRPCServer') && line.trim().length !== 0)

@@ -43,4 +44,15 @@ log.clear()

module.exports = async function () {
process.on('SIGINT', async () => {
module.exports = async function (options) {
if (options.rebuild) {
log.info('Removing all Electra user directory files BUT keeping the "wallet.dat" file...')
try {
rimraf.sync(path.resolve(electraJs.constants.DAEMON_USER_DIR_PATH, '!(wallet.dat)'))
}
catch {
log.err(`Error: ${err}`)
}
}
onSigint(async () => {
if (timerId !== undefined) clearTimeout(timerId)

@@ -51,3 +63,3 @@ log.clear()

log.info('Electra daemon stopped.')
process.exit();
process.exit()
})

@@ -54,0 +66,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc