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

txmex

v0.6.2

Published

Transaction Message Exchange (TxMEx) is a service for Bitcore that allows to send and receive messages between the nodes of a Bitcoin network

Downloads

8

Readme

TxMEx

Transaction Message Exchange (TxMEx) is a service for Bitcore that allows to send and receive messages between the nodes of a Bitcoin network

Requirements

  • bitcore-node
  • bitcore-lib
  • bitcore-explorers
  • insight-api

Set-up

If you already have a running Bitcore node, you can skip directly to TxMEx

Bitcore

To install a Bitcore Full Node, you should refer to https://bitcore.io/guides/full-node/
This is a short guide to install it on Debian-based OSs:

  • Install NVM: wget https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
  • Install Node 4: nvm install 4
  • Install Requirements: apt-get install npm libzmq3-dev build-essential curl
  • Install Bitcore: npm install -g bitcore
  • Create your Bitcore full node: bitcore create [--testnet] MY_NODE

TxMEx

  • From your node folder: bitcore install insight-api txmex

Usage

In order to interact with the TxMEx (for short, TM) service, you can use the 'bitcore call' API command.

The available commands are:

  • getnetstatus: returns nodes in the default TM network
  • createnode: creates a new TM node;
    • SYNTAX: 'createnode NAME' ; if NAME=auto, the name will be choose automatically; if NAME=temp, the node won't be saved
  • addnode: adds an existing Bitcoin node to the TM network;
    • SYNTAX: 'addnode NAME PRIV_KEY' ; NAME follows the same rules as in 'createnode'
  • removenode: removes a node from the TM network;
    • SYNTAX: 'removenode NAME'
  • getnodestatus: returns funds and in/out messages for a TM node;
    • SYNTAX: 'getnodestatus NAME'
  • sendmessage: sends a message from one TM node to another;
    • SYNTAX: 'sendmessage SRC_ID DST_{NAME|ADDR} MESSAGE'
  • getmessages: retrieves all TM messages for a TM node;
    • SYNTAX: 'getmessages ID'
  • waitmessage: wait for a new TM message for the local TM network;
    • SYNTAX: 'waitmessage'
  • waitmessagefrom: wait for a new TM message from a specific source address;
    • SYNTAX: 'waitmessagefrom {ID|ADDR}'
  • waitmessageto: wait for a new TM message to a specific source address;
    • SYNTAX: 'waitmessageto ID'

TxMEx protocol details

Messages are splitted into chunks of 76 bytes, each of which is embedded into a transaction, through the OP_RETURN Script command. Each transaction sends 546 satoshis (the minimum valid amount), and adds a fee of 3000 (a little higher than the minimum required by Bitcore).

The format of the message is:

| 'TM' | len | seq | message_chunk |
|. 0-1 .| . 2 . | . 3 . | ......... 4-79 ......... |

Once the TxMEx service recieves all chunks of a message it assembles them and notify the TM network with a 'bus event'. The destination node will read the message and optionally take some actions. The first 3 characters of the message are interpreted as a command. Currently, only 2 commands are considered: 'png' and 'ack'; when a node receives a 'png' command, it will send back an 'ack' message.
[In a future release, nodes will have the ability to load a 'rule set', defining their behavior]

Limitations

  • TxMEx does not encrypt private key, so they are currently stored in clear on the hard drive
  • Nodes need funds to send messages. [It is planned to add an automatic faucet request, for Testnet]
  • TxMEx currently support one network per-node [TxMEx design has been thought for multiple networks, so this limitation will be removed soon]