Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bridge/Adapter between the stratum-based miners and a karlsend node

License

NotificationsYou must be signed in to change notification settings

karlsen-network/karlsen-stratum-bridge

 
 

Repository files navigation

This is a lightweight daemon that allows mining to a local (or remote)karlsen node using stratum-base miners.

This daemon is confirmed working with the miners below in both dual-miningand karlsen-only modes (for those that support it) and Windows, Linux,macOS and HiveOS.

Discord discussions/issues:here

Join the Karlsen Discord Server

Huge shoutout tohttps://github.com/KaffinPX/KStratum andhttps://github.com/onemorebsmith/karlsen-stratum-bridge andhttps://github.com/rdugan/kaspa-stratum-bridge for the inspiration.

Tips appreciated:karlsen:qqe3p64wpjf5y27kxppxrgks298ge6lhu6ws7ndx4tswzj7c84qkjlrspcuxw

Hive Setup

Detailed Instructions here

Features

Shares-based work allocation with miner-like periodic stat output:

===============================================================================  worker name   |  avg hashrate  |   acc/stl/inv  |    blocks    |    uptime------------------------------------------------------------------------------- lemois         |       0.13GH/s |          3/0/0 |            0 |       6m48s-------------------------------------------------------------------------------                |       0.13GH/s |          3/0/0 |            0 |       7m20s========================================================= kls_bridge_v2.2.0 ===

Variable difficulty engine (vardiff)

Multiple miners with significantly different hashrates can be connectedto the same stratum bridge instance, and the appropriate difficultywill automatically be decided for each one. Default settings target15 shares/min, resulting in high confidence decisions regardingdifficulty adjustments, and stable measured hashrates (1hr avghashrates within +/- 10% of actual). The minimum share difficulty is 64and optimized for GPUs.

Grafana UI

The grafana monitoring UI is an optional component but included forconvenience. It will help to visualize collected statistics.

Detailed Instructions here

Prometheus API

If the app is run with the-prom={port} flag the application will hoststats on the port specified by{port}, these stats are documented inthe fileprom.go. This is intended to be useby prometheus but the stats can be fetched and used independently ifdesired.curl http://localhost:2114/metrics | grep kls_ will get alisting of current stats. All published stats have akls_ prefix forease of use.

user:~$ curl http://localhost:2114/metrics | grep kls_# HELP kls_estimated_network_hashrate_gauge Gauge representing the estimated network hashrate# TYPE kls_estimated_network_hashrate_gauge gaugekls_estimated_network_hashrate_gauge 2.43428982879776e+14# HELP kls_network_block_count Gauge representing the network block count# TYPE kls_network_block_count gaugekls_network_block_count 271966# HELP kls_network_difficulty_gauge Gauge representing the network difficulty# TYPE kls_network_difficulty_gauge gaugekls_network_difficulty_gauge 1.2526479386202519e+14# HELP kls_valid_share_counter Number of shares found by worker over time# TYPE kls_valid_share_counter counterkls_valid_share_counter{ip="192.168.0.17",miner="SRBMiner-MULTI/2.4.1",wallet="karlsen:qzk3uh2twkhu0fmuq50mdy3r2yzuwqvstq745hxs7tet25hfd4egcafcdmpdl",worker="002"} 276kls_valid_share_counter{ip="192.168.0.24",miner="SRBMiner-MULTI/2.4.1",wallet="karlsen:qzk3uh2twkhu0fmuq50mdy3r2yzuwqvstq745hxs7tet25hfd4egcafcdmpdl",worker="003"} 43kls_valid_share_counter{ip="192.168.0.65",miner="SRBMiner-MULTI/2.4.1",wallet="karlsen:qzk3uh2twkhu0fmuq50mdy3r2yzuwqvstq745hxs7tet25hfd4egcafcdmpdl",worker="001"} 307# HELP kls_worker_job_counter Number of jobs sent to the miner by worker over time# TYPE kls_worker_job_counter counterkls_worker_job_counter{ip="192.168.0.17",miner="SRBMiner-MULTI/2.4.1",wallet="karlsen:qzk3uh2twkhu0fmuq50mdy3r2yzuwqvstq745hxs7tet25hfd4egcafcdmpdl",worker="002"} 3471kls_worker_job_counter{ip="192.168.0.24",miner="SRBMiner-MULTI/2.4.1",wallet="karlsen:qzk3uh2twkhu0fmuq50mdy3r2yzuwqvstq745hxs7tet25hfd4egcafcdmpdl",worker="003"} 3399kls_worker_job_counter{ip="192.168.0.65",miner="SRBMiner-MULTI/2.4.1",wallet="karlsen:qzk3uh2twkhu0fmuq50mdy3r2yzuwqvstq745hxs7tet25hfd4egcafcdmpdl",worker="001"} 3425

