npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@0x/coordinator-server

v1.0.5

Published

0x Coordinator reference server implementation

Downloads

39

Readme

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

Legal Disclaimer

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