Stratum protocol
Original protocol announce
All details and links about above mentioned
Please just adopt the two commands I posted about previously: A redirect command for a poolserver to send miners elsewhere, and a server restart notification [with timer] so a pool can attempt a graceful restart rather than suddenly dropping connections.
关键词:
TCP socket
JSON-RPC 2.0
primecoin-pool学习
On going…
./primecoind -gen -debug -frontport=6667 -host=121.43.185.81 -feeaddr=AVjsWxuvcmjDvULpuegjKbgjrCthi2JVeq -daemon
Primecoin XPM Pool Server
https://github.com/madMAx43v3r/xpmpool
Primecoin XPM GPU Miner for xpmpool (aka. madPrimeMiner)
https://github.com/madMAx43v3r/xpmclient
The solo-mining server code is at: https://github.com/madMAx43v3r/xpmserver
Primecoin XPM GPU Miner for xpmpool (aka. madPrimeMiner)
https://github.com/eXtremal-ik7/xpmclient
ubuntu14.04-安装mingw
切换源
备份 /etc/apt/sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup |
输入
sudo gedit /etc/apt/sources.list |
将下面的源复制到文件中,注销一下在执行,问题少些。
sudo apt-get update |
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
sudo apt-get update |
building system
On researching…
The Meson Build system
http://mesonbuild.com/
./configure –help
CLion supports only CMake-based projects for now.
Makefile projects (CPP-494)
Qt projects (CPP-318)
Autotools projects (CPP-193)
新建一个 CMakeLists.txt 文件,导入clion,多个构建系统可以并存
加入源文件,依赖库等信息
project(myproject C) |
What toolchain should I use on Windows?
A: You have three options: Cygwin, MinGW and Microsoft Visual C++ compiler. More details on how to configure these toolchains:
https://stackoverflow.com/questions/719057/why-use-build-tools-like-autotools-when-we-can-just-write-our-own-makefiles
building system:
Gitian Building
Gitian is an open source software program that offers what is known as a “build environment.” A build environment is perhaps best described as a “computer within a computer,” but with a specific purpose: a virtual space to compile binaries, completely free of any variables. “Gitian Building,” the process of compiling binaries in Gitian, ensures that whatever computer is used, the binaries turn out exactly the same.
The features that I specifically need for this are:
C++11 support
Cross platform (Linux as main target, but able to build on at least Windows as well)
Decent unit testing support
Support for multiple modules for separating code out
Support for code generation (Using asn1c or protobuf - not 100% sure yet)
Easy to maintain
Tool chain:
GCC
Clang
GCC with MinGW
GCC with Cygwin 32
https://bazel.build/
Build and test software of any size, quickly and reliably
https://scons.org/
SCons 是一个开放源代码、以 Python 语言编写的下一代的程序建造工具。
GNU Build System:
recently found out about these, I have not personally used them yet:
Ninja, a small build system focused on speed. Google now uses Ninja to build Android instead of Make: link.
Shake, a powerful and fast build system.
Tup, a high performance build system. Algorithmic based design. Analysis of Tup.
All are now cross-platform and support Windows. I’m not yet sure about the rest of your requirements as, again, I have yet to test them myself. They are being used in commercial development, CIG picked Ninja up. First two are akin to Scons, Ant, etc.
CMake
which is a Makefile-generator (also generates native MSVC++ .proj/.sln).
Autotools:creating the makefiles
Autotools:
Autoconf:
Autoconf easily scans an existing tree to find its dependencies and create a configure script that will run under almost any kind of shell. The configure script allows the user to control the build behavior (i.e. –with-foo, –without-foo, –prefix, –sysconfdir, etc..) as well as doing checks to ensure that the system can compile the program.
Configure generates a config.h file (from a template) which programs can include to work around portability issues. For example, if HAVE_LIBPTHREAD is not defined, use forks instead.
I personally use Autoconf on many projects. It usually takes people some time to get used to m4. However, it does save time.
You can have makefiles inherit some of the values that configure finds without using automake.
Automake:
By providing a short template that describes what programs will be built and what objects need to be linked to build them, Makefiles that adhere to GNU coding standards can automatically be created. This includes dependency handling and all of the required GNU targets.
Some people find this easier. I prefer to write my own makefiles.
Libtool
GNU coding standards
环境变量设置:
Both of the these makefiles support the following environment variables:
ICU_PATH: tells the makefile to build with Unicode support, set to the path where your ICU installation is located, for example with: make ICU_PATH=/usr/local install -fgcc.mak
CXXFLAGS: extra compiler options - note that this applies to both the debug and release builds.
INCLUDES: additional include directories.
LDFLAGS: additional linker options.
LIBS: additional library files.
export PATH=$PATH:/local/bin/local/lib
export LD_LIBRARY_PATH=
export C_INCLUDE_PATH=/local/include/local/include
export CPLUS_INCLUDE_PATH=
export CPPFLAGS=”${CPPFLAGS} -I${PREFIX}/include -I${SYSROOT}/usr/include -I${TOOLCHAIN}/include”
export CFLAGS=”${CFLAGS} -static -O2 –sysroot=${SYSROOT} -DANDROID -D__ANDROID__ -DSK_RELEASE -nostdlib -march=i686 -fpic”
export CXXFLAGS=”${CXXFLAGS} ${CFLAGS}”
export LDFLAGS=”${LDFLAGS} -Bstatic -L${PREFIX}/lib -L${SYSROOT}/usr/lib -L${TOOLCHAIN}/lib”
export LIBS=”${LIBS} ${SYSROOT}/usr/lib/crtbegin_static.o ${SYSROOT}/usr/lib/crtend_android.o -lc -lgcc -lgnustl_static -lstdc++ -lsupc++ -landroid_support”
export CPLUS_INCLUDE_PATH=/home/data/primecoin-core-desktop-src_mac/depends/SDKs/MacOSX10.11.sdk/usr/include/:/usr/include
export C_INCLUDE_PATH=/home/data/primecoin-core-desktop-src_mac/depends/SDKs/MacOSX10.11.sdk/usr/include/:/usr/include
上面的写法覆盖了系统设定的路径,下面的写法会先搜索指定路径,如果未找到就会到系统路径搜索
C_INCLUDE_PATH=~/local/include:$C_INCLUDE_PATH
取消环境变量
unset C_INCLUDE_PATH
unset LD_LIBRARY_PATH
ubuntu16.04安装python3.6
sudo apt-get install software-properties-common |
ubuntu-常见问题
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
查看哪个线程在用 apt-get 进行下载
ps -A | grep apt-get |
apt-get update的时候遇到 “Hash Sum mismatch” 错误
源服务器缓存更新不及时,导致 hash 不一致,看来除了换源别的基本够呛
sudo apt-get clean |
升级 pip 之后出错
ImportError: cannot import name main
sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall |
add-apt-repository is broken with non-UTF-8 locales,
docker-使用ubuntu16.04
下载 ubuntu 16.04 image
// 下载镜像 |
安装没有自带的常用命令
//通过 whereis ifconfig 发现根本就没有安装这个命令,需要自己安装
apt-get update
apt install net-tools # ifconfig
apt install iputils-ping # ping停止容器
docker stop containerID
运行容器
docker start containerID
退出容器,容器仍在运行
exit登录容器
使用容器 iddocker exec -it 29 bash
制作镜像
Dockerfile 中每一个指令都会建立一层.每一个 RUN 的行为,就和刚才我们手工建立镜像的过程一样:新建立一层,在其上执行这些命令,执行结束后,commit 这一层的修改,构成新的镜像。
编写 docker file
# docker file for bitcoin/primecoin test node |
尚未验证的项目
EXPOSE 22
将22端口‘暴漏’出来,以便在外部访问该端口。没有的话,将无法从外部(非运行docker的主机)ssh。
# 设置时区和语言 |
- docker制作镜像 apt-get 安装文件报错debconf: unable to initialize frontend: Dialog
解决方法,添加下面设置ARG DEBIAN_FRONTEND=noninteractive
docker build [OPTIONS] PATH | URL | - |
GPU-编程初步信息
初步调研,记录一下相关资料
《Programming Massively Parallel Processors: A Hands-on Approach 》 |