Pages:
Author

Topic: [AlcheMiner] Sold out! (Read 3652 times)

legendary
Activity: 1274
Merit: 1000
July 27, 2015, 02:20:59 PM
#26
260$ shipping fee  Shocked (shipping from Mars ?)

hey they still get there money and sold it for four digits. Don't know who they think they are fooling it don't cost that much to ship it .


what a joke Smiley.


but it's sold out now, maybe the A3 and A4 coming will  blow this a way.I all most bought one and i was going to deal with the power usages then shipping was over the edge.

What are these 'A3/A4' chips? Is there a spec, where do I order samples

I just read very little on the bitcoin from under this https://bitcointalksearch.org/topic/ann-sfardssf100-the-first-28nm-dual-mode-miner-is-accepting-pre-order-now-985400  i think at the last two pages or so . not much said but A4 is script and A3 SHa256 . I really  haven't looked to much beyond that i know at first i can't afford it but if i wait a few months or so i can. but i also believe there is more in this thread to https://bitcointalksearch.org/topic/innosilicon-official-reponse-to-bitmine-bankruptcy-let-the-evidence-talk-1117069 Smiley. it's hear say why I didn't say any more then i did .

A2 prices are starting to come down more i notice so some thing is up . again I'm not really sure how true it is but it makes sense the way thing seem to be going price wise for the older stuff.

here is the actual word of the guy that said it  https://bitcointalksearch.org/topic/m.11962285  Smiley .


and this a real miner coming i believe that might be using those chips as well some one in that thead is tiring to find out more .


https://bitcointalk.org/index.php?topic=1128816.40  again it is only hear say, i  should have said it a diff way, wasn't thinking when I said it, my bad.
sr. member
Activity: 271
Merit: 254
July 26, 2015, 01:05:15 PM
#25
260$ shipping fee  Shocked (shipping from Mars ?)

hey they still get there money and sold it for four digits. Don't know who they think they are fooling it don't cost that much to ship it .


what a joke Smiley.


but it's sold out now, maybe the A3 and A4 coming will  blow this a way.I all most bought one and i was going to deal with the power usages then shipping was over the edge.

What are these 'A3/A4' chips? Is there a spec, where do I order samples
legendary
Activity: 1274
Merit: 1000
July 26, 2015, 12:15:13 PM
#24
260$ shipping fee  Shocked (shipping from Mars ?)

hey they still get there money and sold it for four digits. Don't know who they think they are fooling it don't cost that much to ship it .


what a joke Smiley.


but it's sold out now, maybe the A3 and A4 coming will  blow this a way.I all most bought one and i was going to deal with the power usages then shipping was over the edge.
sr. member
Activity: 271
Merit: 254
July 26, 2015, 10:36:39 AM
#23
Hi miners,

Thank you for your purchasing our miners.
We sold our last miner in stock last month.
Many customers asked me to make new batch.
But we don't have plan to make new batch until this moment.
The conditions are quite tough.
*4.5+ month lead time
*$2,500 USD for an Alchemist256
*min order: 150
*100% payment in advance
If you could accept the conditions, mail us.

Also, we are considering to sell all our technologies, including mask, pcb design and so on.
You could also mail to [email protected]

How much do I need to crowdfund to buy the silicon mask & PCB and release it as open source?
newbie
Activity: 13
Merit: 0
July 04, 2015, 08:36:06 PM
#22
That's too bad, wasn't aware of these for the last batch.
member
Activity: 106
Merit: 10
July 04, 2015, 12:46:08 PM
#21
Hi miners,

Thank you for your purchasing our miners.
We sold our last miner in stock last month.
Many customers asked me to make new batch.
But we don't have plan to make new batch until this moment.
The conditions are quite tough.
*4.5+ month lead time
*$2,500 USD for an Alchemist256
*min order: 150
*100% payment in advance
If you could accept the conditions, mail us.

Also, we are considering to sell all our technologies, including mask, pcb design and so on.
You could also mail to [email protected]
legendary
Activity: 1270
Merit: 1000
July 01, 2015, 12:55:13 PM
#20

As our hosting contract ends, we have ~ 30 units of Alchemists for special sale with limited quantity!
They were used for merely a month, look brand new, and are still very robust!
 
-          US $599 per used Alchemist ( + $260 shipping fee)
-          Used for a month
-          Two-month warranty
-          Limited quantity: 30 units only

I pay now. Are you ready?  Undecided

I think that ship has sailed. I too would like to purchase one of those used Alchemists or even a new one if available.
legendary
Activity: 2030
Merit: 1076
A humble Siberian miner
July 01, 2015, 06:15:58 AM
#19

As our hosting contract ends, we have ~ 30 units of Alchemists for special sale with limited quantity!
They were used for merely a month, look brand new, and are still very robust!
 
