antiddos: Anti DDoS

Description Usage Arguments Value Side effect See Also Examples

Description

Wait if you should before next API call to market (or any other source system) to do not get banned.

Usage

1
2
antiddos(market, antispam_interval = 10,
  verbose = getOption("Rbitcoin.verbose", 0))

Arguments

market

character, a unique name of source system, could be any name c('kraken','bitstamp','blockchain','alt_bitstamp')

antispam_interval

numeric time in seconds between API calls on the particular source system, defeault 10s.

verbose

integer. Rbitcoin processing messages, print to console if verbose > 0, each subfunction reduce verbose by 1. If missing then getOption("Rbitcoin.verbose",0) is used, by default 0.

Value

numeric time of wait in seconds.

Side effect

Environment of name Rbitcoin.last_api_call in .GlobalEnv which holds the timestamps of last api call per market during the R session.

See Also

market.api.process, wallet_manager

Examples

1
2
3
4
5
6
7
8
## Not run: 
# run below code in a batch
wait <- antiddos(market = 'kraken', antispam_interval = 5, verbose = 1)
market.api.process('kraken',c('BTC','EUR'),'ticker')
wait2 <- antiddos(market = 'kraken', antispam_interval = 5, verbose = 1)
market.api.process('kraken',c('BTC','EUR'),'ticker')

## End(Not run)

Rbitcoin documentation built on May 2, 2019, 3:41 p.m.