open-index/open-npm huggingface dataset:
npm package: @metabin/gate
Description: Schema-driven data sharing over IPFS
Author: negamaxi@gmail.com
Latest version: 2.4.1

Metabin Gate
=========

Schema-driven IPFS pubsub chanels.

- [Installation](#installation)
- [Usage](#usage)
- [Validation](#validation)

# Installation

```bash
> npm install @metabin/gate --save
```

```bash
> yarn add @metabin/gate
```

```html
<script src="https://unpkg.com/@metabin/gate/dist/umd.js"></script>
```

# Usage

Metabin Gate can be used as a wrapper around any [ipfs-interface-core](https://github.com/ipfs/interface-ipfs-core) compatible module. Probably you will want to use it with [js-ipfs](https://github.com/ipfs/js-ipfs) or [js-ipfs-api](https://github.com/ipfs/js-ipfs-api) modules.

```javascript

const Ipfs = require('ipfs') 
const metabinGate = require('@metabin/gate')

const schema = {
  type: 'object',
  properties: {
    field: {
      type: 'number'
    }
  }
}

const ipfsNode = new Ipfs({ EXPERIMENTAL: { pubsub: true } })

const handleReceived = (instance, cid, from) => {
  console.log(instance)
  //  {
  //    field: 10
  //  }
}

ipfsNode.on('ready', async () => {
  const gate = await metabinGate.openGate(ipfsNode, schema)
  const stopListener = gate.listen(handleReceived)
  await gate.send({ field: 10 })
  stopListener()
})

```

# Validation

Received instances should be validated against schema as it's possible to broadcast invalid instances if original schema or cid is known. Example below uses [Avj](https://github.com/epoberezkin/ajv) but you are free to use any validation tool.

```javascript
const Ipfs = require('ipfs') 
const metabinGate = require('@metabin/gate')

const Ajv = require('ajv')
const ajv = new Ajv()

const schema = {
  type: 'object',
  properties: {
    field: {
      type: 'number'
    }
  }
}

const validateInstance = (instance) => {
  return ajv.validate(schema, data);  
}

const handleReceived = (instance, cid, from) => {
  const valid = validateInstance(instance)
  if (valid) {
    // valid instance received
  } else {
    // invalid instance received
  }
}

ipfsNode.on('ready', async () => {
  const gate = await metabinGate.openGate(ipfsNode, schema)
  const stopListener = gate.listen(handleReceived)
  await gate.send({ field: 10 })
  stopListener()
})

```

# License

MIT
npm package: @metabin/schema-validator
Description: Metabin schemas validation tool
Author: negamaxi@gmail.com
Latest version: 1.1.0

Metabin Schema Validator
=========

Metabin schemas / data validation tool

- [Installation](#installation)
- [Specs supported](#specs-supported)
- [Usage](#usage)

# Installation

```bash
> npm install @metabin/schema-validator --save
```

```html
<script src="https://unpkg.com/@metabin/schema-validator/dist/umd.js"></script>
```

# Specs supported

Spec | Supported
:--: | :--: 
[v1](https://github.com/metabin/metabin/blob/master/pages/metabin-schema/spec_v1.md) | +

# Usage

```javascript

import { validateSchema } from '@metabin/schema-validator'

const schemaObj = {
  "field1": "boolean",
  "field2": [[ 'e', 'n', 'u', 'm' ]]
}

const { valid } = validateSchema(schemaObj)

console.log(valid)

// > true

```

# License

MIT
npm package: @metabin/share
Description: Utility for schema-driven data sharing
Author: negamaxi@gmail.com
Latest version: 0.0.2

Metabin Share
=========

Advanced data sharing ultility

- [Installation](#installation)
- [Usage](#usage)
  - [As a command line tool](#as-a-command-line-tool)
  - [As a javascript module](#as-a-javascript-module)
  - [License](#license)

# Installation

Metabin share can be used as a local npm module

`npm install @metabin/share`

Also it can be installed for command line usage.

`npm install -g @metabin/share`

# Usage

Metabin-share connects to `ipfs` daemon runned on localhost. You can use either go version or js version of `ipfs`. [Go here](https://ipfs.io/docs/install/) for details on installation.

After you install `ipfs` on your machine run it with the following command:

`$ ipfs daemon --enable-pubsub-experiment`

...or for js version of ipfs installed globally via npm:

`$ jsipfs daemon --enable-pubsub-experiment`

## As a command line tool

To share some data use `put` command followed by list of meta `.json` files.

`$ metabin put meta1.json folder/meta2.json`

To get some data from the sharing space use `get` command followed by list of content identifiers (cids).

`$ metabin get zdpuAufGD4jzjxTfLiJYSNPNpBTdfLaVjXZARCDk1fBYW5j7Y`

## As a javascript module

To share some data use `metabinShare.put()` command with a valid metabin object passed as a first argument.

```javascript

import metabinShare from '@metabin/share'
// const metabinShare = require('@metabin/share')
// const { put } = require('@metabin/share')

const validMetaObj = {
  "schema": {
    "field": [[ "A", "B", "C" ]]
  },
  "data": {
    "field": 1
  }
}

const { validatorReports, cid } = metabinShare.put(validMetaObj)

console.log(cid)
// zdpuAufGD4jzjxTfLiJYSNPNpBTdfLaVjXZARCDk1fBYW5j7Y

console.log(validatorReports)
// [ { path: '/field', valid: true, message: undefined } ]

```

To get some data from the sharing space use `metabinShare.get()` with a content identifier (cid) passed as a first argument.

```javascript

import metabinShare from '@metabin/share'
// const metabinShare = require('@metabin/share')
// const { get } = require('@metabin/share')

const validCid = 'zdpuAufGD4jzjxTfLiJYSNPNpBTdfLaVjXZARCDk1fBYW5j7Y'

const { validatorReports, metaObj } = metabinShare.get(validCid)

console.log(metaObj)
/*
{
  "schema": {
    "field": [[ "A", "B", "C" ]]
  },
  "data": {
    "field": 1
  }
}
*/

console.log(validatorReports)
// [ { path: '/field', valid: true, message: undefined } ]

```

# License

MIT
npm package: @metabit/deploy
Description: A package meant to run scripts over an SSH connection. (Ideal for deploys)
Author: Metabit, Co
Latest version: 0.1.11

# Deploy. [with examples](https://github.com/metabitco/deploy-examples)
This package aims to fill a minor void of programmable deployment steps built in NodeJS. Why NodeJS? Because that's one of the only languages I know best, and it's not in a container on my computer.

![./deploy.gif](deploy.gif)
#### What can this do?
Initially this was meant to be a code deployment tool. Where you set up steps to be ran on your servers, and have it all facilitated from your computer.

But it doesn't have to relate to code deployments. It could be scheduling tasks on servers, or moving around log files, scheduling updates, really the only limit here is what you want to do with a server.

# Installation
```bash
npm i -g @metabit/deploy
```

# Usage
```bash
deploy start
```
or if you're on version > 0.1.0
```bash
deploy step deploy:cleanup
```

# Configuration
When running `deploy start` for the first time we create a `.deploy.js` file by default. In that file we export a variable called `hosts`, and one called `scripts`.
```typescript
type host = {
    name: string;
    ip: string;
    identityFile: string;
    user: string;
}
```
 and 
 ```typescript
type script = {
    name: string;
    file: string;
}
```
Something you may want to keep in mind is that `git` will send things to stderr even when things are successful and the `ssh2` lib can't handle that too well. So I recommend redirecting all output to stdout and just look over the logs.
```
GIT_REPO=git@github.com:austinkregel/finance.git
DEPLOY_NAME=$(date +"%Y%m%d%H%M%S")

git clone "$GIT_REPO" "$DEPLOY_NAME" 2>&1
```

for each script denoted, it will be ran on each server once. Scripts will be ran on servers in order.

Deploy file created on first start:
```js
module.exports = {
    hosts: [
        {
            name: "strontium",
            ip: "198.168.1.20",
            identityFile: "/home/ubuntu/.ssh/id_rsa",
            user: "ubuntu"
        },
    ],
    scripts: [
        {
            name: "updates",
            file: ".scripts/system-updates.sh",
        },
        {
            name: "deploy",
            file: ".scripts/git-clone-composer-install-deploy.sh",
        },
        {
            name: "deploy:prepare",
            file: ".scripts/build-npm.sh",
        },
        {
            name: "deploy:release",
            file: ".scripts/tag-release-deploy.sh",
        }
    ]
}
```

### Scripts
Scripts are located in a `.scripts` directory in your current working directory. Scripts are expected to be bash scripts and are not fed any extra parameters by default.

Scripts cannot be ran in parallel, and is not planned to be a supported feature.

### Hosts
Hosts are expected to be your own. Don't use this tool to do things on other peoples hosts... That's not nice.

Logging into a host with a password will not be supported by this package.

The ip address field for hosts can be either ip addresses or domain names.

Host users can be any valid user with access to a TTY session.
npm package: @metabitswap/sdk
Description: 🛠 An SDK for building applications on top of MetabitSwap.
Latest version: 1.1.0

# CredbaySwap SDK

In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).



## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.


Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```