Install

Build from source (native executable)

Install go 1.18 or later using whatever package manager is appropratefor your system, or fromhttps://go.dev/doc/install.

cd cmd/karlsenbridgego build .

Modify the config file in./cmd/karlsenbridge/config.yaml with your setup,the file comments explain the various flags.

./karlsenbridge

To recap the entire process of initiating the compilation and launchingthe karlsen dridge, follow these steps:

cd cmd/karlsenbridgego build ../karlsenbridge

Docker (all-in-one)

Best option for users who want access to reporting, and aren't alreadyusing Grafana/Prometheus. Requires a local copy of this repository, anddocker installation.

Install Docker using theappropriate method for your OS. The docker commands below are assuming aserver type installation - details may be different for a desktopinstallation.

The following will run the bridge assuming a local karlsend node withdefault port settings, and listen on port 5555 for incoming stratumconnections.

git clone https://github.com/karlsen-network/karlsen-stratum-bridge.gitcd karlsen-stratum-bridgedocker compose -f docker-compose-all-src.yml up -d --build

These settings can be updated in theconfig.yamlfile, or overridden by modifying, adding or deleting the parameters in thecommand section of thedocker-compose-all-src.yml file. Additionally,Prometheus (the stats database) and Grafana (the dashboard) will bestarted and accessible on ports 9090 and 3000 respectively. Once allservices are running, the dashboard should be reachable athttp://127.0.0.1:3000/d/x7cE7G74k1/klsb-monitoring with defaultusername and passwordadmin.

These commands builds the bridge component from source, rather thanthe previous behavior of pulling down a pre-built image. You may stilluse the pre-built image by replacingdocker-compose-all-src.yml withdocker-compose-all.yml, but it is not guaranteed to be up to date, socompiling from source is the better alternative.

Docker (bridge only)

Best option for users who want docker encapsulation, and don't needreporting, or are already using Grafana/Prometheus. Requires a localcopy of this repository, and docker installation.

Install Docker using theappropriate method for your OS. The docker commands below are assuming aserver type installation - details may be different for a desktopinstallation.

The following will run the bridge assuming a local karlsend node withdefault port settings, and listen on port 5555 for incoming stratumconnections.

git clone https://github.com/karlsen-network/karlsen-stratum-bridge.gitcd karlsen-stratum-bridgedocker compose -f docker-compose-bridge-src.yml up -d --build

These settings can be updated in theconfig.yamlfile, or overridden by modifying, adding or deleting the parameters in thecommand section of thedocker-compose-bridge-src.yml

These commands builds the bridge component from source, rather than theprevious behavior of pulling down a pre-built image. You may still usethe pre-built image by issuing the commanddocker run -p 5555:5555 karlsennetwork/karlsen_bridge:latest,but it is not guaranteed to be up to date, so compiling from source isthe better alternative.

About

Bridge/Adapter between the stratum-based miners and a karlsend node

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go98.6%
  • Other1.4%

[8]ページ先頭

©2009-2025 Movatter.jp