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

[Security Issue] Adjust pubKeyHash b/c it overlaps with an Ark chain #1

Open
wants to merge 29 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions -home-dev-phantom-node-.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/dev/phantom-node/networks.json
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at info@ark.io. All
reported by contacting the project team at info@phantom.org. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ _Put an `x` in the boxes that apply and remove the rest of them: keep this PR as
_Put an `x` in the boxes that apply and remove this text and the rest of them. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
-->

- [ ] I have read the [CONTRIBUTING](https://docs.ark.io/developers/guidelines/contributing.html) documentation
- [ ] I have read the [CONTRIBUTING](https://docs.phantom.org/developers/guidelines/contributing.html) documentation
- [ ] Lint and unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- redis-server

env:
ARK_CI_TEST: true
PHANTOM_CI_TEST: true

before_install:
# - npm install yarn
Expand All @@ -35,7 +35,7 @@ before_script:
- 'if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DISPLAY=:99.0; fi'
- 'if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start; sleep 3; fi'
# To avoid a problem when starting the Redis service
- sudo redis-server /etc/redis/redis.conf --port 6379
- sudo redis-server /etc/redis/redis.conf --port 5432

script:
- yarn test:coverage --ci
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) Ark Ecosystem <info@ark.io>
Copyright (c) Phantom <info@phnatom.org>
Copyright (c) Ark Ecosystem <info@ark.io> \n Copyright (c) Phantom <info@phantom.org>

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
Expand Down
82 changes: 38 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,61 @@
![ARK Core](https://i.imgur.com/1aP6F2o.png)

# ARK Core

# PHANTOM Core

## Introduction

This repository contains all plugins that make up the ARK Core.
This repository contains all plugins that make up the PHANTOM Core.

## Documentation

- Development : https://docs.ark.io/core/development.html
- Docker : https://docs.ark.io/core/docker.html
- Development : Coming Soon
- Docker : Coming Soon

## API Documentation

- API v1 : https://docs.ark.io/developers/api/public/v1/
- API v2 : https://docs.ark.io/developers/api/public/v2/
- API v1 : Coming Soon
- API v2 : Coming Soon

## GitHub Development Bounty

- Get involved with ARK development and earn ARK coins : https://bounty.ark.io

## Core Packages

[![Build Status](https://travis-ci.org/ArkEcosystem/core.svg?branch=master)](https://travis-ci.org/ArkEcosystem/core)

| Package | Version | Description
|---|---|---|
| **[core](/packages/core)** | [![npm](https://img.shields.io/npm/v/@arkecosystem/core.svg)](https://www.npmjs.com/package/@arkecosystem/core) | **Includes all packages** |
| [client](/packages/client) | [![npm](https://img.shields.io/npm/v/@arkecosystem/client.svg)](https://www.npmjs.com/package/@arkecosystem/client) | A JavaScript library to interact with the ARK Blockchain |
| [core-api](/packages/core-api) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-api.svg)](https://www.npmjs.com/package/@arkecosystem/core-api) | Public API |
| [core-blockchain](/packages/core-blockchain) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-blockchain.svg)](https://www.npmjs.com/package/@arkecosystem/core-blockchain) | Blockchain Management |
| [core-config](/packages/core-config) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-config.svg)](https://www.npmjs.com/package/@arkecosystem/core-config) | Configuration Loader |
| [core-container](/packages/core-container) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-container.svg)](https://www.npmjs.com/package/@arkecosystem/core-container) | Container Management |
| [core-database](/packages/core-database) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-database.svg)](https://www.npmjs.com/package/@arkecosystem/core-database) | Database Interface |
| [core-database-sequelize](/packages/core-database-sequelize) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-database-sequelize.svg)](https://www.npmjs.com/package/@arkecosystem/core-database-sequelize) | Sequelize Database Provider |
| [core-deployer](/packages/core-deployer) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-deployer.svg)](https://www.npmjs.com/package/@arkecosystem/core-deployer) | Deployer CLI |
| [core-event-emitter](/packages/core-event-emitter) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-event-emitter.svg)](https://www.npmjs.com/package/@arkecosystem/core-event-emitter) | Event Manager |
| [core-forger](/packages/core-forger) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-forger.svg)](https://www.npmjs.com/package/@arkecosystem/core-forger) | Forger Manager |
| [core-graphql](/packages/core-graphql) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-graphql.svg)](https://www.npmjs.com/package/@arkecosystem/core-graphql) | GraphQL Provider |
| [core-json-rpc](/packages/core-json-rpc) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-json-rpc.svg)](https://www.npmjs.com/package/@arkecosystem/core-json-rpc) | JSON-RPC Server |
| [core-logger](/packages/core-logger) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-logger.svg)](https://www.npmjs.com/package/@arkecosystem/core-logger) | Logger Manager |
| [core-logger-winston](/packages/core-logger-winston) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-logger-winston.svg)](https://www.npmjs.com/package/@arkecosystem/core-logger-winston) | Winston Logger Provider |
| [core-p2p](/packages/core-p2p) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-p2p.svg)](https://www.npmjs.com/package/@arkecosystem/core-p2p) | P2P API |
| [test-utils](/packages/core-test-utils) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-test-utils.svg)](https://www.npmjs.com/package/@arkecosystem/core-test-utils) | Test Utilities |
| [tester-cli](/packages/core-tester-cli) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-tester-cli.svg)](https://www.npmjs.com/package/@arkecosystem/core-tester-cli) | Tester CLI |
| [core-transaction-pool](/packages/core-transaction-pool) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-transaction-pool.svg)](https://www.npmjs.com/package/@arkecosystem/core-transaction-pool) | Transaction Pool Interface |
| [core-transaction-pool-redis](/packages/core-transaction-pool-redis) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-transaction-pool-redis.svg)](https://www.npmjs.com/package/@arkecosystem/core-transaction-pool-redis) | Transaction Pool - Redis Implementation |
| [core-webhooks](/packages/core-webhooks) | [![npm](https://img.shields.io/npm/v/@arkecosystem/core-webhooks.svg)](https://www.npmjs.com/package/@arkecosystem/core-webhooks) | Webhooks Manager |
| [crypto](/packages/crypto) | [![npm](https://img.shields.io/npm/v/@arkecosystem/crypto.svg)](https://www.npmjs.com/package/@arkecosystem/crypto) | Crypto Utilities |
| [validation](/packages/validation) | [![npm](https://img.shields.io/npm/v/@arkecosystem/validation.svg)](https://www.npmjs.com/package/@arkecosystem/validation) | Validation Manager |
[![Build Status](https://travis-ci.org/PhantomCore/core.svg?branch=master)](https://travis-ci.org/PhantomCore/core)

| Package | Description
|---|---|
| **[core](/packages/core)** | **Includes all packages** |
| [client](/packages/client) | A JavaScript library to interact with the ARK Blockchain |
| [core-api](/packages/core-api) | Public API |
| [core-blockchain](/packages/core-blockchain) | Blockchain Management |
| [core-config](/packages/core-config) | Configuration Loader |
| [core-container](/packages/core-container) | Container Management |
| [core-database](/packages/core-database) | Database Interface |
| [core-database-sequelize](/packages/core-database-sequelize) | Sequelize Database Provider |
| [core-deployer](/packages/core-deployer) | Deployer CLI |
| [core-event-emitter](/packages/core-event-emitter) | Event Manager |
| [core-forger](/packages/core-forger) | Forger Manager |
| [core-graphql](/packages/core-graphql) | GraphQL Provider |
| [core-json-rpc](/packages/core-json-rpc) | JSON-RPC Server |
| [core-logger](/packages/core-logger) | Logger Manager |
| [core-logger-winston](/packages/core-logger-winston) | Winston Logger Provider |
| [core-p2p](/packages/core-p2p) | P2P API |
| [test-utils](/packages/core-test-utils) | Test Utilities |
| [tester-cli](/packages/core-tester-cli) | Tester CLI |
| [core-transaction-pool](/packages/core-transaction-pool) | Transaction Pool Interface |
| [core-transaction-pool-redis](/packages/core-transaction-pool-redis) | Transaction Pool - Redis Implementation |
| [core-webhooks](/packages/core-webhooks) | Webhooks Manager |
| [crypto](/packages/crypto) | Crypto Utilities |
| [validation](/packages/validation) | Validation Manager |

## Security

If you discover a security vulnerability within this package, please send an e-mail to security@ark.io. All security vulnerabilities will be promptly addressed.

## Credits
If you discover a security vulnerability within this package, please send an e-mail to security@phantom.org. All security vulnerabilities will be promptly addressed.

- [François-Xavier Thoorens](https://github.com/fix)
- [Kristjan Košič](https://github.com/kristjank)
- [Brian Faust](https://github.com/faustbrian)
- [Alex Barnsley](https://github.com/alexbarnsley)
- [All Contributors](../../contributors)

## License
[MIT](LICENSE) © [PHANTOM](https://phantom.org)

&

[MIT](LICENSE) © [ArkEcosystem](https://ark.io)
2 changes: 1 addition & 1 deletion docker/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) Ark Ecosystem <info@ark.io>
Copyright (c) Ark Ecosystem <info@ark.io> \n Copyright (c) Phantom <info@phantom.org>

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
Expand Down
10 changes: 5 additions & 5 deletions docker/development/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ services:

redis:
image: "redis:alpine"
container_name: ark-development-redis
container_name: phantom-development-redis
ports:
- '127.0.0.1:6379:6379'
volumes:
- 'redis:/data'

postgres:
image: "postgres:alpine"
container_name: ark-development-postgres
container_name: phantom-development-postgres
ports:
- '127.0.0.1:5432:5432'
volumes:
- 'postgres:/var/lib/postgresql/data'
environment:
POSTGRES_PASSWORD: ark_development_not_random_password
POSTGRES_DB: ark_development
POSTGRES_USER: ark_development
POSTGRES_PASSWORD: phantom_development_not_random_password
POSTGRES_DB: phantom_development
POSTGRES_USER: phantom_development

volumes:
redis:
Expand Down
2 changes: 1 addition & 1 deletion docker/devnet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:9

WORKDIR /ark-core
WORKDIR /phantom-core

COPY entrypoint.sh /

Expand Down
18 changes: 9 additions & 9 deletions docker/devnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ services:

redis:
image: "redis:alpine"
container_name: ark-redis
container_name: phantom-redis
ports:
- '127.0.0.1:6379:6379'
volumes:
- 'redis:/data'

postgres:
image: "postgres:alpine"
container_name: ark-postgres
container_name: phantom-postgres
ports:
- '127.0.0.1:5432:5432'
volumes:
- 'postgres:/var/lib/postgresql/data'
environment:
POSTGRES_PASSWORD: password
POSTGRES_DB: ark_devnet
POSTGRES_USER: ark
POSTGRES_DB: phantom_devnet
POSTGRES_USER: phantom

ark-core:
phantom-core:
build: .
image: ark-core
container_name: ark-core
image: phantom-core
container_name: phantom-core
ports:
- "4002:4002"
- "4003:4003"
volumes:
- ark-core:/ark-core
- phantom-core:/phantom-core
tty: true
privileged: true
links:
Expand All @@ -47,7 +47,7 @@ services:
volumes:
redis:
postgres:
ark-core:
phantom-core:
driver_opts:
type: none
device: $PWD/../../
Expand Down
8 changes: 4 additions & 4 deletions docker/devnet/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

sysctl -w net.ipv4.conf.all.route_localnet=1

POSTGRES=$(ping -c 1 ark-postgres | awk -F'[()]' '/PING/{print $2}')
REDIS=$(ping -c 1 ark-redis | awk -F'[()]' '/PING/{print $2}')
CORE=$(ping -c 1 ark-core | awk -F'[()]' '/PING/{print $2}')
POSTGRES=$(ping -c 1 phantom-postgres | awk -F'[()]' '/PING/{print $2}')
REDIS=$(ping -c 1 phantom-redis | awk -F'[()]' '/PING/{print $2}')
CORE=$(ping -c 1 phantom-core | awk -F'[()]' '/PING/{print $2}')

iptables -I OUTPUT -t nat -o lo -d localhost -p tcp --dport 5432 -j DNAT --to-destination ${POSTGRES}:5432
iptables -I POSTROUTING -t nat -p tcp --dport 5432 -d ${POSTGRES} -j SNAT --to ${CORE}
iptables -I OUTPUT -t nat -o lo -d localhost -p tcp --dport 6379 -j DNAT --to-destination ${REDIS}:6379
iptables -I POSTROUTING -t nat -p tcp --dport 6379 -d ${REDIS} -j SNAT --to ${CORE}

cd /ark-core
cd /phantom-core
rm -rf node_modules package-lock.json > /dev/null 2>&1
rm -rf packages/core/node_modules packages/core/package-lock.json 2>&1
npm --quiet install lerna -g && npm --quiet install -g nodemon
Expand Down
2 changes: 1 addition & 1 deletion docker/devnet/restore.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DOCKER_DB_NAME="$(docker-compose ps -q postgres)"
DB_HOSTNAME=postgres
DB_USER=ark
DB_USER=phantom
LOCAL_DUMP_PATH="snapshot.dump"

docker-compose up -d postgres
Expand Down
2 changes: 1 addition & 1 deletion docker/testnet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:9

WORKDIR /ark-core
WORKDIR /phantom-core

COPY entrypoint.sh /

Expand Down
18 changes: 9 additions & 9 deletions docker/testnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ services:

redis:
image: "redis:alpine"
container_name: ark-redis
container_name: phantom-redis
ports:
- '127.0.0.1:6379:6379'
volumes:
- 'redis:/data'

postgres:
image: "postgres:alpine"
container_name: ark-postgres
container_name: phantom-postgres
ports:
- '127.0.0.1:5432:5432'
volumes:
- 'postgres:/var/lib/postgresql/data'
environment:
POSTGRES_PASSWORD: password
POSTGRES_DB: ark_testnet
POSTGRES_USER: ark
POSTGRES_DB: phantom_testnet
POSTGRES_USER: phantom

ark-core:
phantom-core:
build: .
image: ark-core
container_name: ark-core
image: phantom-core
container_name: phantom-core
ports:
- "4000:4000"
- "4003:4003"
volumes:
- ark-core:/ark-core
- phantom-core:/phantom-core
tty: true
privileged: true
links:
Expand All @@ -47,7 +47,7 @@ services:
volumes:
redis:
postgres:
ark-core:
phantom-core:
driver_opts:
type: none
device: $PWD/../../
Expand Down
8 changes: 4 additions & 4 deletions docker/testnet/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

sysctl -w net.ipv4.conf.all.route_localnet=1

POSTGRES=$(ping -c 1 ark-postgres | awk -F'[()]' '/PING/{print $2}')
REDIS=$(ping -c 1 ark-redis | awk -F'[()]' '/PING/{print $2}')
CORE=$(ping -c 1 ark-core | awk -F'[()]' '/PING/{print $2}')
POSTGRES=$(ping -c 1 phantom-postgres | awk -F'[()]' '/PING/{print $2}')
REDIS=$(ping -c 1 phantom-redis | awk -F'[()]' '/PING/{print $2}')
CORE=$(ping -c 1 phantom-core | awk -F'[()]' '/PING/{print $2}')

iptables -I OUTPUT -t nat -o lo -d localhost -p tcp --dport 5432 -j DNAT --to-destination ${POSTGRES}:5432
iptables -I POSTROUTING -t nat -p tcp --dport 5432 -d ${POSTGRES} -j SNAT --to ${CORE}
iptables -I OUTPUT -t nat -o lo -d localhost -p tcp --dport 6379 -j DNAT --to-destination ${REDIS}:6379
iptables -I POSTROUTING -t nat -p tcp --dport 6379 -d ${REDIS} -j SNAT --to ${CORE}

cd /ark-core
cd /phantom-core
rm -rf node_modules package-lock.json > /dev/null 2>&1
rm -rf packages/core/node_modules packages/core/package-lock.json 2>&1
npm --quiet install lerna -g && npm --quiet install -g nodemon
Expand Down
2 changes: 1 addition & 1 deletion docker/testnet/restore.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DOCKER_DB_NAME="$(docker-compose ps -q postgres)"
DB_HOSTNAME=postgres
DB_USER=ark
DB_USER=phantom
LOCAL_DUMP_PATH="snapshot.dump"

docker-compose up -d postgres
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"lint": "lerna run lint",
"depcheck": "lerna run depcheck",
"prepare": "lerna run prepare",
"test": "cross-env ARK_ENV=test jest --forceExit",
"test:coverage": "cross-env ARK_ENV=test jest --coverage --forceExit"
"test": "cross-env PHANTOM_ENV=test jest --forceExit",
"test:coverage": "cross-env PHANTOM_ENV=test jest --coverage --forceExit"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.51",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) Ark Ecosystem <info@ark.io>
Copyright (c) Ark Ecosystem <info@ark.io> \n Copyright (c) Phantom <info@phantom.org>

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
Expand Down
Loading