Catalog npm
Back to packageRELEASE DETAILS

1.0.3

npm

@0x/coordinator-server

0x Coordinator reference server implementation

Published18 Nov 2019
Direct dependencies54
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 54

Native requirements
54 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.5.0-beta.2runtime
@0x/utils
Environment
{
  "local_name": "@0x/utils",
  "alias": false,
  "peer_metadata": null
}
4.6.0-beta.2runtime
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.2.0-beta.2runtime
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
}
8.5.0-beta.2runtime
@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
}
4.1.0-beta.2runtime
@0x/subproviders
Environment
{
  "local_name": "@0x/subproviders",
  "alias": false,
  "peer_metadata": null
}
5.1.0-beta.2runtime
@0x/web3-wrapper
Environment
{
  "local_name": "@0x/web3-wrapper",
  "alias": false,
  "peer_metadata": null
}
6.1.0-beta.2runtime
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.3.0-beta.2runtime
@0x/contract-wrappers
Environment
{
  "local_name": "@0x/contract-wrappers",
  "alias": false,
  "peer_metadata": null
}
12.2.0-beta.2runtime
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
}
3.3.0-beta.3runtime
@0x/typescript-typings
Environment
{
  "local_name": "@0x/typescript-typings",
  "alias": false,
  "peer_metadata": null
}
4.4.0-beta.2runtime
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.1development
@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
}
^5.2.7development
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.4.0-beta.2development
@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
@0x/migrations
Environment
{
  "local_name": "@0x/migrations",
  "alias": false,
  "peer_metadata": null
}
^4.4.0-beta.2development
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.2.0-beta.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.1.0-beta.2development
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
}
^5.4.0-beta.2development
@0x/contract-artifacts
Environment
{
  "local_name": "@0x/contract-artifacts",
  "alias": false,
  "peer_metadata": null
}
^2.3.0-beta.3development
@0x/contracts-test-utils
Environment
{
  "local_name": "@0x/contracts-test-utils",
  "alias": false,
  "peer_metadata": null
}
^3.2.0-beta.2development
@0x/contracts-asset-proxy
Environment
{
  "local_name": "@0x/contracts-asset-proxy",
  "alias": false,
  "peer_metadata": null
}
^2.3.0-beta.2development
@types/express-serve-static-core
Environment
{
  "local_name": "@types/express-serve-static-core",
  "alias": false,
  "peer_metadata": null
}
^4.16.11development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "736640edc5960bd65674436f96050fd7b4da7ac3",
  "tarball": "https://registry.npmjs.org/@0x/coordinator-server/-/coordinator-server-1.0.3.tgz",
  "fileCount": 140,
  "integrity": "sha512-R9QMrd2cSrSi1Fqh2r/lSLquJ8hmtNjkVI+SGz83zTl1bu8WqTRYSUu/uicyCQHDO2aRsLC2jFg+Jl7MQlVl6A==",
  "signatures": [
    {
      "sig": "MEUCIQDVXp6rhaYEjYHQ8nxdRcnOp1hSclObJ8yPVYKyLfyP2QIgN8jkieto/ZjW9QCLXTswpa2i5yXUsJgMb+nn3rTNNjM=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 495833,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0vGMCRA9TVsSAnZWagAAYKYP/0iI0R6H9RA/W25HV2br\ntEpvSDD32NJtYNv36FIQF3wsZdh8T9dqVHH9sxePO13hebKeGiY+hBXxdm7G\nD5WqPz6fwNZuRzW2dmPdyZkgwdhYEM/6wQ4iMAHHmM+msVzFKGfv0Ol4/xSZ\n2FjqohF7pUUUSSAi4z3/c8eENhivuM1ajmneVyBziR6XyB6xVawHFi1K+d6H\n1bx5obdombNmGoqJ7p6oo37YMjxipeUnj9Ir3Kl3LLwCxGFceChPe9ppktLv\nEpHbfUXeA1EF5mGWX/Nehut+vrzllVOFTQHlVu0dpWBY5gk2U/Wui16ra3EV\n9di13F/WC9WjdVVa+4Hf0W6U2XT+Zmub4ZuYTA2bLalt0OOU43Zkg4iogftQ\nMwParHYYsUEEA11MvIHkG9+aMdBQYN2j9ezaH0EdPY7CoPgvsi3EEu/PXgrK\nZotF3rsF+L+8RLn1Vwfa1Kvrv8RNXA2cE5wSoYjbTUw6IFWdeH0Z6p/7Ii0V\nuzKgkxt5eKPzAWRWZaB4ifmed4Xp0xE7UH9hgYWygoewoz8MaFgFyIV5Iyp+\nCeJmF073ddydqMRCqua+zTEYkNmb5xOE9yBwcWkrseEe5uOay0ZZkpLZXnB9\nUYz5YJq7q7RW1R5S2I0ZkOTPH/t8pQdHH+NDPOmUAptlMBQZUwufYu0WpzqN\nwu/y\r\n=6zwR\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:08a98aeafc0c725362aefe11212c32ed4810e25b671f918f500e635065601d14

Other collected versions

1.0.512 Dec1.0.421 Nov1.0.217 Nov1.0.117 Nov1.0.016 Nov0.1.35 AugView all collected versions →