-          US $599 per used Alchemist ( + $260 shipping fee)
-          Used for a month
-          Two-month warranty
-          Limited quantity: 30 units only

I pay now. Are you ready?  Undecided
hero member
Activity: 686
Merit: 500
May 31, 2015, 03:23:39 AM
#18
Limited Special Sale: US $599 only for Alchemist 256!!!
 
As our hosting contract ends, we have ~ 30 units of Alchemists for special sale with limited quantity!
They were used for merely a month, look brand new, and are still very robust!
 
-          US $599 per used Alchemist ( + $260 shipping fee)
-          Used for a month
-          Two-month warranty
-          Limited quantity: 30 units only
 
Seize this unbelievable opportunity! Happy mining!!!

More detail, please find https://www.alcheminer.com

I'll buy two if you put the source code for the firmware, data sheet for the asic, and a block diagram of the system layout on your web site.

If you want to keep that information proprietary I will be happy to do a firmware development in exchange for hardware.

I have seen the source code of the miner, you can just ssh into it and change it. Is written in Python (to large to copy, paste so just part of it):
Code:
#! /usr/bin/python

import time
import json
import base64
import httplib
import sys
import os
import os.path
import binascii
import subprocess
from crypt import crypt
import rdf022
import Queue
from serial import Serial
from threading import Thread, Event
from config import ArgsConfig, AsicConfig
from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
from twisted.internet.serialport import SerialPort
from twisted.protocols.basic import LineReceiver
import binascii
import socket
import requests
from requests.auth import HTTPBasicAuth

VERSION = '1.1.4'

#------- hw.py --------
#from serial import Serial
#import subprocess
#from time import sleep
#import binascii

MAX_BOARDS = 8
MAX_CHIPS = 32
MAX_CLUSTERS = 6
MAX_CORES = 9

g_tail = '00000000000000000000000000000000a78e0100000001000000f615f7ce3b4fc6b8f61e8f89aedb1d0852507650533a9e3b10b9bbcc30639f279fcaa86746e1ef52d3edb3c4ad8259920d509bd073605c9bf1d59983752a6b06b817bb4ea78e011d012d59d4'

