New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

five-bells-trader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

five-bells-trader

Five Bells trader reference implementation

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Five Bells Trader npm circle coveralls

A reference implementation of the Five Bells Trader API

Usage

You can see the trader in action as part of the five-bells-demo!

To run the trader as a standalone server, follow these directions.

Note: You need two five-bells-ledger instances to trade between.

Step 1: Clone repo

git clone https://github.com/intertrader/five-bells-trader.git
cd five-bells-trader

Step 2: Install dependencies

npm install

Step 3: Run it!

npm start

Configuration

General
  • TRADER_BIND_IP (default: 0.0.0.0) IP that Five Bells Trader will bind to.
  • TRADER_PORT (default: 4000) Port that Five Bells Trader will listen on.
  • TRADER_HOSTNAME (default: [your hostname]) Publicly visible hostname. This is important for things like generating globally unique IDs. Make sure this is a hostname that all your clients will be able to see. The default should be fine for local testing.
  • TRADER_PUBLIC_PORT (default: $PORT) Publicly visible port. You can set this if your public port differs from the listening port, e.g. because the trader is running behind a proxy.
  • TRADER_PUBLIC_HTTPS (default: '') Whether or not the publicly visible instance of Five Bells Trader is using HTTPS.
Trading
  • TRADING_PAIRS (default: []) Pairs to trade on, ex.
[
  [
    'USD@http://ledger1.example',
    'EUR@http://ledger2.example'
  ],[
    'EUR@http://ledger2.example',
    'USD@http://ledger1.example'
  ]
]
  • TRADER_CREDENTIALS (default: {}) Trader's login credentials, ex.
{
   "<ledger_uri>": {
     "account_uri": "...",
     "username": "...",
     "password": "..."
   }
}
  • TRADER_DEBUG_AUTOFUND (default: '') Debug feature which uses corresponding ledger debug
  • TRADER_FX_SPREAD (default: 0.002 =.2%) How much of a spread to add on top of the reference exchange rate. This determines the trader's margin.
  • TRADER_MIN_MESSAGE_WINDOW (default: 1) Minimum time the trader wants to budget for getting a message to the ledgers its trading on. In seconds.
  • TRADER_MAX_HOLD_TIME (default: 10) Maximum duration the trader is willing to place funds on hold while waiting for the outcome of a transaction. In seconds.

Running with Docker

This project can be run in a Docker container.

docker run -it --rm -e PORT=4000 quay.io/ripple/five-bells-trader

Breaking down that command:

  • -it Run Five Bells Trader in an interactive terminal.
  • --rm Delete container when it's done running.
  • -e PORT=4000 Set the trader's port to 4000. This is just an example for how to set a config option.

Keywords

FAQs

Package last updated on 31 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc