It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
static
bool rockminer_detect_one(const char * const devpath)
{
int fd, chips;
uint8_t buf[ROCKMINER_WORK_REQ_SIZE], reply[ROCKMINER_REPLY_SIZE];
ssize_t rsz;
fd = rockminer_open(devpath);
if (fd < 0)
return_via_applog(err, , LOG_DEBUG, "%s: %s %s", rockminer_drv.dname, "Failed to open", devpath);
applog(LOG_DEBUG, "%s: %s %s", rockminer_drv.dname, "Successfully opened", devpath);
rockminer_job_buf_init(buf, 0);
rockminer_job_buf_set_freq(buf, ROCKMINER_MIN_FREQ_MHZ);
memcpy(&buf[ 0], golden_midstate, 0x20);
memcpy(&buf[0x34], golden_datatail, 0xc);
if (rockminer_write(fd, buf, sizeof(buf)) != sizeof(buf))
return_via_applog(err, , LOG_DEBUG, "%s: %s %s", rockminer_drv.dname, "Error sending request to ", devpath);
while (true)
{
rsz = rockminer_read(fd, reply, sizeof(reply));
if (rsz != sizeof(reply))
return_via_applog(err, , LOG_DEBUG, "%s: Short read from %s (%d)", rockminer_drv.dname, devpath, rsz);
if ((!memcmp(reply, golden_result, sizeof(golden_result))) && (reply[4] & 0xf) == ROCKMINER_REPLY_NONCE_FOUND)
break;
}
applog(LOG_DEBUG, "%s: Found chip 0 on %s, probing for total chip count", rockminer_drv.dname, devpath);
chips = rockminer_bisect_chips(fd, buf);
applog(LOG_DEBUG, "%s: Identified %d chips on %s", rockminer_drv.dname, chips, devpath);
if (serial_claim_v(devpath, &rockminer_drv))
goto err;
serial_close(fd);
struct cgpu_info * const cgpu = malloc(sizeof(*cgpu));
*cgpu = (struct cgpu_info){
.drv = &rockminer_drv,
.set_device_funcs = rockminer_set_device_funcs,
.device_path = strdup(devpath),
.deven = DEV_ENABLED,
.procs = chips,
.threads = 1,
};
// NOTE: Xcode's clang has a bug where it cannot find fields inside anonymous unions (more details in fpgautils)
cgpu->device_fd = -1;
return add_cgpu(cgpu);
err:
if (fd >= 0)
serial_close(fd);
return false;
}
rsz = rockminer_read(fd, reply, sizeof(reply));
fd = rockminer_open(devpath);
if (fd < 0)
return_via_applog(err, , LOG_DEBUG, "%s: %s %s", rockminer_drv.dname, "Failed to open", devpath);
return_via_applog(err, , LOG_DEBUG, "%s: Short read from %s (%d)", rockminer_drv.dname, devpath, rsz);
int rockminer_open(const char *devpath)
{
return serial_open(devpath, ROCKMINER_IO_SPEED, ROCKMINER_READ_TIMEOUT, true);
}
int serial_open(const char *devpath, unsigned long baud, uint8_t timeout, bool purge)
{
#ifdef WIN32
HANDLE hSerial = CreateFile(devpath, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (unlikely(hSerial == INVALID_HANDLE_VALUE))
{
DWORD e = GetLastError();
switch (e) {
case ERROR_ACCESS_DENIED:
applog(LOG_ERR, "Do not have user privileges required to open %s", devpath);
break;
case ERROR_SHARING_VIOLATION:
applog(LOG_ERR, "%s is already in use by another process", devpath);
break;
default:
applog(LOG_DEBUG, "Open %s failed, GetLastError:%u", devpath, (unsigned)e);
break;
}
return -1;
}
if (baud)
{
COMMCONFIG comCfg = {0};
comCfg.dwSize = sizeof(COMMCONFIG);
comCfg.wVersion = 1;
comCfg.dcb.DCBlength = sizeof(DCB);
comCfg.dcb.BaudRate = baud;
comCfg.dcb.fBinary = 1;
comCfg.dcb.fDtrControl = DTR_CONTROL_ENABLE;
comCfg.dcb.fRtsControl = RTS_CONTROL_ENABLE;
comCfg.dcb.ByteSize = 8;
SetCommConfig(hSerial, &comCfg, sizeof(comCfg));
}
// Code must specify a valid timeout value (0 means don't timeout)
const DWORD ctoms = ((DWORD)timeout * 100);
COMMTIMEOUTS cto = {ctoms, 0, ctoms, 0, ctoms};
SetCommTimeouts(hSerial, &cto);
if (purge) {
PurgeComm(hSerial, PURGE_RXABORT);
PurgeComm(hSerial, PURGE_TXABORT);
PurgeComm(hSerial, PURGE_RXCLEAR);
PurgeComm(hSerial, PURGE_TXCLEAR);
}
return _open_osfhandle((intptr_t)hSerial, 0);
#else
int fdDev = open(devpath, O_RDWR | O_CLOEXEC | O_NOCTTY);
if (unlikely(fdDev == -1))
{
if (errno == EACCES)
applog(LOG_ERR, "Do not have user privileges required to open %s", devpath);
else
applog(LOG_DEBUG, "Open %s failed: %s", devpath, bfg_strerror(errno, BST_ERRNO));
return -1;
}
#if defined(LOCK_EX) && defined(LOCK_NB)
if (likely(!flock(fdDev, LOCK_EX | LOCK_NB)))
applog(LOG_DEBUG, "Acquired exclusive advisory lock on %s", devpath);
else
if (errno == EWOULDBLOCK)
{
applog(LOG_ERR, "%s is already in use by another process", devpath);
close(fdDev);
return -1;
}
else
applog(LOG_WARNING, "Failed to acquire exclusive lock on %s: %s (ignoring)", devpath, bfg_strerror(errno, BST_ERRNO));
#endif
struct termios my_termios;
tcgetattr(fdDev, &my_termios);
#ifdef TERMIOS_DEBUG
termios_debug(devpath, &my_termios, "before");
#endif
if (baud)
{
speed_t speed = tiospeed_t(baud);
if (speed == B0)
applog(LOG_WARNING, "Unrecognized baud rate: %lu", baud);
else
{
cfsetispeed(&my_termios, speed);
cfsetospeed(&my_termios, speed);
}
}
my_termios.c_cflag &= ~(CSIZE | PARENB);
my_termios.c_cflag |= CS8;
my_termios.c_cflag |= CREAD;
#ifdef USE_AVALON
// my_termios.c_cflag |= CRTSCTS;
#endif
my_termios.c_cflag |= CLOCAL;
my_termios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK |
ISTRIP | INLCR | IGNCR | ICRNL | IXON);
my_termios.c_oflag &= ~OPOST;
my_termios.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
// Code must specify a valid timeout value (0 means don't timeout)
my_termios.c_cc[VTIME] = (cc_t)timeout;
my_termios.c_cc[VMIN] = 0;
#ifdef TERMIOS_DEBUG
termios_debug(devpath, &my_termios, "settings");
#endif
tcsetattr(fdDev, TCSANOW, &my_termios);
#ifdef TERMIOS_DEBUG
tcgetattr(fdDev, &my_termios);
termios_debug(devpath, &my_termios, "after");
#endif
if (purge)
tcflush(fdDev, TCIOFLUSH);
return fdDev;
#endif
}
static
bool rockminer_detect_one(const char * const devpath)
{
int fd, chips;
uint8_t buf[ROCKMINER_WORK_REQ_SIZE], reply[ROCKMINER_REPLY_SIZE];
ssize_t rsz;
fd = rockminer_open(devpath);
if (fd < 0)
return_via_applog(err, , LOG_DEBUG, "%s: %s %s", rockminer_drv.dname, "Failed to open", devpath);
applog(LOG_DEBUG, "%s: %s %s", rockminer_drv.dname, "Successfully opened", devpath);
rockminer_job_buf_init(buf, 0);
rockminer_job_buf_set_freq(buf, ROCKMINER_MIN_FREQ_MHZ);
memcpy(&buf[ 0], golden_midstate, 0x20);
memcpy(&buf[0x34], golden_datatail, 0xc);
if (rockminer_write(fd, buf, sizeof(buf)) != sizeof(buf))
return_via_applog(err, , LOG_DEBUG, "%s: %s %s", rockminer_drv.dname, "Error sending request to ", devpath);
while (true)
{
rsz = rockminer_read(fd, reply, sizeof(reply));
if (rsz != sizeof(reply))
return_via_applog(err, , LOG_DEBUG, "%s: Short read from %s (%d)", rockminer_drv.dname, devpath, rsz);
if ((!memcmp(reply, golden_result, sizeof(golden_result))) && (reply[4] & 0xf) == ROCKMINER_REPLY_NONCE_FOUND)
break;
}
applog(LOG_DEBUG, "%s: Found chip 0 on %s, probing for total chip count", rockminer_drv.dname, devpath);
chips = rockminer_bisect_chips(fd, buf);
applog(LOG_DEBUG, "%s: Identified %d chips on %s", rockminer_drv.dname, chips, devpath);
if (serial_claim_v(devpath, &rockminer_drv))
goto err;
serial_close(fd);
struct cgpu_info * const cgpu = malloc(sizeof(*cgpu));
*cgpu = (struct cgpu_info){
.drv = &rockminer_drv,
.set_device_funcs = rockminer_set_device_funcs,
.device_path = strdup(devpath),
.deven = DEV_ENABLED,
.procs = chips,
.threads = 1,
};
// NOTE: Xcode's clang has a bug where it cannot find fields inside anonymous unions (more details in fpgautils)
cgpu->device_fd = -1;
return add_cgpu(cgpu);
err:
if (fd >= 0)
serial_close(fd);
return false;
}