npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bstratum

v0.9.0

Published

Bitcoin mining bike-shed

Downloads

27

Readme

bstratum

A segwit-capable stratum server on top of bcoin. This is a bcoin plugin which will run a stratum server in the same process as a bcoin fullnode.

Usage

bstratum can be used as a bcoin plugin.

$ bcoin --plugins bstratum \
  --stratum-host :: \
  --stratum-port 3008 \
  --stratum-public-host pool.example.com \
  --stratum-public-port 3008 \
  --stratum-max-inbound 1000 \
  --stratum-difficulty 8 \
  --stratum-dynamic \
  --stratum-password=admin-pass

Cutting out the middleman

While having a stratum+fullnode marriage violates separation of concerns, it provides a benefit to large competitive miners: because it sits in the same process, there is no overhead of hitting/longpolling a JSON-rpc api to submit or be notified of new blocks. It has direct in-memory access to all of the data it needs. No getwork or getblocktemplate required.

It can also broadcast submitted blocks before verifying and saving them to disk (since we created the block and know it's going to be valid ahead of time).

Single point of failure?

There's nothing to say you can't have multiple bcoin-nodes/stratum-servers behind a reverse/failover proxy still. It's only a single point of failure if you treat it that way.

Payouts

Shares are currently tracked by username and will be dumped to ~/.bcoin/stratum/shares/[height]-[hash].json when a block is found. A script can parse through these later and either add the user's balance to a webserver or pay directly to an address. Users are stored in a line-separated json file in ~/.bcoin/stratum/users.json.

Administration

bcoin-stratum exposes some custom stratum calls: mining.authorize_admin('password') to auth as an admin and mining.add_user('username', 'password') to create a user during runtime.

Todo

  • Reverse/failover proxy for HASH(sid)->bcoin-stratum-ip.

Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work. </legalese>

License

Copyright (c) 2017, Christopher Jeffrey (MIT License).

See LICENSE for more info.


bstratum

Bcoin-stratum是一个插件,是bcoin之上的一个能支持隔离见证(segwit)的stratum server。这是bcoin的一个插件,将可以和bcoin作为一个完整节点在同一个进程中运行stratum。正在开发中。

用法

$ bcoin --plugins bcoin-stratum \
  --stratum-host :: \
  --stratum-port 3008 \
  --stratum-public-host pool.example.com \
  --stratum-public-port 3008 \
  --stratum-max-inbound 1000 \
  --stratum-difficulty 8 \
  --stratum-dynamic \
  --stratum-password=admin-pass

避开中间环节

尽管使用这个“stratum”+“全节点”的联姻违背了关注度分离(的软件设计准则),但它为竞争性的大矿工提供了优势:

由于它们在同一个进程中运行,所以在需要提交block和通知新block的时候,能够消除不断访问和轮询JSON-rpc api所带来的开销。

它拥有着所有所需数据的直接内存访问能力(权限)。故而不需要getwork或者getblocktemplate。

它也可以在将区块验证和将存盘之前广播提交区块(因为我们可以创建区块,并且可以提前知道它是有效的)。

单点故障?

因为无法使用反向/故障转移代理背后来运行多个bcoin-nodes/stratum-servers,所以即使是单个节点出现故障就没什么可说的了,这只是单个节点故障。

付款(Payouts)

在找一个区块后,根据用户名区分的哈希计算结果(Shares)将会存储在:(dumped)~/.bcoin/stratum/shares/[height]-[hash].json。之后用一个脚本来解析,并将用户的余额添加到网络服务器,或者直接支付到一个地址。不同的用户的json是分别分行储存中文件: ~/.bcoin/stratum/users.json。

管理

bcoin-stratum暴露了一些自定义层接口调用,如在运行时,通过mining.authorize_admin('password') 可授权一个管理员,通过mining.add_user('username', 'password') 可建立一个用户

接下来要开发的功能

  • 为HASH(sid)->bcoin-stratum-ip做反向/故障转移代理。

贡献与许可协议

如果您为这个项目贡献代码,就默认你允许你的代码在MIT许可证下分发。你应该保证你的所有代码都是原创工作。

许可

版权所有(C) 2017, Christopher Jeffrey (MIT 许可证)。

更多的许可信息请查阅LICENSE。