Great info found here, it has helped me get rolling on creating the new files for OSC - OpenSourceCoin. (ocoin)
https://github.com/bryceweiner/OSC/tree/master/srcI'd like to run a "solo" P2Pool with my AntMiner S1's mining OSC, but I have not been able to find a fork that had anything for ocoin.
Here is what I have so far:
p2pool\networks\ocoin.py :from p2pool.bitcoin import networks
PARENT = networks.nets['ocoin']
SHARE_PERIOD = 20 # seconds
CHAIN_LENGTH = 24*60*60//10 # shares
REAL_CHAIN_LENGTH = 24*60*60//10 # shares
TARGET_LOOKBEHIND = 60 # shares
SPREAD = 30 # blocks
IDENTIFIER = ''.decode('hex')
PREFIX = ''.decode('hex')
P2P_PORT = 9512
MIN_TARGET = 0
MAX_TARGET = 2**256//2**32 - 1
PERSIST = False
WORKER_PORT = 19512
BOOTSTRAP_ADDRS = ''.split(' ')
ANNOUNCE_CHANNEL = '#p2pool-alt'
VERSION_CHECK = lambda v: True
p2pool\bitcoin\networks\ocoin.py :import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = 'e4e8e9e5'.decode('hex')
P2P_PORT = 28532
ADDRESS_VERSION = 2
RPC_PORT = 38532
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'Ocoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
))
SUBSIDY_FUNC = lambda height: 25*100000000 >> (height * 1)//400000
POW_FUNC = data.hash256
BLOCK_PERIOD = 12 # s
SYMBOL = 'OSC'
CONF_FILE_FUNC = lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Ocoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/ocoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.ocoin'), 'ocoin.conf')
BLOCK_EXPLORER_URL_PREFIX = ''
ADDRESS_EXPLORER_URL_PREFIX = ''
TX_EXPLORER_URL_PREFIX = ''
SANE_TARGET_RANGE = (2**256//2**32//1000 - 1, 2**256//2**32 - 1)
DUMB_SCRYPT_DIFF = 1
DUST_THRESHOLD = 0.001e8
\AppData\Roaming\Ocoin\ocoin.conf :
server=1
listen=1
daemon=1
rpcuser=user
rpcpassword=x
rpcallowip=*
rpcport=38532
port=28532
gen=0
The P2Pool starts and connects, but scrolls a few error messages highlighted in bold below: (I've gone ahead and removed a lot of the repetitive errors)
C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master>run_p2pool.py --net ocoin --give-author 0.0 --no-bugreport --disable-upnp --address thWXobKDyMGVmK4UHwDdhgJSo1qX93ZTT
2014-10-25 10:51:28.412000 p2pool (version unknown 7032706f6f6c2d7261762d6d6173746572)
2014-10-25 10:51:28.415000
2014-10-25 10:51:28.416000 Testing bitcoind RPC connection to 'http://127.0.0.1:38532/' with username 'user'...
2014-10-25 10:51:28.550000 ...success!
2014-10-25 10:51:28.551000 Current block hash: 8db7f2d43d630b2e3fd334ce306457ca45329a5aec1066e3e490
2014-10-25 10:51:28.551000 Current block height: 578450
2014-10-25 10:51:28.552000
2014-10-25 10:51:28.553000 Testing bitcoind P2P connection to '127.0.0.1:28532'...
2014-10-25 10:51:28.659000 ...success!
2014-10-25 10:51:28.660000
2014-10-25 10:51:28.661000 Determining payout address...
2014-10-25 10:51:28.662000 ...success! Payout address: thWXobKDyMGVmK4UHwDdhgJSo1qX93ZTT
2014-10-25 10:51:28.663000
2014-10-25 10:51:28.663000 Loading shares...
2014-10-25 10:51:28.664000 ...done loading 0 shares (0 verified)!
2014-10-25 10:51:28.665000
2014-10-25 10:51:28.666000 Initializing work...
2014-10-25 10:51:28.803000 ...success!
2014-10-25 10:51:28.805000
2014-10-25 10:51:28.806000 Joining p2pool network using port 9512...
2014-10-25 10:51:28.813000 ...success!
2014-10-25 10:51:28.814000
2014-10-25 10:51:28.815000 Listening for workers on '' port 19512...
2014-10-25 10:51:29 ...success!
2014-10-25 10:51:29.001000
2014-10-25 10:51:29.002000 Started successfully!
2014-10-25 10:51:29.002000 Go to http://127.0.0.1:19512/ to view graphs and statistics!
2014-10-25 10:51:29.004000 Donating 0.0% of work towards P2Pool's development. Please donate to encourage further development of P2Pool!
2014-10-25 10:51:29.004000
2014-10-25 10:51:29.050000 > Unhandled Error
2014-10-25 10:51:29.051000 > Traceback (most recent call last):
2014-10-25 10:51:29.052000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\run_p2pool.py", line 5, in
2014-10-25 10:51:29.052000 > main.run()
2014-10-25 10:51:29.053000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\main.py", line 595, in run
2014-10-25 10:51:29.053000 > reactor.run()
2014-10-25 10:51:29.056000 > File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1192, in run
2014-10-25 10:51:29.056000 > self.mainLoop()
2014-10-25 10:51:29.057000 > File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1201, in mainLoop
2014-10-25 10:51:29.059000 > self.runUntilCurrent()
2014-10-25 10:51:29.061000 > --- ---
2014-10-25 10:51:29.065000 > File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 824, in runUntilCurrent
2014-10-25 10:51:29.070000 > call.func(*call.args, **call.kw)
2014-10-25 10:51:29.078000 > File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 425, in resolveAddress
2014-10-25 10:51:29.081000 > self._setRealAddress(self.addr)
2014-10-25 10:51:29.083000 > File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 440, in _setRealAddress
2014-10-25 10:51:29.086000 > self.doConnect()
2014-10-25 10:51:29.094000 > File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 569, in doConnect
2014-10-25 10:51:29.255000 > connectResult = self.socket.connect_ex(self.realAddress)
2014-10-25 10:51:29.258000 > File "C:\Python27\lib\socket.py", line 224, in meth
2014-10-25 10:51:29.260000 > return getattr(self._sock,name)(*args)
2014-10-25 10:51:29.262000 > [b]exceptions.OverflowError: getsockaddrarg: port must be 0-65535.[/b]
2014-10-25 10:51:32.005000 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-10-25 10:51:40.144000 > Unhandled Error
2014-10-25 10:51:40.147000 > Traceback (most recent call last):
2014-10-25 10:51:40.149000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\run_p2pool.py", line 5, in
2014-10-25 10:51:40.152000 > main.run()
2014-10-25 10:51:40.156000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\main.py", line 595, in run
2014-10-25 10:51:40.162000 > reactor.run()
2014-10-25 10:51:40.168000 > File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1192, in run
2014-10-25 10:51:40.170000 > self.mainLoop()
2014-10-25 10:51:40.173000 > File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1201, in mainLoop
2014-10-25 10:51:40.177000 > self.runUntilCurrent()
2014-10-25 10:51:40.184000 > --- ---
2014-10-25 10:51:40.189000 > File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 824, in runUntilCurrent
2014-10-25 10:51:40.194000 > call.func(*call.args, **call.kw)
2014-10-25 10:51:40.196000 > File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 425, in resolveAddress
2014-10-25 10:51:40.199000 > self._setRealAddress(self.addr)
2014-10-25 10:51:40.205000 > File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 440, in _setRealAddress
2014-10-25 10:51:40.207000 > self.doConnect()
2014-10-25 10:51:40.209000 > File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 569, in doConnect
2014-10-25 10:51:40.213000 > connectResult = self.socket.connect_ex(self.realAddress)
2014-10-25 10:51:40.217000 > File "C:\Python27\lib\socket.py", line 224, in meth
2014-10-25 10:51:40.222000 > return getattr(self._sock,name)(*args)
2014-10-25 10:51:40.239000 > [b]exceptions.OverflowError: getsockaddrarg: port must be 0-65535.[/b]
2014-10-25 10:51:46.750000 > Unhandled Error
2014-10-25 10:52:20.558000 > Traceback (most recent call last):
2014-10-25 10:52:20.561000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\main.py", line 595, in run
2014-10-25 10:52:20.571000 > reactor.run()
2014-10-25 10:52:20.575000 > File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1192, in run
2014-10-25 10:52:20.578000 > self.mainLoop()
2014-10-25 10:52:20.580000 > File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1201, in mainLoop
2014-10-25 10:52:20.583000 > self.runUntilCurrent()
2014-10-25 10:52:20.587000 > File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 824, in runUntilCurrent
2014-10-25 10:52:20.592000 > call.func(*call.args, **call.kw)
2014-10-25 10:52:20.596000 > --- ---
2014-10-25 10:52:20.600000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\bitcoin\stratum.py", line 38, in _send_work
2014-10-25 10:52:20.604000 > x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
2014-10-25 10:52:20.609000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\bitcoin\worker_interface.py", line 129, in get_work
2014-10-25 10:52:20.612000 > x, handler = self._inner.get_work(*args)
2014-10-25 10:52:20.616000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\work.py", line 310, in get_work
2014-10-25 10:52:20.620000 > base_subsidy=self.node.net.PARENT.SUBSIDY_FUNC(self.current_work.value['height']),
2014-10-25 10:52:20.655000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\data.py", line 222, in generate_transaction
2014-10-25 10:52:20.656000 > script='\x6a\x28' + cls.get_ref_hash(net, share_info, ref_merkle_link) + pack.IntType(64).pack(last_txout_nonce),
2014-10-25 10:52:20.659000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\data.py", line 246, in get_ref_hash
2014-10-25 10:52:20.664000 > share_info=share_info,
2014-10-25 10:52:20.667000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\util\pack.py", line 74, in pack
2014-10-25 10:52:20.676000 > data = self._pack(obj)
2014-10-25 10:52:20.678000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\util\pack.py", line 52, in _pack
2014-10-25 10:52:20.680000 > f = self.write(None, obj)
2014-10-25 10:52:20.683000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\util\pack.py", line 301, in write
2014-10-25 10:52:20.688000 > file = type_.write(file, item[key])
2014-10-25 10:52:20.692000 > File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool-rav-master\p2pool\util\pack.py", line 327, in write
2014-10-25 10:52:20.697000 > raise ValueError('incorrect length item!')
2014-10-25 10:52:20.700000 > [b]exceptions.ValueError: incorrect length item![/b]
2014-10-25 10:52:24.033000 > Unhandled Error
2014-10-25 10:52:38.053000 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-10-25 10:52:38.054000 Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???
The block reward structure is as follows (It is now currently paying 12.50 OSC per block):
// miner's coin base reward based on nBits
int64 GetProofOfWorkReward(int nHeight, int64 nFees, uint256 prevHash)
{
static const int64 nMinimumCoin = 0.0777 * COIN;
int64 nSubsidy = 0.0777 * COIN; //genesis
if (nHeight > 0 && nHeight < 7) {nSubsidy = 0 * COIN;} // zero
else if (nHeight == 7) {nSubsidy = 177777 * COIN;} // Premine
else if (nHeight > 7 && nHeight < 1000) {nSubsidy = 2.5 * COIN;} // IRC Launch
else if (nHeight > 1000 && nHeight < 1337) {nSubsidy = 0.0777 * COIN;} // low instamine official launch
else if (nHeight == 1337) {nSubsidy = 1337 * COIN;} //L33T
else if (nHeight > 1337 && nHeight < 4000) {nSubsidy = 1 * COIN;} //final launch period
else if (nHeight > 4000 && nHeight < 8000) {nSubsidy = 22.5 * COIN;} // 22.5 coin
else if (nHeight > 8000 && nHeight < 16000) {nSubsidy = 15 * COIN;} // 15 coins per block
else if (nHeight > 16000 && nHeight < 32000) {nSubsidy = 7.5 * COIN;} // 7.5 coins per block
else if (nHeight > 32000 && nHeight < 64000) {nSubsidy = 6 * COIN;} // 6 coins per block
else if (nHeight > 64000 && nHeight < 77777) {nSubsidy = 4 * COIN;} // 4 coins
else if (nHeight == 77777) {nSubsidy = 10000 * COIN;} // bonus reward
else if (nHeight > 77777 && nHeight < 128000) {nSubsidy = 4 * COIN;} // 4 coins
else if (nHeight > 128000 && nHeight < 256000) {nSubsidy = 20 * COIN;} // 20 coins
else if (nHeight > 256000) {nSubsidy = 25 * COIN;} // 25 coins
else if (nHeight > 2400000) {nSubsidy = 5 * COIN;}
else {nSubsidy = 1 * COIN;}
// Subsidy is cut in half every 400 thousand blocks
nSubsidy >>= (nHeight / 400000);
Any help would be greatly appreciated. FYI, I used the files from another coin which works fine (XJO - Joulecoin) as a template to make the files for OSC.
Thanks!