class AsicBoard(object):

    def __init__(self, com_port, reset_gpio, prt):
        self.comport_mode = 0               # comport_mode: 0 for synchronous, 1 for asynchronous
        self.com_port = com_port
        self.reset_gpio = reset_gpio
        self.prt = prt
        self.asic = \
        {
            '00': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '01': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '02': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '03': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '04': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '05': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '06': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '07': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '08': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '09': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '0a': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '0b': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '0c': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '0d': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '0e': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '0f': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '10': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '11': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '12': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '13': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '14': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '15': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '16': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '17': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '18': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '19': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '1a': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '1b': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '1c': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '1d': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '1e': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000},
            '1f': {'00':0x0000, '01':0x0000, '02':0x0000, '03':0x0000, '04':0x0000, '05':0x0000}
        }
        self.good_cores = 0
        self.bad_cores = 0

    def set_comport_sync_mode(self):
        self.comport_mode = 0

    def set_comport_async_mode(self):
        self.comport_mode = 1

    def write_by_hex(self, data):
        if (self.comport_mode == 0):
            self.com_port.write(data.decode('hex')[::-1])
        else:
            reactor.callFromThread(AlcheProtocol.sendLine, self.prt, data.decode('hex')[::-1])

    def reset(self):
        return subprocess.call(['sh', 'reset_board', self.reset_gpio], shell=False)

    def flush(self, count):
        resp = self.com_port.read(count)               # max 10 bytes x 32 chips x 6 cluster = 1920 bytes
        while len(resp) > 0:
            resp = self.com_port.read(count)

    # setup all asics to run on PLL @ 360Mhz
    def set_pll(self):
        for chp in sorted(self.asic):
            payload = '%s'%chp + 'ff000100000000400c00' + g_tail
            self.write_by_hex(payload)
            time.sleep(0.02)
            payload = '%s'%chp + 'ff0001000000a0620c00' + g_tail
            self.write_by_hex(payload)
            time.sleep(0.02)
            payload = '%s'%chp + 'ff0001000000a0220400' + g_tail
            self.write_by_hex(payload)
            time.sleep(0.02)
            payload = '%s'%chp + 'ff0001000000a0220000' + g_tail
            self.write_by_hex(payload)
            ''' # Overdrive 10%
            payload = '%s'%chp + 'ff000100000000400c00' + g_tail
            self.write_by_hex(payload)
            time.sleep(0.02)
            payload = '%s'%chp + 'ff000100000060410c00' + g_tail
            self.write_by_hex(payload)
            time.sleep(0.02)
            payload = '%s'%chp + 'ff000100000060110400' + g_tail
            self.write_by_hex(payload)
            time.sleep(0.02)
            payload = '%s'%chp + 'ff000100000060110000' + g_tail
            self.write_by_hex(payload)
            '''
    def set_all_idle(self):
        payload = 'ffff0001000000a0220200' + g_tail
        self.write_by_hex(payload)

    def set_all_active(self):
        payload = 'ffff0001000000a0220000' + g_tail
        self.write_by_hex(payload)

    def calc_asic_cores(self, scan):
        self.good_cores = 0
        self.bad_cores = 0

        if scan:
            for chp in sorted(self.asic):
                for clst in self.asic[chp]:
                    self.asic[chp][clst] = 0x0000
            for chp in sorted(self.asic):
                print 'Scanning ASIC %s...' % chp
                # set diagnosis mode
                payload = chp + 'ff0001000000a0220100' + g_tail
                self.write_by_hex(payload)
                # give golden sample work, expect 'ecff6386ebd9'
                # (chp | 0x80) only for diagnosis mode -- allow all answers get returned
                cc = '%02x' % (int(chp, 16) + 128)
                payload = cc + '0000000000000000000000000000000000000000000000000000a78e0100000001000000f615f7ce3b4fc6b8f61e8f89aedb1d0852507650533a9e3b10b9bbcc30639f279fcaa86746e1ef52d3edb3c4ad8259920d509bd073605c9bf1d59983752a6b06b817bb4ea78e011d012d59d4'
                self.write_by_hex(payload)
                cnt = 0
                while True:
                    resp = self.com_port.read(9)
                    if len(resp) == 9:
                        _chpid = resp[8].encode('hex')
                        if (_chpid > '1f'):
                            print 'chpid err!'
                        _clsid = resp[7].encode('hex')
                        if (_clsid > '05'):
                            print 'clsid err!'
                        _corid = ord(resp[6])
                        if (_corid > 8):
                            print 'corid err!'
                        _nonce = resp[3::-1].encode('hex')
                        #core_status = _nonce in 'ecff6386ebd9'
                        core_status = _nonce in '6386ebd9'
                        if core_status:
                            self.good_cores += 1
                            #print 'Good: %d, %d, %d' % (_chpid, _clsid, _corid)
                            self.asic[_chpid][_clsid] |= (1 << _corid)
                        else:
                            self.bad_cores += 1
                            print 'Bad: %s, %s, %s, %d' % (_nonce, _chpid, _clsid, _corid)

                        cnt = 0
                    cnt += 1
                    if (cnt > 5):
                        break
        else:
            #print self.asic
            for _chpid in self.asic:
                for _clsid in self.asic[_chpid]:
                    mask = 0x0100
                    while mask > 0:
                        if ((self.asic[_chpid][_clsid] & mask) != 0):
                            self.good_cores += 1
                        else:
                            self.bad_cores += 1
                        mask >>= 1

    def config_workspace(self, start_of_nonce, multiple):
        n_offset = start_of_nonce
        for chp in sorted(self.asic):
            # setup nonce incremental = 0x0001
            payload = ('%s' % chp) + 'ff0001000000a0220000' + g_tail
            time.sleep(0.01)
            self.write_by_hex(payload)

            for clst in sorted(self.asic[chp]):
                gc = 0
                offset = '%08x' % n_offset
                cores = '%04x' % self.asic[chp][clst]
                payload = '%sfe%s%s%s' % \
                          (chp, clst, \
                           offset.decode('hex')[::-1].encode('hex'), \
                           cores.decode('hex')[::-1].encode('hex')) + \
                          '00'*104
                self.write_by_hex(payload)
                #print '>>> %s' % payload
                core_mask = self.asic[chp][clst]
                for i in range(0, 15, 1):
                    if (core_mask & 0x0001):
                        gc += 1
                    core_mask >>= 1
                n_offset += multiple * gc


    def rev_per_4bytes(self, data):
        x = ''
        for i in range (0, len(data), 8):
            x += data[i+6:i+8] + data[i+4:i+6] + data[i+2:i+4] + data[i:i+2]
        return x

    def give_work(self, chip, target, block):
        header_hex = self.swap4(block[0:160])
        payload = chip + target + header_hex
        #self.write_by_hex(payload)
        return payload.decode('hex')[::-1]

    def swap4(self, binascii_str):
        str = binascii.unhexlify(binascii_str)
        x = len(str) / 4
        rev = ''.join([ str[i*4:i*4+4][::-1] for i in range(0, x) ])
        return binascii.hexlify(rev)

    def revall(self, binascii_str):
        str = binascii.unhexlify(binascii_str)
        rev = str[::-1]
        return binascii.hexlify(rev)



#------- hw.py --------

SUBMIT_Q_THROTTLE = 30
WEB_REFRESH_TIME = 5
LCM_REFRESH_TIME = 5
REFRESH_KHRATE_TIME = 5
STRATUM_CHK_INTERVAL = 30

