Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure the DCR coin configuration file #44

Open
wants to merge 549 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
549 commits
Select commit Hold shift + click to select a range
ae82297
blocks: bug with PoS coins not supporting blocknotifiy
tpruvot Mar 19, 2016
53a1135
bleutrade: strip annoying html log on api error
tpruvot Mar 19, 2016
bc3ae3b
Restore banx exchange, reopening..
tpruvot Mar 19, 2016
4ec4f92
stratum: decred voting support
tpruvot Mar 19, 2016
0f34e16
users: rework table and bad shares count
tpruvot Mar 21, 2016
d1905c6
api: prepare the currencies details
tpruvot Mar 21, 2016
7e73990
c-cex: add new apis + auto withdraw
tpruvot Mar 21, 2016
8dfa435
exchanges: load balances in market table
tpruvot Mar 21, 2016
40dbf13
c-cex: get deposit addresses
tpruvot Mar 22, 2016
7d59901
safecex: also store all balances
tpruvot Mar 22, 2016
f4fcf5c
c-cex: handle error in return field :/
tpruvot Mar 22, 2016
8a4f0b3
coindb: update labels from yiimp pools
tpruvot Mar 22, 2016
6d3241d
bleutrade: sleep before each api call
tpruvot Mar 22, 2016
997f0be
kraken api, to retrieve markets and btc balance
tpruvot Mar 22, 2016
8444523
exchange: banx and cryptopia also returns deposit addresses
tpruvot Mar 23, 2016
0075e26
backups: purge outdated shares
tpruvot Mar 24, 2016
318efbb
bter exchange private api
tpruvot Mar 24, 2016
b90ef30
small changes
tpruvot Mar 24, 2016
1e7f2fb
miners: increase max len of users's version/password
tpruvot Mar 26, 2016
11d26c1
earnings: remove the row limit when a coin is selected
tpruvot Mar 27, 2016
dac5d33
profit: move sha256 GH/s factor in a function
tpruvot Mar 27, 2016
fe6c79e
stats: change blake algos profit to mBTC/Gh
tpruvot Mar 27, 2016
1c5daaa
graphs: handle the new blake unit
tpruvot Mar 27, 2016
b1d7435
c-cex: link coin labels api
tpruvot Mar 28, 2016
b46b4e0
cryptopia: fix typo in markets code
tpruvot Mar 30, 2016
6100c97
yiimp checkup fix (php 7)
tpruvot Mar 30, 2016
8712864
poloniex: dont assume the api key is defined
tpruvot Mar 30, 2016
5f17796
kraken: set a timeout to api calls
tpruvot Mar 30, 2016
e7a0808
util: add a new objSafeVal() function for json objects
tpruvot Mar 30, 2016
46d1fe9
Exchange Order Cancel on Dashboard page
JarBinks Mar 31, 2016
170c799
fix a weird error on form (php 7)
tpruvot Mar 30, 2016
d41d5c3
cryptopia: marketid update
JarBinks Mar 31, 2016
06f397a
cryptopia: double check orders api result in trading
tpruvot Mar 31, 2016
1692a47
stratum: dont hardcode the files rlimit in binary
tpruvot Mar 31, 2016
c3f2e90
yobit: add auto withdraw BTC
Apr 1, 2016
da9cafe
api: fix status json, could contain empty values
tpruvot Apr 1, 2016
7d4f97b
decred: show tickets and locked amount in the wallet
tpruvot Apr 1, 2016
cefd7ff
coins: more flexible datasorter
tpruvot Apr 1, 2016
1a51a4f
cryptopia: bug fix in the cancel order function
JarBinks Apr 2, 2016
21d8a1d
exchange: fix bter api queries
tpruvot Apr 2, 2016
4026864
banx: quick fix for new domain name
tpruvot Apr 2, 2016
a545058
safecex: fixing missing cancel order routines
JarBinks Apr 2, 2016
294da52
banx: rename to cryptomic (part 2)
tpruvot Apr 2, 2016
71de6d6
db: save blocks worker id for worker stats
tpruvot Sep 22, 2015
2022170
db: save payout errors
tpruvot Feb 17, 2016
6950057
db: handle custom user donation percents
tpruvot Feb 17, 2016
553c920
shares: store (temporary) submitted work diff for future stats...
tpruvot Feb 23, 2016
dcce3ff
workers: columns sort and search filter
tpruvot Mar 2, 2016
f72ce04
markets: new fields + balances update
tpruvot Mar 26, 2016
616e448
wallet: link new market fields
tpruvot Mar 27, 2016
fbe8689
markets: link new market fields (disabled/priority)
tpruvot Mar 27, 2016
9f431ec
markets: improve disabled flag
tpruvot Mar 28, 2016
2902cdb
wallet: allow to manually toggle markets
tpruvot Mar 29, 2016
3498e31
sql: add some new fields to the coin database
tpruvot Mar 30, 2016
b43fa92
coins: add link_site field
tpruvot Mar 31, 2016
2a23f05
coins: change default order to creation date, desc
tpruvot Apr 3, 2016
a338131
sql: rename account last_login to last_earning
tpruvot Apr 3, 2016
e4ef728
coins: link the new fields in form
tpruvot Apr 3, 2016
baf1a23
db: refresh the initial sql dump
tpruvot Apr 3, 2016
63f1032
decred: tickets plugin in the wallet
tpruvot Apr 4, 2016
f0bf43b
tickets: proper error and show current balance
tpruvot Apr 7, 2016
345e5bc
add xvg algos + rename groestl to myr-gr
tpruvot Apr 15, 2016
187a5dc
trading: remove big markets checks + bter fix + balances
tpruvot Apr 15, 2016
4ed9425
add nova exchange api
tpruvot Apr 15, 2016
009e97f
nova: missing link to cron + url typo
tpruvot Apr 15, 2016
7485f7a
nova: update icon grabber
tpruvot Apr 15, 2016
1abd0ef
decred: never change last vote bit
tpruvot Apr 15, 2016
b4f1ce8
users: fix remains of last_login column
tpruvot Apr 17, 2016
644f5b8
nova: volume market check was in btc
tpruvot Apr 17, 2016
74b8029
stratum/decred: link new db coin rpc fields
tpruvot Apr 19, 2016
dd262f1
decred: allow to purchase multiple tickets
tpruvot Apr 19, 2016
09d4667
decred: show all live tickets (old too)
tpruvot Apr 22, 2016
60e1938
wallet: basic console
tpruvot Apr 22, 2016
0fd1d49
decred: auto toggle ready flag with connection count
tpruvot Apr 23, 2016
bf7fc35
sql: keep btc and user defined markets history
tpruvot Apr 24, 2016
8dcbeec
wallet: market price/balance graphes
tpruvot Apr 24, 2016
25a76ce
wallet: history graphes improvements
tpruvot Apr 25, 2016
e6365fc
wallet: refactor graphes + vertical scroll to show more txs
tpruvot Apr 25, 2016
21746e5
history: allow to watch local price/balance
tpruvot Apr 25, 2016
e816d5c
markets: always update markets if we have the data
tpruvot Apr 25, 2016
e0188d7
wallet: small changes: series order, site name
tpruvot Apr 25, 2016
457a90d
markets: dont disable cryptopia-only markets
tpruvot Apr 26, 2016
d417830
Update admin_results.php
Apr 26, 2016
70d4ac5
bitstamp public api, private untested yet
tpruvot Apr 26, 2016
fac301f
cryptomic: finish renaming + kraken ask/bid check
tpruvot Apr 26, 2016
e0d65b0
separate stratum URL option (squashed + default)
Apr 26, 2016
c74cfff
payments: handle payout_max field, to enhance later
tpruvot Apr 26, 2016
15654cc
bittrex: fix withdraw subtract tx fee from balance
Apr 26, 2016
878716e
yiimp: add system var db & host for backup
Apr 27, 2016
9d20eb0
backups: prefer xz if available
tpruvot Apr 27, 2016
7e0c9f6
sql: settings table for exchange variables
tpruvot Apr 27, 2016
b7c846c
settings: link the exchange disable flag
tpruvot Apr 27, 2016
6c8c6ce
bitstamp: fix private api + getbalance
tpruvot Apr 27, 2016
fff4c76
c-cex: indent + constant fix
tpruvot Apr 27, 2016
d32c673
bitstamp: fix api typo
tpruvot Apr 27, 2016
3516e62
wallets: show status codes descriptions
Apr 28, 2016
ce6e7ff
wallets: enhance layout, css and table sorter
tpruvot Apr 28, 2016
9dbc9c5
history: improve graphes axis, dynamically
tpruvot Apr 28, 2016
6d2ab6e
markets: attempt to handle LTC markets
tpruvot Apr 28, 2016
b81a370
history: prune database + better axis interval for 7 days
tpruvot Apr 30, 2016
cf9b70c
history: update time to rounded hour on older history
tpruvot Apr 30, 2016
2300314
wallet: enhance graph ajax refresh and resize
tpruvot May 1, 2016
2d1af26
history: improve the stacked graph series with missing data
tpruvot May 1, 2016
9c96f50
Import yii framework 1.1.17
tpruvot May 1, 2016
c9c7a27
Fixes to handle the newer framework and jquery assets
tpruvot May 1, 2016
b2f7f27
yii 1.1.x models form unsafe attributes
tpruvot May 1, 2016
125cf47
dashboard: hide inactive algos + sorter
tpruvot May 2, 2016
57422a3
Fix hashrate sort in pool Status + sort css
tpruvot May 2, 2016
eb4e918
pool status: fix typo
tpruvot May 2, 2016
e0e1b1d
yobit: price update was interrupted by the deposit address check
tpruvot May 2, 2016
90b29f7
blakecoin: add to default algos + diff factor fix
tpruvot May 2, 2016
33e0aa6
markets: fix typo related to the LTC test
tpruvot May 2, 2016
b828736
sorter: fix hashrate column on explorer + pool status
tpruvot May 2, 2016
382131c
Fix displayed pending amount in user wallet
tpruvot May 3, 2016
b97682e
explorer: allow /explorer/SYM url format
tpruvot May 3, 2016
f3c65e2
explorer: dynamic generation of all explorer links
tpruvot May 3, 2016
0eaca9c
console: humanize json timestamps + rpc errors report
tpruvot May 4, 2016
0f35eea
console: colorize and create link to the explorer
tpruvot May 4, 2016
3707c1d
explorer: colorize json block/transactions + css
tpruvot May 4, 2016
4b3f67f
controller: cleanup
tpruvot May 6, 2016
6172ae0
settings: market and coin functions + cache
tpruvot May 5, 2016
b047690
markets: link exchange settings + default values
tpruvot May 6, 2016
f539b9f
console: handle boolean parameters
tpruvot May 6, 2016
410246f
decred: adjustments for tickets and pool fees stx
tpruvot May 8, 2016
c059a91
add x17 algo
tpruvot May 9, 2016
54de738
decred: check if blocktime is before tx time
tpruvot May 11, 2016
f61d53b
stratum: handle block confirmations on multialgos coins
tpruvot May 11, 2016
a7bae2d
sql: new coin db fields multialgos watch stake
tpruvot May 11, 2016
4eaab8c
link new coin fields, auto filled
tpruvot May 11, 2016
386b94c
keep stake value if not in getinfo
tpruvot May 12, 2016
2681761
explorer: add tx size
tpruvot May 12, 2016
035d3b3
c-cex: upgrade to newer auth api (balances)
tpruvot May 12, 2016
ed3cd5f
db/benchmarks: allow ccminer to report device stats
tpruvot May 15, 2016
970016a
stratum: temporary fix to clean about bad json parse
tpruvot May 15, 2016
e433228
benchmarks: basic interface to show results
tpruvot May 15, 2016
52f44b5
stratum: fix json parse with multiple object tags
tpruvot May 15, 2016
a0ba300
benchmark: improve algo selection and handle gpus suffixes
tpruvot May 15, 2016
169241f
stratum: use the proper new method to request stats
tpruvot May 15, 2016
39e0d4b
benchmarks: allow to del + stratum record limit
tpruvot May 16, 2016
0b8d4e9
benchmarks: show a device table with all algos
tpruvot May 16, 2016
1973e05
benchmarks: show cuda arch column
tpruvot May 16, 2016
c47244b
stratum/stats: fix double values, were rounded to int
tpruvot May 17, 2016
c5f328a
poloniex: be more safe with balance api results
tpruvot May 17, 2016
8387b5e
benchmarks: simplify and prepare adv search
tpruvot May 18, 2016
976c87d
stratum: allow test/benchmark/donate usernames
tpruvot May 18, 2016
f816169
stratum: improve guest users, do not create accounts
tpruvot May 18, 2016
cf3779d
workers: hashrate sort + gift fix
tpruvot May 18, 2016
de88b7c
payouts: additional errors for failed tx
May 19, 2016
a613671
stratum: prevent diff/algo setting conflict
tpruvot May 19, 2016
7ae4a67
stratum: defines for valid address min/max length
tpruvot May 20, 2016
d262f87
stratum/stats: handle the benchmark miner user
tpruvot May 20, 2016
8d4ebc4
stratum: allow cpuminer-multi stats
tpruvot May 20, 2016
1a53bf0
benchmarks: function to clean cpu names
tpruvot May 21, 2016
b857657
stats: use a vendor id with the cores count
tpruvot May 21, 2016
2bbf358
console: use the right php function (php7)
tpruvot May 21, 2016
bea876b
benchs: add averages in footer for current filter
tpruvot May 23, 2016
3e0c13a
benchs: show hashrate per watt
tpruvot May 23, 2016
ad89a55
sql: add bookmarks table and link to wallet
tpruvot May 23, 2016
53b1e06
users: move delete with deps to the model
tpruvot May 23, 2016
e3a4851
markets: allow to change base coin (experimental)
tpruvot May 24, 2016
74dc0b1
wallets: also show watched coins in the list
tpruvot May 27, 2016
9ceae22
explorer: do no limit block hash size
tpruvot May 27, 2016
3522097
new wallet rpc class to handle martians
tpruvot May 29, 2016
3ab1c89
fix typo
tpruvot May 29, 2016
f26060c
ethereum: handle unknown methods
tpruvot May 29, 2016
738848b
various small changes
tpruvot May 30, 2016
722b9c9
eth: handle rpc exceptions
tpruvot May 30, 2016
01c4519
rpc: error string was not properly retrieved
tpruvot May 30, 2016
49b1a27
tickets: be more safe with time fields
tpruvot May 30, 2016
f775be0
wallet: attempt to reduce chrome memory leak
tpruvot May 30, 2016
96097ed
x11evo algo, properly rewrote
tpruvot May 31, 2016
aed4a0a
stratum: extra check about ntime range
tpruvot Jun 1, 2016
d8d256b
tickets: show net demand (fees) + price auto fill
tpruvot Jun 1, 2016
0c5fb6c
coins: fix footer + date sort
tpruvot Jun 1, 2016
0f6e93f
db: prepare a notification rules table
tpruvot Jun 1, 2016
65e75e3
pool: diff column sort was wrong in coin list
tpruvot Jun 1, 2016
dbdd503
Add basic notify rules check
tpruvot Jun 1, 2016
afecf8e
notify: wallet ui to add/toggle/del trigger rules
tpruvot Jun 2, 2016
9005252
notify: allow to reset triggered rules
tpruvot Jun 2, 2016
5472fca
config: add YAAMP_DEFAULT_ALGO
tpruvot Jun 2, 2016
911749a
admin: rework earnings and payments totals
tpruvot Jun 3, 2016
56cd953
benchs: remove some noise for amd apus + cpu avg
tpruvot Jun 3, 2016
3552577
cli: move deletecoin command to yiimp coin
tpruvot Jun 3, 2016
6d3dd22
stratum: add a flag indicating we need exit
tpruvot Jun 3, 2016
7e37bd1
stratum: re-enable the watchdog, take too much time
tpruvot Jun 3, 2016
a9eaf75
sql: add chip table to analyse benchmark results
tpruvot Jun 4, 2016
c2374d1
cron: rework tasks to update blocks status more often
tpruvot Jun 7, 2016
9a60f2d
stratum: add bench memory field (todo in ccminer)
tpruvot Jun 7, 2016
53638b1
bench: add a task to add new submitted chips
tpruvot Jun 8, 2016
b2aa3d9
stratum: fix height displayed for AUX debug logs
tpruvot Jun 9, 2016
5c83e36
tickets: amountin tx value is now normal since 0.1.5
tpruvot Jun 13, 2016
f4743b0
yiimp: add link to algo's pool
Jun 15, 2016
2217690
bench: more generic amd cpu rename rules
tpruvot Jun 22, 2016
612102e
explorer: show nodes to the public
tpruvot Jun 30, 2016
12b1f38
explorer: handle numeric symbols links
tpruvot Jun 30, 2016
2887288
stratum: check job broadcast errors (disconnect bad clients)
tpruvot Jul 1, 2016
7a302e9
benchs: allow to filter by chip
tpruvot Jul 1, 2016
38ee58f
benchs: chip and vid filter
tpruvot Jul 1, 2016
3d7eb0b
benchs: small fixes
tpruvot Jul 1, 2016
64ec96d
stratum: close sockets of delayed jobs
Jul 2, 2016
0c66f33
stratum: extra check on client thread exit
tpruvot Jul 3, 2016
1745ea0
yii: remove older framework
tpruvot Jul 3, 2016
52f1aa5
yii: add missing dumperror debug function
tpruvot Jul 3, 2016
548f31e
markets: minor message fix
tpruvot Jul 4, 2016
bf3259b
benchs: prevent too much records from the same user
tpruvot Jul 4, 2016
a94c239
stratum: update vcash symbol
tpruvot Jul 6, 2016
d99bc61
benchs: add per algo chip averages
tpruvot Jul 6, 2016
d2f0f42
stratum: dont try to send on closed sockets
tpruvot Jul 7, 2016
abc134c
Commit AUXPOW SegFault Fix
Jul 7, 2016
4ccd824
stratum: attempt to fix a list corruption (shares)
tpruvot Jul 8, 2016
5cf1a94
admin: allow to show workers on hidden coins
tpruvot Jul 12, 2016
38a35f0
more job prune checks
tpruvot Jul 18, 2016
a88c1e0
handle lbry algo and protocol
tpruvot Jul 10, 2016
5907efb
yiimp: fix defined stratum URL to use config value
Jul 25, 2016
bf05f7b
stratum: prevent segfault on repeated sock timeout
tpruvot Jul 26, 2016
bc58149
stratum: move blake2s to component algos folder
tpruvot Jul 29, 2016
95fd3e0
benchs: some more suffixes + cleanup
tpruvot Aug 9, 2016
aed04e8
stats: show reject count for workers rejects
tpruvot Aug 12, 2016
4ef1a81
wallet: display proper user share, without exchange
tpruvot Aug 17, 2016
e3a1ed8
css: add css classes to user and pool block status
tpruvot Aug 20, 2016
c2d4feb
multialgos: update myriad algos
tpruvot Aug 20, 2016
1a90a26
css: rounded blocks status + cleared color
tpruvot Aug 20, 2016
b276cc0
earnings: adjust mBTC decimals to satoshis
tpruvot Aug 20, 2016
ac70dbe
pool: rework title plurals and asterisk explanations
tpruvot Aug 20, 2016
1b4d4c7
veltor algo
tpruvot Aug 20, 2016
defe4f9
site: chrome 52+ workaround for broken algo redirect
tpruvot Aug 21, 2016
6606c6f
benchs: add some power cost values
tpruvot Aug 21, 2016
197a385
benchs: fix the cost column average
tpruvot Aug 25, 2016
e1091dd
stats: prevent display of wrong data if blocks table is purged
tpruvot Sep 1, 2016
06c377b
backend: more db integrity checks for zpool issues
tpruvot Sep 4, 2016
95fe244
basic cryptonote wallet rpc class/converter
tpruvot Sep 11, 2016
06d6cb9
benchs: remove 1060 6GB tweak
tpruvot Sep 12, 2016
bb09cbd
api: remove deprecated last block, now in api/currencies
tpruvot Sep 19, 2016
c23646e
api: more type fixes and encode strings
tpruvot Sep 19, 2016
bca1c8e
api: update site samples
tpruvot Sep 19, 2016
413ff39
api: improve the doc json alignment
tpruvot Sep 19, 2016
b2ca40a
exchanges: disable cryptomic, closed
tpruvot Sep 23, 2016
a7a562c
benchs: ignore virtual devices
tpruvot Sep 28, 2016
3db9327
wallet: only use bid prices to convert amounts
tpruvot Oct 9, 2016
8afd547
bleutrade: Update Withdrawal Fees
antho281 Oct 15, 2016
9f02345
stratum: allow to limit connections with max_cons setting
tpruvot Oct 17, 2016
d4150a9
shapeshift: handle as markets price source
tpruvot Oct 21, 2016
114001a
cleanup: drop dead exchanges code
tpruvot Oct 21, 2016
39ca743
benchs: show algo device H/W averages
tpruvot Oct 1, 2016
ae0e7c0
benchs: clean more the device names
tpruvot Oct 30, 2016
d6df074
exchanges: add curl timeout everywhere
tpruvot Oct 30, 2016
e3fef4b
xevan algo (x17 x2... but on 128 bytes hashes)
tpruvot Oct 16, 2016
f9e7422
exchanges: add livecoin markets and balances
tpruvot Nov 6, 2016
e09147e
explorer: first fixes to handle zec
tpruvot Nov 6, 2016
f92a6c5
benchs: handle Athlon X4 device names
tpruvot Nov 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*.o
*.a
stratum/stratum
stratum/blocknotify
blocknotify/blocknotify
blocknotify-dcr/blocknotify-dcr
bin/stratum
bin/blocknotify
bin/blocknotify-dcr
stratum/config/
log/
*.log
web/images/*
web/yaamp/runtime/*
cookies/
bin/blocknotif
web/serverconfig.php
web/assets/
*.rej
*.orig
126 changes: 125 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,126 @@
#yaamp
#yiimp - yaamp fork

Required:

linux, mysql, php, memcached, a webserver (lighttpd or nginx recommended)


Config for nginx:

location / {
try_files $uri @rewrite;
}

location @rewrite {
rewrite ^/(.*)$ /index.php?r=$1;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}


If you use apache, it should be something like that (already set in web/.htaccess):

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php?r=$1 [QSA]


If you use lighttpd, use the following config:

$HTTP["host"] =~ "yiimp.ccminer.org" {
server.document-root = "/var/yaamp/web"
url.rewrite-if-not-file = (
"^(.*)/([0-9]+)$" => "index.php?r=$1&id=$2",
"^(.*)\?(.*)" => "index.php?r=$1&$2",
"^(.*)" => "index.php?r=$1",
"." => "index.php"
)

url.access-deny = ( "~", ".dat", ".log" )
}


For the database, import the initial dump present in the sql/ folder

Then, apply the migration scripts to be in sync with the current git, they are sorted by date of change.

Your database need at least 2 users, one for the web site (php) and one for the stratum connections (password set in config/algo.conf).



The recommended install folder for the stratum engine is /var/stratum. Copy all the .conf files, run.sh, the stratum binary and the blocknotify binary to this folder.

Some scripts are expecting the web folder to be /var/web. You can use directory symlinks...


Add your exchange API public and secret keys in these two separated files:

/etc/yiimp/keys.php - fixed path in code
web/serverconfig.php - use sample as base...

You can find sample config files in web/serverconfig.sample.php and web/keys.sample.php

This web application includes some command line tools, add bin/ folder to your path and type "yiic" to list them, "yiic checkup" can help to test your initial setup.
Future scripts and maybe the "cron" jobs will then use this yiic console interface.

You need at least three backend shells (in screen) running these scripts:

web/main.sh
web/loop2.sh
web/block.sh

Start one stratum per algo using the run.sh script with the algo as parameter. For example, for x11:

run.sh x11

Edit each .conf file with proper values.

Look at rc.local, it starts all three backend shells and all stratum processes. Copy it to the /etc folder so that all screen shells are started at boot up.

All your coin's config files need to blocknotify their corresponding stratum using something like:

blocknotify=blocknotify yaamp.com:port coinid %s

On the website, go to http://server.com/site/adminRights to login as admin. You have to change it to something different in the code (web/yaamp/modules/site/SiteController.php). A real admin login may be added later, but you can setup a password authentification with your web server, sample for lighttpd:

htpasswd -c /etc/yiimp/admin.htpasswd <adminuser>

and in the lighttpd config file:

# Admin access
$HTTP["url"] =~ "^/site/adminRights" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/etc/yiimp/admin.htpasswd"
auth.require = (
"/" => (
"method" => "basic",
"realm" => "Yiimp Administration",
"require" => "valid-user"
)
)
}

And finally remove the IP filter check in SiteController.php



There are logs generated in the /var/stratum folder and /var/log/stratum/debug.log for the php log.

More instructions coming as needed.


There a lot of unused code in the php branch. Lot come from other projects I worked on and I've been lazy to clean it up before to integrate it to yaamp. It's mostly based on the Yii framework which implements a lightweight MVC.

http://www.yiiframework.com/


Credits:

Thanks to globalzon to have released the initial Yaamp source code.


6 changes: 6 additions & 0 deletions bin/blocknotify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
#
# callback script... replaced by blocknotify binary
#
# blocknotify="blocknotify.sh --host yaamp --port $stratum_port --id $coin->id --block %s --password tu8tu5"

8 changes: 8 additions & 0 deletions bin/yiimp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

ROOTDIR=/data/yiimp
DIR=`pwd`

cd "$ROOTDIR/web" && php yaamp/yiic.php $*

cd $DIR
17 changes: 17 additions & 0 deletions bin/yiimp_restart_loop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# Restart the pseudo cron screens...

LOG_DIR=/work/yiimp/log
WEB_DIR=/var/web

screen -X -S main quit
screen -X -S loop2 quit
screen -X -S blocks quit
screen -X -S debug quit

screen -dmS main $WEB_DIR/main.sh
screen -dmS loop2 $WEB_DIR/loop2.sh
screen -dmS blocks $WEB_DIR/blocks.sh

screen -dmS debug tail -f $LOG_DIR/debug.log

13 changes: 13 additions & 0 deletions blocknotify-dcr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
OUT_GO=blocknotify-dcr
OUTPUT=blocknotify-dcr

all:
rm -f $(OUT_GO)
go build

install: all
strip -s $(OUT_GO)
killall -9 $(OUTPUT) || echo ok
mv $(OUT_GO) ../bin/$(OUTPUT)
sh -c "../bin/$(OUTPUT) &"

93 changes: 93 additions & 0 deletions blocknotify-dcr/blocknotify.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// Copyright (c) 2016 The btcsuite developers
// Copyright (c) 2015-2016 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

// Sample blocknofify tool compatible with decred
// will call the standard blocknotify yiimp tool on new block event.

package main

import (
"io/ioutil"
"log"
"os/exec"
"path/filepath"
"time"

"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrrpcclient"
// "github.com/decred/dcrutil"
)

const (
processName = "blocknotify" // set the full path if required
stratumDest = "yaamp.com:5744" // stratum host:port
coinId = "1574" // decred database coin id

walletUser = "yiimprpc"
walletPass = "myDecredPassword"

debug = false
)

func main() {
// Only override the handlers for notifications you care about.
// Also note most of these handlers will only be called if you register
// for notifications. See the documentation of the dcrrpcclient
// NotificationHandlers type for more details about each handler.
ntfnHandlers := dcrrpcclient.NotificationHandlers{
OnBlockConnected: func(hash *chainhash.Hash, height int32, time time.Time, vb uint16) {

// Find the process path.
str := hash.String()
args := []string{ stratumDest, coinId, str }
out, err := exec.Command(processName, args...).Output()
if err != nil {
log.Printf("err %s", err)
} else if debug {
log.Printf("out %s", out)
}

if (debug) {
log.Printf("Block connected: %s %d", hash, height)
}
},
}

// Connect to local dcrd RPC server using websockets.
// dcrwHomeDir := dcrutil.AppDataDir("dcrwallet", false)
// folder := dcrwHomeDir
folder := ""
certs, err := ioutil.ReadFile(filepath.Join(folder, "rpc.cert"))
if err != nil {
certs = nil
log.Printf("%s, trying without TLS...", err)
}

connCfg := &dcrrpcclient.ConnConfig{
Host: "127.0.0.1:15740",
Endpoint: "ws", // websocket

User: walletUser,
Pass: walletPass,

DisableTLS: (certs == nil),
Certificates: certs,
}

client, err := dcrrpcclient.New(connCfg, &ntfnHandlers)
if err != nil {
log.Fatalln(err)
}

// Register for block connect and disconnect notifications.
if err := client.NotifyBlocks(); err != nil {
log.Fatalln(err)
}
log.Println("NotifyBlocks: Registration Complete")

// Wait until the client either shuts down gracefully (or the user
// terminates the process with Ctrl+C).
client.WaitForShutdown()
}
25 changes: 25 additions & 0 deletions blocknotify/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

CC=gcc

CFLAGS=-c -g -I /usr/include/mysql -march=native
LDFLAGS=-g

#CFLAGS=-c -O2 -I /usr/include/mysql
#LDFLAGS=-O2

LDLIBS=-lstdc++

SOURCES=blocknotify.cpp

OBJECTS=$(SOURCES:.cpp=.o)
OUTPUT=blocknotify

all: $(SOURCES) $(OUTPUT)

install: all
strip -s $(OUTPUT)
mv $(OUTPUT) ../bin/

clean:
rm -f *.o
rm -f $(OUTPUT)
Loading