Skip to content

Commit

Permalink
feat: multisig-server initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
air1one committed Aug 6, 2019
0 parents commit 6bd7e3e
Show file tree
Hide file tree
Showing 54 changed files with 9,406 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: 2
jobs:
node-10:
docker:
- image: circleci/node:10
working_directory: ~/multisig-server
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
- run: yarn test
- run: ./node_modules/.bin/codecov
node-11:
docker:
- image: circleci/node:11
working_directory: ~/multisig-server
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
- run: yarn test
- run: ./node_modules/.bin/codecov
node-12:
docker:
- image: circleci/node:12
working_directory: ~/multisig-server
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
- run: yarn test
- run: ./node_modules/.bin/codecov
workflows:
version: 2
build_and_test:
jobs:
- node-10
- node-11
- node-12
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
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/README.md export-ignore
1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_extends: .github
80 changes: 80 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Logs
logs
*.log
npm-debug.log*
lerna-debug.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
.coverage

# nyc test coverage
.nyc_output

# vscode
.vscode

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Build results
app.js

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Generated doc directory
doc
docs

# Optional npm cache directory
.npm
package-lock.json

# Mac OS X local settings
.DS_Store
.tags
bundle.min.js

# Build
dist
packages/**/dist/

# Microsoft Visual Studio settings
.vs

# Databases
*.sqlite

# Random
docker/development

#Webstorm/Intellij
.idea

# Vagrant
.vagrant

# oclif
tmp
oclif.manifest.json
npm-shrinkwrap.json

# Transaction Pool
transaction-pool.sqlite
transaction-pool.sqlite-shm
transaction-pool.sqlite-wal
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.ts": ["yarn lint", "prettier --write", "git add"],
"*.{json,md}": ["prettier --write", "git add"]
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.coverage
dist
docs
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 120,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": false
}
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
child-concurrency 1
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @faustbrian @supaiku0
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) ARK Ecosystem <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
132 changes: 132 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# @arkecosystem/multisig-server

<p align="center">
<img src="https://raw.githubusercontent.com/ARKEcosystem/multisig-server/master/banner.png" />
</p>

[![Latest Version](https://badgen.now.sh/npm/v/@arkecosystem/multisig-server)](https://www.npmjs.com/package/@arkecosystem/multisig-server)
[![Node Engine](https://badgen.now.sh/npm/node/@arkecosystem/multisig-server)](https://www.npmjs.com/package/@arkecosystem/multisig-server)
[![Build Status](https://badgen.now.sh/circleci/github/ArkEcosystem/multisig-server)](https://circleci.com/gh/ArkEcosystem/multisig-server)
[![Codecov](https://badgen.now.sh/codecov/c/github/ArkEcosystem/multisig-server)](https://codecov.io/gh/ArkEcosystem/multisig-server)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn global add @arkecosystem/multisig-server-cli
```

## Usage

> All commands support a `-h` flag to show help for the specified command.
```sh
$ multisig-server
A server for helping building multi-signatures transactions.

VERSION
@arkecosystem/multisig-server-cli/1.0.0 linux-x64 node-v11.15.0

USAGE
$ multisig-server [COMMAND]

COMMANDS
autocomplete display autocomplete installation instructions
command
commands list all the commands
help display help for multisig-server
log Show the log
restart Restart the MultiSignature server
run Run the MultiSignature server (without pm2)
start Start the MultiSignature server
status Show the MultiSignature server status
stop Stop the MultiSignature server
update Update the MultiSignature server installation
```

### `start`

> Start the MultiSignature server
```sh
multisig-server start
```

| Flag | Description | Default | Required |
| ------------------ | ---------------------------------------------------------------------------- | -------------------------- | -------- |
| --host= | the host that should be used to expose the RPC | 0.0.0.0 | No |
| --port= | the port that should be used to expose the RPC | 8008 | No |

### `restart`

> Restart the MultiSignature server
```sh
multisig-server restart
```

### `stop`

> Stop the MultiSignature server
```sh
multisig-server stop
```

| Flag | Description | Default | Required |
| ------ | -------------------------- | ------- | -------- |
| --kill | kill the process or daemon | n/a | No |

### `run`

> Run the MultiSignature server without pm2 **(exits on CTRL+C)**
```sh
multisig-server run
```

| Flag | Description | Default | Required |
| ------------------ | ---------------------------------------------------------------------------- | -------------------------- | -------- | |
| --host= | the host that should be used to expose the RPC | 0.0.0.0 | No |
| --port= | the port that should be used to expose the RPC | 8008 | No |

### `status`

> Show the MultiSignature server status
```sh
multisig-server status
```

### `update`

> Update the MultiSignature server installation
```sh
multisig-server update
```

### `log`

> Show the log
```sh
multisig-server log
```

| Flag | Description | Default | Required |
| -------- | ----------------------- | ------- | -------- |
| --error= | only show error output | n/a | No |
| --lines= | number of lines to tail | 15 | No |

## Security

If you discover a security vulnerability within this package, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.

## Credits

This project exists thanks to all the people who [contribute](../../contributors).

## License

[MIT](LICENSE) © [ARK Ecosystem](https://ark.io)
14 changes: 14 additions & 0 deletions __tests__/__support__/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Server } from "@hapi/hapi";
import { startServer } from "../../packages/server/src/server";

jest.setTimeout(10000);

export const launchServer = async (): Promise<Server> => {
return startServer({
host: "0.0.0.0",
port: 8080,
allowRemote: false,
whitelist: ["127.0.0.1", "::ffff:127.0.0.1"] as any,
network: "devnet",
});
};
Loading

0 comments on commit 6bd7e3e

Please sign in to comment.