rst = {'00':None, '01':None, '02':None, '03':None, '04':None, '05':None, '06':None, '07':None}
com = {'00':None, '01':None, '02':None, '03':None, '04':None, '05':None, '06':None, '07':None}
brd = {'00':None, '01':None, '02':None, '03':None, '04':None, '05':None, '06':None, '07':None}
pool_ctrl = {'00':None, '01':None, '02':None, '03':None, '04':None, '05':None, '06':None, '07':None}
alche_protocol = {'00':None, '01':None, '02':None, '03':None, '04':None, '05':None, '06':None, '07':None}
ans_queue = {'00':None, '01':None, '02':None, '03':None, '04':None, '05':None, '06':None, '07':None}

active_brd_num = 0
active_brd = []

miner_ctrl = Event()
for p in pool_ctrl:
    pool_ctrl[p] = Event()
submitter_ctrl = Event()
stat_reset = Event()

stratum_proxy_isRunning = False
ws_client = []

lcm = rdf022.get_lcm()
def lcm_disp(msg):
    msgs = ('IP:'+rdf022.get_ip(), msg)
    lcm.messages = msgs
    lcm.refresh()

class CoinRPC(object):
    def __init__(self, host, port, username, password):
        self.host = host
        self.port = port
        self.username = username
        self.password = password
        self.url = 'http://' + self.host + ':' + self.port

    def reconnect(self, host, port, username, password):
        self.host = host
        self.port = port
        self.username = username
        self.password = password        
        self.url = 'http://' + self.host + ':' + self.port

    def getwork(self, data=None):
        payload = { 'version':'1.1', 'method':'getwork', 'params':[], 'id':'1' }

        payload['params'] = ([] if (data is None) else data)

        try:
            r = requests.post(self.url, \
                                auth=HTTPBasicAuth(self.username, self.password), \
                                data=json.dumps(payload), \
                                timeout=30)
            resp = r.json()
            if (resp['error'] is not None):
                print '-- RPC error!'
                print r.text
                return None
            else:
                return resp['result']

        except requests.ConnectionError:
            print '-- HTTP connection error!'
            return None

        except requests.Timeout:
            print '-- HTTP connection timeout!'
            return None

        except Exception as e:
            print '-- RPC general error!'
            print e
            return None

class Submitter(Thread):
    def __init__(self):
        Thread.__init__(self)
        self.daemon = True
        self.coin_rpc = CoinRPC(config.host, config.port, config.username, config.password)

    def run(self):
        while True:
            if submitter_ctrl.isSet():
                submitter_ctrl.clear()

            (bid, data, target, nonce_bin) = submit_queue.get()
            print '  -- Q (%d) --' % submit_queue.qsize()
            nonce = nonce_bin[::-1].encode('hex')
            solution = data[:152] + nonce + data[160:256]
            param_arr = [ solution ]

            submit_result = None
            for i in range(5):
                submit_result = self.coin_rpc.getwork(param_arr)
                if (submit_result is not None):
                    hash_queue.put((bid, submit_result, target, nonce_bin))
                    break
                else:
                    self.coin_rpc.reconnect(config.host, config.port, config.username, config.password)
                    print '** submit reconnect... **'
                    time.sleep(0.1)

            submit_queue.task_done()
            time.sleep(0.05)

class AlcheProtocol(LineReceiver):
    def __init__(self, bid):
        self.bid = bid
        self._busyReceiving = False
        self._buffer = b''

    def connectionMade(self):
        print self.bid + ' connected in AlcheProtocol.'
        #self.delimiter = b''

    def sendLine(self, line):
        return self.transport.write(line)

    def dataReceived(self, data):
        if self._busyReceiving:
            self._buffer += data
            return
        try:
            self._busyReceiving = True
            self._buffer += data
            while self._buffer and not self.paused:
                if (len(self._buffer) >= 9):
                    line = self._buffer[0:9]
                    self._buffer = self._buffer[9:]
                    why = self.ansReceived(line)
                    if (why or self.transport and self.transport.disconnecting):
                        return why
                else:
                    return
        finally:
            self._busyReceiving = False  

    def ansReceived(self, data):
        ans_queue[self.bid].put(data)

class Miner(Thread):
    def __init__(self, bid, board, arg_config, alcheprotocol):
        Thread.__init__(self)
        self.bid = bid
        self.daemon = True
        self.brd = board
        self.config = arg_config
        self.time_start = time.time()
        self.work_timeout = 3
        self.targetstr = ''
        self.diff = 1
        self.alche_protocol = alcheprotocol
        self.coin_rpc = CoinRPC(config.host, config.port, config.username, config.password)

    def do_work(self, datastr, targetstr):
        if (targetstr != self.targetstr):
            self.targetstr = targetstr
            self.diff = 0x0000ffff00000000 / long(targetstr[48:64].decode('hex')[::-1].encode('hex'), 16)
            #self.work_timeout = self.diff * 65536 / 1000000 / 32
            self.work_timeout = self.diff * 3.54 / brd[self.bid].good_cores
            if (self.work_timeout < 8):
                self.work_timeout = 8
        t = '0' * 48 + targetstr[48:64]
        payload = self.brd.give_work('ff', t, datastr)
        print '--(%s)-- diff: %0.2f, work_timeout: %0.2f' % (self.bid, self.diff, self.work_timeout)
        self.time_start = time.time()
        reactor.callFromThread(AlcheProtocol.sendLine, self.alche_protocol, payload)

        try:
            data = ans_queue[self.bid].get(timeout=self.work_timeout)
            dt = time.time() - self.time_start
            if (data == 'ffffffffffffffffff'):
                print '==(%s)== clean job! <%0.2f>' % (self.bid, dt)
                com_resp = ''
            else:
                print '==(%s)== %s <%0.2f>' % (self.bid, data.encode('hex'), dt)
                com_resp = data
        except Queue.Empty:
            com_resp = ''

        return com_resp[:4]

    def iterate(self):
        work = None
        for i in range(5):
            work = self.coin_rpc.getwork()
            if (work is not None):
                break
        if work is None:
            print 'ERR: Work is None'
            return False

        nonce_bin = self.do_work(work['data'], work['target'])

        if len(nonce_bin) == 4:
            submit_queue.put((self.bid, work['data'], work['target'], nonce_bin))
            if (submit_queue.qsize() > SUBMIT_Q_THROTTLE):
                print '...Nap for %0.2f sec...' % (active_brd_num * submit_queue.qsize() / SUBMIT_Q_THROTTLE)
                time.sleep(active_brd_num * submit_queue.qsize() / SUBMIT_Q_THROTTLE)

        return True

    def run(self):

        iterate_result = False

        while True:
            miner_ctrl.wait()
            if pool_ctrl[self.bid].isSet():
                iterate_result = False
                pool_ctrl[self.bid].clear()
            if (iterate_result == False):
                self.coin_rpc.reconnect(config.host, config.port, config.username, config.password)
            iterate_result = self.iterate()

class Stat(Thread):
    def __init__(self):
        Thread.__init__(self)
        self.daemon = True
        self.acc_kh = {'00':0.00, '01':0.00, '02':0.00, '03':0.00, '04':0.00, '05':0.00, '06':0.00, '07':0.00}
        self.khrate = {'00':0.00, '01':0.00, '02':0.00, '03':0.00, '04':0.00, '05':0.00, '06':0.00, '07':0.00, 'accepted':0, 'rejected':0, 'since':0}
        self.total_accepted = 0
        self.total_rejected = 0
        self.miner_stt_time = time.time()
        self.reset_stt_time()

    def reset_stt_time(self):
        self.miner_stt_time = time.time()
        self.khrate['since'] = self.miner_stt_time

    def reset_stat(self):
        for b in ['00', '01', '02', '03', '04', '05', '06', '07']:
            self.acc_kh[b] = 0.00
            self.khrate[b] = 0.00
        self.khrate['accepted'] = 0
        self.khrate['rejected'] = 0
        self.total_accepted = 0
        self.total_rejected = 0
        self.reset_stt_time()

    def refresh_khrate(self):
        for i in ['00', '01', '02', '03', '04', '05', '06', '07']:
            self.khrate[i] = self.acc_kh[i] / (time.time() - self.miner_stt_time)

    def run(self):
        while True:
            (bid, sr, tgt, nnc_bin) = hash_queue.get()

            diff = 0x0000ffff00000000 / long(tgt[48:64].decode('hex')[::-1].encode('hex'), 16)
            _acc_kh = self.acc_kh[bid]
            _acc_kh += diff * 65.536 * 1
            self.acc_kh[bid] = _acc_kh
            self.khrate[bid] = _acc_kh / (time.time() - self.miner_stt_time)

            if sr:
                self.total_accepted += 1
                self.khrate['accepted'] = self.total_accepted
            else:
                self.total_rejected += 1
                self.khrate['rejected'] = self.total_rejected

            hash_queue.task_done()




class StratumProxy(object):
    def __init__(self):
        self.proxy = None
        self.isRunning = False
        self.stratum_host = None
        self.stratum_port = None

    def get_params(self):
        return (self.stratum_host, self.stratum_port)

    def start(self, stratum_host, stratum_port, getwork_port, username, password):
        self.stratum_host = stratum_host
        self.stratum_port = stratum_port

        if not self.isRunning:
            if ('ghash.io' in stratum_host):
                self.proxy = subprocess.Popen(['/usr/bin/python', 'stratum-mining-proxy/mining_proxy.py', \
                                                '-o', stratum_host, '-p', stratum_port, '-gp', getwork_port , \
                                                '-cu', username, '-cp', password, '-pa', 'scrypt', \
                                                '-nm', '-q'], stdout=subprocess.PIPE, shell=False)
            else:
                self.proxy = subprocess.Popen(['/usr/bin/python', 'stratum-mining-proxy/mining_proxy.py', \
                                                '-o', stratum_host, '-p', stratum_port, '-gp', getwork_port , \
                                                '-cu', username, '-cp', password, '-pa', 'scrypt', \
                                                '-nm', '-cd', '-q'], stdout=subprocess.PIPE, shell=False)
            self.isRunning = True

    def stop(self):
        if self.isRunning:
            self.proxy.kill()
            os.wait()
            self.isRunning = False


