core/

directory
v0.0.0-...-589da53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2023 License: MIT

README

Fury core

A decentralised trading platform that allows pseudo-anonymous trading of derivatives on a blockchain.

Fury provides the following core features:

  • For new developers, see Getting Started.
  • For updates, see the Change log for major updates.
  • For architecture, please read the documentation to learn about the design for the system and its architecture.
  • Please open an issue if anything is missing or unclear in this documentation.
Table of Contents (click to expand)

Installation

To install trading-core and tendermint, see Getting Started.

Configuration

Fury is initialised with a set of default configuration with the command fury init. To override any of the defaults, edit your config.toml.

Example

[Matching]
Level = 0
ProRataMode = false
LogPriceLevelsDebug = false
LogRemovedOrdersDebug = false

Fury requires a set of wallets for the internal or external chain it's dealing with.

The node wallets can be accessed using the nodewallet subcommand, these node wallets are initialized / accessed using a passphrase that needs to be specified when initializing Fury:

fury init --nodewallet-passphrase-file "my-passphrase-file.txt"
Files location
Environment variables Unix MacOS Windows
XDG_DATA_HOME ~/.local/share ~/Library/Application Support %LOCALAPPDATA%
XDG_CONFIG_HOME ~/.config ~/Library/Application Support %LOCALAPPDATA%
XDG_STATE_HOME ~/.local/state ~/Library/Application Support %LOCALAPPDATA%
XDG_CACHE_HOME ~/.cache ~/Library/Caches %LOCALAPPDATA%\cache

You can override these environment variables, however, bear in mind it will apply system-wide.

If you don't want to rely on the default XDG paths, you can use the --home flag on the command-line.

Fury node wallets

A Fury node needs to connect to other blockchain for various operation:

  • validate transaction happened on foreign chains
  • verify presence of assets
  • sign transaction to be verified on foreign blockchain
  • and more...

In order to do these different action, the Fury node needs to access these chains using their native wallet. To do so the fury command line provide a command line tool: fury nodewallet allowing users to import foreign blockchain wallets credentials, so they can be used at runtime.

For more details on how to use the Fury node wallets run:

fury nodewallet --help
Using Ethereum Clef wallet
Automatic approvals

Given that Clef requires manually approving all RPC API calls, it is mandatory to setup custom rules for automatic approvals. Fury requires at least ApproveListing and ApproveSignData rules to be automatically approved.

Example of simple rule set JavaScript file with approvals required by Fury:

function ApproveListing() {
  return "Approve"
}

function ApproveSignData() {
  return "Approve"
}

Clef also allows more refined rules for signing. For example approves signs from ipc socket:

function ApproveSignData(req) {
  if (req.metadata.scheme == "ipc") {
    return "Approve"
  }
}

Please refer to Clef rules docs for more information.

Importing and generation account

As of today, Clef does not allow to generate a new account for other back end storages than a local Key Store. Therefore it is preferable to create a new account on the back end of choice and import it to Fury through node wallet CLI.

Example of import:

fury nodewallet import --chain=ethereum --eth.clef-address=http://clef-address:port

Troubleshooting & debugging

The application has structured logging capability, the first port of call for a crash is probably the Fury and Tendermint logs which are available on the console if running locally or by journal plus syslog if running on test networks. Default location for log files:

  • /var/log/fury.log
  • /var/log/tendermint.log

Each internal Go package has a logging level that can be set at runtime by configuration. Setting the logging Level to "Debug" for a package will enable all debugging messages for the package which can be useful when trying to analyse a crash or issue.

Debugging the application locally is also possible with Delve.

Directories

Path Synopsis
api
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
rest
Package rest contains code for running the REST-to-gRPC gateway.
Package rest contains code for running the REST-to-gRPC gateway.
erc20/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
nullchain/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
client
eth
eth/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
contracts
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
ethcall/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
ethereum/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
examples
common/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
supplied/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
target/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
liquidity/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
price/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
eth
eth/clef/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
eth/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
pow
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
erc20multisig/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL