Catalog npm
Back to packageRELEASE DETAILS

0.1.1

npm

@0x/coordinator-server

0x Coordinator reference server implementation

Published3 May 2019
Direct dependencies53
Transitive dependenciesNot calculated

README

Current package documentation

Table of contents

Introduction

A reference implementation of the coordinator server. To learn more about coordinators, check out the coordinator specification. To learn more about the specific design decisions of this implementation, read the design choices section.

Fork this repository to get started!

Getting started

Pre-requirements

To develop ontop of 0x-coordinator-server, follow the following instructions:

  1. Fork this repository

  2. Clone your fork of this repository

  3. Make sure you have Yarn installed.

  4. Install the dependencies:

    yarn
    
  5. Edit the src/production_configs.ts file to work with your relayer:

  • FEE_RECIPIENTS - Should include the addresses and private keys of the feeRecipientAddress's you enforce for your orders (per chainId). Your coordinator's signatures will be generated using these private keys.
  • SELECTIVE_DELAY_MS - An optional selective delay between fill request receipt and approval. Adding a delay here can help market makers cancel orders without competing on speed with arbitrageurs.
  • EXPIRATION_DURATION_SECONDS - How long an issued signature should be valid for. This value should be long enough for someone to concievably fill an order, but short enough where off-chain cancellations take effect after some reasonable upper-bound.
  • RPC_URL - The backing Ethereum node to use for JSON RPC queries. Please add your own Infura API key if using Infura.
  1. Build the project

    yarn build
    

    or build & watch:

    yarn watch
    
  2. Start the Coordinator server

    yarn start
    

Commands

  • yarn build - Build the code
  • yarn lint - Lint the code
  • yarn start - Starts the relayer
  • yarn watch - Watch the source code and rebuild on change
  • yarn prettier - Auto-format the code

Database

This project uses TypeORM. It makes it easier for anyone to switch out the backing database used by this project. By default, this project uses an SQLite database.

Before deploying the coordinator to production, make sure to remove the following line from ormconfig.json:

"synchronize": true,

Otherwise the database schema will be auto-created on every application launch. Read more here.

Deployment

0x-coordinator-server ships as a docker container. First, install Docker (mac, windows). Before you can build the image, make sure you've edited your configs as outlined in step 5 of Pre-Requirements.

To build the image run:

docker build -t 0x-coordinator-server .

You can check that the image was built by running:

docker images

And launch it with

docker run -p 3000:3000 -d 0x-coordinator-server

The laws and regulations applicable to the use and exchange of digital assets and blockchain-native tokens, including through any software developed using the licensed work created by ZeroEx Intl. as described here (the “Work”), vary by jurisdiction. As set forth in the Apache License, Version 2.0 applicable to the Work, developers are “solely responsible for determining the appropriateness of using or redistributing the Work,” which includes responsibility for ensuring compliance with any such applicable laws and regulations. See the Apache License, Version 2.0 for the specific language governing all applicable permissions and limitations: http://www.apache.org/licenses/LICENSE-2.0

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 53