class WebUIProtocol(WebSocketServerProtocol):
    def __init__(self):
        self.command_option = {'version': self.web_version, \
                               'login': self.web_login, \
                               'control': self.web_control, \
                               'hashrate': self.web_hashrate, \
                               'pool_config': self.web_pool_config, \
                               'host_config': self.web_host_config, \
                               'access_ctrl': self.web_access_ctrl, \
                               'upgrade': self.web_upgrade, \
                               'diag_report': self.web_diag_report, \
                               'clean_job': self.clean_job
                              }
        self.stratum_proxy = None

    def onConnect(self, request):
        print 'Connecting...'

    def onOpen(self):
        if (self.transport.getPeer().host != '127.0.0.1'):
            ws_client.append(self)
        print 'Opening...[%s]' % self.transport.getPeer().host

    def onClose(self, wasClean, code, reason):
        try:
            ws_client.remove(self)
        except ValueError:
            pass
        print 'Close...[%s]' % self.transport.getPeer().host

    def onMessage(self, data, isBinary):
        #if (data == 'hashrate'):
        #    self.sendMessage(json.dumps(global_khrate), isBinary=False)
        try:
            web_req = json.loads(data)
            if (web_req == None):
                print 'Unrecognized command!'
            mtd = web_req['method']
            self.command_option[mtd](web_req)
        except Exception, e:
            #print e
            print data
            rsp = {'result':False, 'error':'command error!' + str(e), 'id':'0'}
            print json.dumps(rsp)
            self.sendMessage(json.dumps(rsp))
            return False

    def web_version(self, req):
        ws_client.append(self)
        rsp = {'result':False, 'error':None, 'id':None}
        rsp['id'] = req['id']
        rsp['result'] = VERSION
        self.sendMessage(json.dumps(rsp))

        return

    def web_login(self, req):
        rsp = {'result':False, 'error':None, 'id':None}
        pwd = req['params'][0]
        rsp['id'] = req['id']

        f = open('access_code', 'r')
        crypted_pwd = f.readline().rstrip()
        f.close()
        #print '(%s)(%s)' % (pwd, crypted_pwd)
        if (crypt(pwd, crypted_pwd) == crypted_pwd):
            rsp['result'] = True
        else:
            rsp['result'] = False

        self.sendMessage(json.dumps(rsp))

        return

    def web_control(self, req):
        print 'control...'
        if (req['params'][0] == 'go'):
            config.read_config()
            print '>start...'
            if (config.protocol == 'stratum+tcp:'):
                stratum_host = config.host
                stratum_port = config.port
                config.host = 'localhost'
                config.port = '8332'
                # startup stratum mining proxy
                print '>startup stratum proxy...'
                stratum_proxy.start(stratum_host, stratum_port, config.port, config.username, config.password)
                time.sleep(3)
            # startup miner threads...
            miner_ctrl.set()
        else:
            # stop all miner thread
            miner_ctrl.clear()
            stat_reset.set()
            # set all board to be idle
            for b in sorted(brd):
                brd[b].set_all_idle()
            try:
                print '>stop stratum proxy...'
                stratum_proxy.stop()
            except OSError:
                pass
            # Reset stat
            stat.reset_stat()

        return

    def web_hashrate(self, req):
        print 'report_hashrate...'
        rsp = {'result':False, 'error':None, 'id':None}
        rsp['result'] = json.dumps(global_khrate)
        rsp['id'] = req['id']
        self.sendMessage(json.dumps(rsp))
        return

    def web_pool_config(self, req):
        rsp = {'result':False, 'error':None, 'id':None}

        if len(req['params']) == 0:
            config.read_config()
            rsp['result'] = [config.protocol, config.host, config.port, config.username, config.password]
            rsp['error'] = None
            rsp['id'] = req['id']
            self.sendMessage(json.dumps(rsp))
        else:
            stratum_mtr.stop()
            (protocol, host, port, username, password) = (i for i in req['params'])
            (config.protocol, config.host, config.port, config.username, config.password) = (protocol, host, port, username, password)
            cr = config.save_config()
            if (cr):
                rsp['result'] = ["ok"]
                rsp['error'] = None
                rsp['id'] = req['id']
                self.sendMessage(json.dumps(rsp))
                # Inform all thread to change pool information
                for p in pool_ctrl:
                    pool_ctrl[p].set()
                submitter_ctrl.set()

                # Reset stat
                stat.reset_stat()

                # stop all miner thread
                miner_ctrl.clear()
                stat_reset.set()
                # set all board to be idle
                for b in sorted(brd):
                    brd[b].set_all_idle()
                try:
                    print '>stop stratum proxy...'
                    stratum_proxy.stop()
                except OSError:
                    pass

                time.sleep(1)

                # start all miner thread
                if (config.protocol == 'stratum+tcp:'):
                    stratum_host = config.host
                    stratum_port = config.port
                    config.host = 'localhost'
                    config.port = '8332'
                    # startup stratum mining proxy
                    print '>startup stratum proxy...'
                    stratum_proxy.start(stratum_host, stratum_port, config.port, config.username, config.password)
                    time.sleep(3)
                # startup minter threads...
                miner_ctrl.set()
            stratum_mtr.start(STRATUM_CHK_INTERVAL)

    def web_host_config(self, req):
        rsp = {'result':False, 'error':None, 'id':None}

        if len(req['params']) == 0:
            f = open('/etc/network/interfaces', 'r')
            fif = f.readlines()
            f.close()
            binding = ''
            ipaddr = ''
            netmask = ''
            gateway = ''
            dns = ''
            fixed = False
            for i in fif:
                a = '' if i.lstrip().startswith('#') else i
                if ('dhcp' in a) and ('eth1' in a):
                    binding = 'dhcpc'
                    break
                if ('static' in a) and ('eth1' in a):
                    binding = 'fixedip'
                    fixed = True
                    continue
                if fixed:
                    aa = a.split()
                    for j in range(len(aa)):
                        if 'address' in aa[j]:
                            ipaddr = aa[j+1]
                        if 'netmask' in aa[j]:
                            netmask = aa[j+1]
                        if 'gateway' in aa[j]:
                            gateway = aa[j+1]
                        if 'dns-nameservers' in aa[j]:
                            dns = aa[j+1]
            rsp['result'] = [binding, ipaddr, netmask, gateway, dns]
            rsp['error'] = None
            rsp['id'] = req['id']
            self.sendMessage(json.dumps(rsp))
        else:
            (binding, ipaddr, netmask, gateway, dns) = (i for i in req['params'])
            f = open('/etc/network/interfaces', 'w+')
            f.write('# loopback network interface\n')
            f.write('auto lo\n')
            f.write('iface lo inet loopback\n\n')
            f.write('# primary network interface\n')
            f.write('auto eth1\n')
            if (binding == 'dhcpc'):
                f.write('iface eth1 inet dhcp\n')
            else:
                f.write('iface eth1 inet static\n')
                f.write('address ' + ipaddr + '\n')
                f.write('netmask ' + netmask + '\n')
                f.write('gateway ' + gateway + '\n')
                f.write('dns-nameservers ' + dns + '\n')
            f.close()

            rsp['result'] = ["ok"]
            rsp['error'] = None
            rsp['id'] = req['id']
            self.sendMessage(json.dumps(rsp))

            time.sleep(0.5)
            subprocess.call(['/sbin/ifdown', 'eth1'], shell=False)
            time.sleep(0.5)
            subprocess.call(['/sbin/ifup', 'eth1'], shell=False)

    def web_access_ctrl(self, req):
        rsp = {'result':False, 'error':None, 'id':None}
        print 'access_ctrl...'
        (old_password, new_password) = (req['params'][0], req['params'][1])
        f = open('access_code', 'r')
        crypted_pwd = f.readline().rstrip()
        f.close()
        if (crypt(old_password, crypted_pwd) == crypted_pwd):
            f = open('access_code', 'w')
            new_crypt = crypt(new_password, 'TomSoong')
            f.write(new_crypt + '\n')
            f.close()
            rsp['result'] = ['ok']
        else:
            rsp['result'] = ['wrong']
        rsp['id'] = req['id']
        self.sendMessage(json.dumps(rsp))

        return

    def web_upgrade(self, req):
        print 'upgrade...'
        return
-------------------------
--------------------------
--------------------------
sr. member
Activity: 271
Merit: 254
May 30, 2015, 03:29:40 PM
#17
Limited Special Sale: US $599 only for Alchemist 256!!!
 
As our hosting contract ends, we have ~ 30 units of Alchemists for special sale with limited quantity!
They were used for merely a month, look brand new, and are still very robust!
 
-          US $599 per used Alchemist ( + $260 shipping fee)
-          Used for a month
-          Two-month warranty
-          Limited quantity: 30 units only
 
Seize this unbelievable opportunity! Happy mining!!!

More detail, please find https://www.alcheminer.com

I'll buy two if you put the source code for the firmware, data sheet for the asic, and a block diagram of the system layout on your web site.

If you want to keep that information proprietary I will be happy to do a firmware development in exchange for hardware.
member
Activity: 106
Merit: 10
May 13, 2015, 10:17:00 PM
#16
Limited Special Sale: US $599 only for Alchemist 256!!!
 
As our hosting contract ends, we have ~ 30 units of Alchemists for special sale with limited quantity!
They were used for merely a month, look brand new, and are still very robust!
 
-          US $599 per used Alchemist ( + $260 shipping fee)
-          Used for a month
-          Two-month warranty
-          Limited quantity: 30 units only
 
