Skip to content

ASIC setup

MaynardMiner edited this page Feb 12, 2020 · 8 revisions

SWARM ASIC SETUP

Compatible Miners

SWARM ASIC should be compatible with many ASIC miners. Any ASIC that runs cgminer/bfgminer should work with SWARM. For information on how API works for ASIC, you can check out this article here:

https://github.com/ckolivas/cgminer/blob/master/API-README

Which gives a general guide on how most ASIC miner API work.

Routing

SWARM requires no firewall issues in order to connect to the miner. Here are some of things you can do in order to ensure there is no issues:

Router Port Forwarding

In order for two devices on the same network to contact each other- The ports must be forwarded. Here is easy to read/understand article of how port forwarding works, and how to set it up:

https://www.lifewire.com/how-to-port-forward-4163829

The steps are thus:

1.) Set a static ip address on both ASIC and computer.

2.) Access router, and find port forwarding option.

3.) Add the ip address of ASIC and remote computer, along with the port in question to the list.

Windows Port forwarding

Sometimes windows can be tedious, and firewall will block access.

Here is an article to ensure port is established:

http://woshub.com/port-forwarding-in-windows/

ASIC configuration.

SWARM does not start ASIC. You must start ASIC. The ASIC can be started on any pool, with any configuration. But it is ABSOLUTELY necessary that the ASIC in question has API enabled. The following arguments/options must be specified:

--api-listen

--api-allow S:192.168.1.100 (IP address of machine running SWARM)

--api-groups S:switchpool:addpool:removepool:*

here is an example:

cgminer -o stratum+tcp://sha256.mine.zergpool.com:3333 -u 1FpuMha1QPaWS4PTPZpU1zGRzKMevnDpwg -p c=BTC --api-listen --api-allow S:192.168.1.100 --api-groups S:switchpool:addpool:removepool:*

SWARM Configuration

There are a few extra arguments for ASIC.

  • -ASIC_ALGO

    • algorithms asic mines, comma separated. Must be same name as pool, so if an algorithm has separate names on two separate pools- List them both.
  • -ASIC_IP

    • The asics you wish to use.
    • Format: [ip address]:[nickname],[ip address]:[nickname]
    • nickname will be the name of worker on pool.
    • ip address is the ip address of the ASIC.
  • -Type

    • Is a normal argument.
    • ASIC must be specified, it can be used with other types.
    • Example: -Type NVIDIA1,CPU,ASIC

Here is a sample argument list for reference:

-RigName1 Swarm -Location US -PoolName zergpool,zpool,nicehash -Wallet1 1DRxiWx6yuZfN9hrEJa3BDXWVJ9yyJU36i -Type ASIC -ASIC_IP 192.168.1.100:myasic -ASIC_ALGO sha256 -Donate .5 -Auto_Coin Yes

-Auto_Coin yes is preferred, due to the fact ASIC only mine a few algorithms.

Troubleshooting / Monitoring

get asic command

You can use get asic to get the details of the ASIC. Each asic can be searched by its designation in SWARM.

example:

ASIC2 is currently Running: test2 current hashrate for sha256 is 8.06 TH/s

My test asic is designated as ASIC2. Therefor, if I wanted to get details, I would run:

get asic ASIC2

A sample of the output:

Miner Name: cgminer
Miner Currently Mining: sha256
Active Pool Accepted = 1
Active Pool Bad Work = 15
Active Pool Best Share = 525
Active Pool Current Block Height = 9164886
Active Pool Current Block Version = 536871426
Active Pool Diff1 Shares = 576
Active Pool Difficulty Accepted = 1
Active Pool Difficulty Rejected = 0
Active Pool Difficulty Stale = 0
Active Pool Discarded = 142
Active Pool Get Failures = 0
Active Pool Getworks = 18
Active Pool Has GBT = False
Active Pool Has Stratum = True
Active Pool Has Vmask = False
Active Pool Last Share Difficulty = 0
Active Pool Last Share Time = 0
Active Pool Long Poll = N
Active Pool POOL = 1
Active Pool Pool Rejected% = 0
Active Pool Pool Stale% = 0
Active Pool Priority = 0
Active Pool Proxy = 
Active Pool Proxy Type = 
Active Pool Quota = 1
Active Pool Rejected = 0
Active Pool Remote Failures = 0
Active Pool Stale = 0
Active Pool Status = Alive
Active Pool Stratum Active = True
Active Pool Stratum Difficulty = 4000
Active Pool Stratum URL = sha256.mine.zergpool.com
Active Pool URL = stratum+tcp://sha256.mine.zergpool.com:3333
Active Pool User = 1FpuMha1QPaWS4PTPZpU1zGRzKMevnDpwg
Active Pool Work Difficulty = 4000
Active Pool Works = 437

The get asic command should begin to work shortly after starting SWARM (when you get to the Pool phase). If get asic does not work, then either:

-ASIC port is not set to 4028 -Routing between ASIC and SWARM is being blocked by firewall. -API arguments are missing from ASIC. -ASIC may not be supported.

If you discover that your ASIC does not run cgminer/bfgminer- create an issue in github with the miner your ASIC uses, I will look into making it compatible.

Running SWARM directly on ASIC.

This is untested/not supported:

First download powershell:

# Make a /tmp download if it does not exist:
sudo mkdir /tmp

# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-linux-x64.tar.gz

# Create the target folder where powershell will be placed
sudo mkdir -p /opt/microsoft/powershell/6.2.0

# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.0

# Set execute permissions
sudo chmod +x /opt/microsoft/powershell/6.2.0/pwsh

# Create the symbolic link that points to pwsh
sudo ln -s /opt/microsoft/powershell/6.2.0/pwsh /usr/bin/pwsh

Next you would install SWARM:

# Download SWARM
curl -L -o /tmp/SWARM.tar.gz https://github.com/MaynardMiner/SWARM/releases/tag/v[version]

# Extract SWARM
sudo tar zxf /tmp/powershell.tar.gz -C /swarm

# Install SWARM
cd /swarm
sudo install_linux
sudo ./swarm

Lastly, you would edit /SWARM.2.5.4/swarm with your arguments, and then run. ASICS are too varied in their designs to guarantee that this will work. However, know that attempting to do this, will not damage your ASIC.