Native requirements
53 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
cors
Environment
{
  "local_name": "cors",
  "alias": false,
  "peer_metadata": null
}
^2.8.5runtime
lodash
Environment
{
  "local_name": "lodash",
  "alias": false,
  "peer_metadata": null
}
^4.17.11runtime
express
Environment
{
  "local_name": "express",
  "alias": false,
  "peer_metadata": null
}
^4.16.3runtime
forever
Environment
{
  "local_name": "forever",
  "alias": false,
  "peer_metadata": null
}
^0.15.3runtime
sqlite3
Environment
{
  "local_name": "sqlite3",
  "alias": false,
  "peer_metadata": null
}
^4.0.2runtime
typeorm
Environment
{
  "local_name": "typeorm",
  "alias": false,
  "peer_metadata": null
}
0.2.7runtime
@0x/types
Environment
{
  "local_name": "@0x/types",
  "alias": false,
  "peer_metadata": null
}
^2.2.1runtime
@0x/utils
Environment
{
  "local_name": "@0x/utils",
  "alias": false,
  "peer_metadata": null
}
^4.3.0runtime
websocket
Environment
{
  "local_name": "websocket",
  "alias": false,
  "peer_metadata": null
}
^1.0.25runtime
@0x/assert
Environment
{
  "local_name": "@0x/assert",
  "alias": false,
  "peer_metadata": null
}
^2.0.8runtime
jsonschema
Environment
{
  "local_name": "jsonschema",
  "alias": false,
  "peer_metadata": null
}
^1.2.4runtime
body-parser
Environment
{
  "local_name": "body-parser",
  "alias": false,
  "peer_metadata": null
}
^1.18.3runtime
@0x/order-utils
Environment
{
  "local_name": "@0x/order-utils",
  "alias": false,
  "peer_metadata": null
}
^7.2.0runtime
@babel/polyfill
Environment
{
  "local_name": "@babel/polyfill",
  "alias": false,
  "peer_metadata": null
}
^7.0.0runtime
@0x/json-schemas
Environment
{
  "local_name": "@0x/json-schemas",
  "alias": false,
  "peer_metadata": null
}
^3.0.8runtime
@0x/subproviders
Environment
{
  "local_name": "@0x/subproviders",
  "alias": false,
  "peer_metadata": null
}
^4.0.4runtime
@0x/web3-wrapper
Environment
{
  "local_name": "@0x/web3-wrapper",
  "alias": false,
  "peer_metadata": null
}
^6.0.4runtime
reflect-metadata
Environment
{
  "local_name": "reflect-metadata",
  "alias": false,
  "peer_metadata": null
}
^0.1.10runtime
http-status-codes
Environment
{
  "local_name": "http-status-codes",
  "alias": false,
  "peer_metadata": null
}
^1.3.0runtime
@0x/contracts-erc20
Environment
{
  "local_name": "@0x/contracts-erc20",
  "alias": false,
  "peer_metadata": null
}
^2.1.0runtime
@0x/contract-wrappers
Environment
{
  "local_name": "@0x/contract-wrappers",
  "alias": false,
  "peer_metadata": null
}
^8.0.5runtime
express-async-handler
Environment
{
  "local_name": "express-async-handler",
  "alias": false,
  "peer_metadata": null
}
^1.1.4runtime
@0x/contract-addresses
Environment
{
  "local_name": "@0x/contract-addresses",
  "alias": false,
  "peer_metadata": null
}
^2.3.0runtime
@0x/typescript-typings
Environment
{
  "local_name": "@0x/typescript-typings",
  "alias": false,
  "peer_metadata": null
}
^4.2.1runtime
shx
Environment
{
  "local_name": "shx",
  "alias": false,
  "peer_metadata": null
}
^0.3.2development
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^4.0.1development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^4.1.0development
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^6.2.0development
tslint
Environment
{
  "local_name": "tslint",
  "alias": false,
  "peer_metadata": null
}
^5.11.0development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^1.14.3development
cross-env
Environment
{
  "local_name": "cross-env",
  "alias": false,
  "peer_metadata": null
}
^5.2.0development
supertest
Environment
{
  "local_name": "supertest",
  "alias": false,
  "peer_metadata": null
}
^3.4.2development
dirty-chai
Environment
{
  "local_name": "dirty-chai",
  "alias": false,
  "peer_metadata": null
}
^2.0.1development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^3.0.3development
@types/cors
Environment
{
  "local_name": "@types/cors",
  "alias": false,
  "peer_metadata": null
}
^2.8.4development
@types/mocha
Environment
{
  "local_name": "@types/mocha",
  "alias": false,
  "peer_metadata": null
}
^2.2.42development
download-cli
Environment
{
  "local_name": "download-cli",
  "alias": false,
  "peer_metadata": null
}
^1.1.1development
@0x/dev-utils
Environment
{
  "local_name": "@0x/dev-utils",
  "alias": false,
  "peer_metadata": null
}
^2.2.0development
@types/dotenv
Environment
{
  "local_name": "@types/dotenv",
  "alias": false,
  "peer_metadata": null
}
^6.1.0development
@types/lodash
Environment
{
  "local_name": "@types/lodash",
  "alias": false,
  "peer_metadata": null
}
^4.14.116development
@types/express
Environment
{
  "local_name": "@types/express",
  "alias": false,
  "peer_metadata": null
}
^4.16.0development
chai-bignumber
Environment
{
  "local_name": "chai-bignumber",
  "alias": false,
  "peer_metadata": null
}
^3.0.0development
ethereum-types
Environment
{
  "local_name": "ethereum-types",
  "alias": false,
  "peer_metadata": null
}
^2.0.0development
ethereumjs-util
Environment
{
  "local_name": "ethereumjs-util",
  "alias": false,
  "peer_metadata": null
}
^6.0.0development
@types/supertest
Environment
{
  "local_name": "@types/supertest",
  "alias": false,
  "peer_metadata": null
}
^2.0.7development
@types/websocket
Environment
{
  "local_name": "@types/websocket",
  "alias": false,
  "peer_metadata": null
}
^0.0.39development
chai-as-promised
Environment
{
  "local_name": "chai-as-promised",
  "alias": false,
  "peer_metadata": null
}
^7.1.0development
@0x/tslint-config
Environment
{
  "local_name": "@0x/tslint-config",
  "alias": false,
  "peer_metadata": null
}
^3.0.0development
make-promises-safe
Environment
{
  "local_name": "make-promises-safe",
  "alias": false,
  "peer_metadata": null
}
^1.1.0development
@0x/abi-gen-wrappers
Environment
{
  "local_name": "@0x/abi-gen-wrappers",
  "alias": false,
  "peer_metadata": null
}
^4.1.0development
@0x/contract-artifacts
Environment
{
  "local_name": "@0x/contract-artifacts",
  "alias": false,
  "peer_metadata": null
}
^1.4.0development
@0x/contracts-test-utils
Environment
{
  "local_name": "@0x/contracts-test-utils",
  "alias": false,
  "peer_metadata": null
}
^3.0.4development
@types/web3-provider-engine
Environment
{
  "local_name": "@types/web3-provider-engine",
  "alias": false,
  "peer_metadata": null
}
^14.0.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "7eeb74959dc72b76756b95ccd14fd9fa8d072ede",
  "tarball": "https://registry.npmjs.org/@0x/coordinator-server/-/coordinator-server-0.1.1.tgz",
  "fileCount": 90,
  "integrity": "sha512-KxdZO93TigDyVRC90DMrQDIxjNTq3zMgmW9j8AVzx78nWXiRrUknYnkPP2a1Fp53H6Ngilc33zFjysR+QgrZPA==",
  "signatures": [
    {
      "sig": "MEYCIQCyFsT9Y0wKUvxpMGt7NoqivkzqG+fq3ZgbjW0TtnG0XwIhANnjtbXWMUDFgHWMLcfPZVdODd76C4LE4NitP9EaFcaW",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 521942,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczJgOCRA9TVsSAnZWagAAu1wQAIVOeZljYtFmgXzmqR0l\nxQbMmlDG4NGXcuh5tqkIY0mbIeXiBq3/p7dPf2rkzX6oGHMwLV9Xz6Qw+ITk\nJXkEUWgFIIumSe3TualOY6IiPFoF3YDdv3Avh59TKdX0fq+5pnoKqcbmlGfR\nA9Oa2Yym8upf+6L+/PXrUVB/13BAbMbqpUYbHJ34lwZWEYFaQ4XwHFn/k+zf\n5LXTiIdP+LNfmttYETn6Cd19QqTsR4V3O/MVFWj5+Yfbj5zAZFYQCJDZxaTh\nfVlr2Ceaos/t80+hQsMjVKuF+spU4MwnX5HaP2PdeBeoIKzTQs7nw3mWvrs0\n7vZ0X+Vq52/dHvc/ZngYEpuD60W38f0dFjf9p5bejBSLleRsI8sz/N0D/Nw8\n8GCCSIe1TXwke52M8DSYmDnOcd6Hg6QP8hi65AApkY5gmHTYkVSy6sVfPXEU\n4oFmmeq0BbDv70E14td4EbtIh0FWhAgwv8D+CP3Pnp8LU9JB1vD6xnfUyz/J\nILX9/eGPxmmL8RyFCFt9Dafv1qGFciQX1+reV0ur8vfsxJH/0tPg56mVJVK4\ndehCJzHvXtX4Nms7SyWPmZGd6RonvBzqVh9PyiC8UDw+KBuqwE/tYbwlbwER\n2p1KLbOqG3RglXBMFr27hmvivc7DWvQG2Pi8m/UQX6ixRou2zKoCqfz8cib/\ngYEN\r\n=xdBI\r\n-----END PGP SIGNATURE-----\r\n"
}

Repository

PENDING
0xproject/0x-coordinator-server

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:27 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:f75e6e3b62d4867c6eaa956ee84a701e05780e33ddb0a67a185cf1b16ea5fed6

Other collected versions

1.0.512 Dec1.0.421 Nov1.0.318 Nov1.0.217 Nov1.0.117 Nov1.0.016 NovView all collected versions →