Skip to content

The fastest way to connect to the cothority network

License

Notifications You must be signed in to change notification settings

bsaepfl/cothoreasy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cothoreasy

The fastest way to connect to the cothority network

This package helps you connect to the cothority conodes, by connecting to a zinc instance.

How to use ?

First, install the dependency (it's ultra light ✨):

yarn add cothoreasy

Then, import it to your project:

import Cothoreasy from 'cothoreasy'

// or using CommonJS modules
const Cothoreasy = require('cothoreasy')

Instantiate the class, and then use it !

const coth = new Cothoreasy()


// use it with async/await
await coth.init()
console.log(await coth.status())

// use it with .then()
coth.init().then(() => {
  coth.status().then(console.log)
})

Options

You can pass in options when instantiating:

const coth = new Cothoreasy({ url: 'https://my_zinc_instance.com/' })

url

By default, cothoreasy connects to the BSA zinc instance. You can pass in the url for your own instance.

Change Cothority

If you want to change the cothority, just check out which ones are available in coth.cothorities and run coth.changeCothority(yourCothority) (this will return a promise).

About

The fastest way to connect to the cothority network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published