Seize this unbelievable opportunity! Happy mining!!!

More detail, please find https://www.alcheminer.com
hero member
Activity: 630
Merit: 504
April 20, 2015, 08:11:06 PM
#15

I wonder how low can you underclock the unit?  Or perhaps have 3/4 of the unit operate?

member
Activity: 112
Merit: 10
April 20, 2015, 08:03:43 PM
#14

Ebay has a unit if you search under "256MH/s Scrypt ASIC Miner" for $1749 - shipping from Taiwan.

Sure does require a lot of power.  2.2KW -- eek.





it's real i meet a few on the boards that are complaining about the diff levels for it on nice /west hash .


but yea that power usages turns me way the price is even lower now some place else for like 999 making it very temping.
hero member
Activity: 630
Merit: 504
March 27, 2015, 01:44:18 PM
#13

Ebay has a unit if you search under "256MH/s Scrypt ASIC Miner" for $1749 - shipping from Taiwan.

Sure does require a lot of power.  2.2KW -- eek.

legendary
Activity: 2408
Merit: 1102
Leading Crypto Sports Betting & Casino Platform
March 27, 2015, 11:43:08 AM
#12
You don't need escrow with the company they have sold miners to alot of folks on the litecointalk forums and no one did not receive their unit.

Yeah, I was told similar stories about LTCGear  Roll Eyes
Don't rely on the history of a company, there are more than enough examples.

Idiots abound on this board.. you're going to compare a possible cloud mining scam that never even shown pictures of its location or hardware

to a company that is even now shipping hardware from stock ?  Talk about apples to oranges.
full member
Activity: 224
Merit: 100
★YoBit.Net★ 350+ Coins Exchange & Dice
March 26, 2015, 09:23:53 AM
#11
You don't need escrow with the company they have sold miners to alot of folks on the litecointalk forums and no one did not receive their unit.

Yeah, I was told similar stories about LTCGear  Roll Eyes
Don't rely on the history of a company, there are more than enough examples.
legendary
Activity: 2408
Merit: 1102
Leading Crypto Sports Betting & Casino Platform
March 26, 2015, 04:59:55 AM
#10

Oh - the KNC Titans don't work with Multipools?  What happens when the coin switches?  It just goes offline?



They work after a fashion , but the constant switching from high hash rates needed for Litecoins to lower diff coins seem to cause a ton of rejected , stales and low diff shares.

I', pretty sure its a software issue not hardware.
hero member
Activity: 630
Merit: 504
March 25, 2015, 05:05:24 PM
#9

Oh - the KNC Titans don't work with Multipools?  What happens when the coin switches?  It just goes offline?

legendary
Activity: 2408
Merit: 1102
Leading Crypto Sports Betting & Casino Platform
March 25, 2015, 03:20:25 PM
#8
We asked our bank about escrow.
They don't provide this service now.
Actually escrow service is not popular in Asia.

About the paypal,
our company doesn't not have a paypal account now.
It may take times to have one.


You won't get any sales then without a company reputation, escrow, or accepting Paypal/Credit Cards.

You joined a few days ago, why should we trust you?

A few months ago there was a similar store selling Scrypt ASICs, they had a website and said they couldn't accept escrow or credit cards. The buyer ended up getting a bicycle lamp instead of an ASIC.




You don't need escrow with the company they have sold miners to alot of folks on the litecointalk forums and no one did not receive their unit.
The only issue right now is the units don't work on multipools (same thing with the KNC titan) they have people actively working on these issues though.

member
Activity: 106
Merit: 10
March 25, 2015, 05:58:00 AM
#7
We have our scrypt miner products since September last year.
How come you said "we join several days ago?"
We are here for more than half of year.
Please see the threads
https://bitcointalksearch.org/topic/alcheminer-96mhs-alchemist-scrypt-miner-unboxing-review-825673

We asked our bank about escrow.
They don't provide this service now.
Actually escrow service is not popular in Asia.

About the paypal,
our company doesn't not have a paypal account now.
It may take times to have one.


You won't get any sales then without a company reputation, escrow, or accepting Paypal/Credit Cards.

You joined a few days ago, why should we trust you?

A few months ago there was a similar store selling Scrypt ASICs, they had a website and said they couldn't accept escrow or credit cards. The buyer ended up getting a bicycle lamp instead of an ASIC.



Pages:
Jump to: