Skip to content

Instantly share code, notes, and snippets.

View HAOYUatHZ's full-sized avatar
😈
POISONed

HAOYUatHZ HAOYUatHZ

😈
POISONed
View GitHub Profile
@HAOYUatHZ
HAOYUatHZ / MulMat.c
Last active April 9, 2018 09:13
MulMat
void mul(const Mat256x256i8& a, const Mat256x256i8& b) {
for(int i=0; i<256; i++) {
for(int j=0; j<256; j++) {
int tmp=0;
for(int k=0; k<256; k++) {
tmp+=int(a.d[i][k])*int(b.d[k][j]);
}
this->d[i][j]=((tmp&0xFF)+ ((tmp>>8)&0xFF))&0xFF;
}
@HAOYUatHZ
HAOYUatHZ / B3_setup.md
Last active May 7, 2018 13:29
B3 setup

B3 setup

  1. power cable Connection
  2. network cable Connection
  3. power up
  4. discover the device's IP address
  • windows: 找IP, may need to press the "IP report" button on the device
  • smart phone: fing in App/Google store, and look for "antminer"
  • linux/mac: 'ping antminer'
  1. visit the ip address (or http://antminer/) in a broswer

Pool

  • 什么是拒绝数?拒绝率?
    • 根据矿池的工作原理,矿池不断给矿机下发新的计算任务,矿机将计算结果提交给矿池。但是由于矿机与矿池的网络连接是有延迟的,从矿池下发新的挖矿高度的任务给矿机,到矿机接收到任务,在这段时间提交的结果已经过时,将不被矿池承认。拒绝率即无效提交与总提交结果之比。
    • 拒绝数是指矿机提交的算力不符合服务器要求,被服务器拒绝的工作量。拒绝率是指拒绝数占总提交数的比例,数值越小,矿机的工作效率就越高。
  • 幸运值
    • 每个区块的幸运值是矿池实际工作量与挖矿难度之比。如果工作量小于难度,说明运气比较好,幸运值就越高。挖矿的运气成分很大,幸运值发生波动也很常见,但挖矿时间越久,总幸运值越接近 100%。
  • 结算方式
    • PPS
      • 收益稳定,只要矿机正常工作就有收益,收益和提交的工作量有关,和矿池幸运值、交易手续费无关
  • PPS+
package main
import (
"fmt"
"math/big"
"strconv"
"encoding/hex"
"github.com/bytom/consensus/difficulty"
)
package cutil
import (
"testing"
"fmt"
"github.com/bytom/protocol/bc"
"time"
"reflect"
)

BTM Pool

config the node

  • when testing, could try switching to the testnet or solonet
    • ./bytomd init --chain_id testnet
    • or ./bytomd init --chain_id solonet , with a lower difficulty, in order to mine with cpu
  • could use -r "your/directory" to specify the data directory when init with init or run with node
    • the directory will be created if not existed

procedure

package main
import (
"encoding/json"
"log"
"os"
"github.com/bytom/api"
"github.com/bytom/consensus"
"github.com/bytom/consensus/difficulty"
make bytomd
rm ./solonet -rf
cmd/bytomd/bytomd init --chain_id solonet -r "./solonet"
cmd/bytomd/bytomd node --web.close -r "./solonet"
package main
import(
"fmt"
"math/big"
"github.com/bytom/consensus/difficulty"
)
func main() {