Skip to content

lum-network/lumjs

Repository files navigation

Lum Network - Javascript SDK

npm version License

This Javascript SDK enables browsers and NodeJS clients to interact with the Lum Network.

SDK Usage

Node version

The library is tested using NodeJS 18.x.

It should also work in all recent browsers.

Installation

yarn add @lum-network/sdk-javascript

Documentation

The SDK code should be documented enough for developers to explore and use it easily. Therefore the documentation might not cover all the capabilities of the SDK. Feel free to contribute if you wish to improve the code documentation and/or the provided samples.

The Documentation contains:

  • Installation instructions
  • Basic usage
  • Code samples
  • Code auto-generated documentation

Code structure

The SDK is based on the @cosmoslogy/telescope implementation and heavily relies on it.

It is intented to be used standalone, without having to import specific CosmJS packages which can get make implementations tricky and messy.

Therefore all types, functions are features from the CosmJS SDK are either re-implemented by this SDK or re-exported for simplicity purposes.

Directly importing the CosmJS SDK or other cryptographic library should be considered bad practice for most use cases.

Do not hesitate to contribute to this repository. This SDK is intended to be a one-stop-shop for all Lum Network javascript implementations and should definitely be improved over time by all its users.

Run the package locally

Install the latest lum repository version

git submodule foreach git pull origin master

If for any reason you do not have the lum folder at the root of your lumjs clone you can get it manually:

git clone @github.com:lum-network/chain.git lum

Install dependencies

yarn

Run codegen

yarn run codegen

Unittests

Make sure to run the local chain aside. Do this in a separate terminal window. You can copy the config from config.yml and pass it to the lum folder.

cp config.yml lum/config.yml
cd lum
ignite chain serve --skip-proto

at the root of the project in the initial terminal window run:

yarn test

Ledger unittests

In order to run the unittest involving Ledger devices you need to do the following:

  1. Chose which application you want to use for the tests (Cosmos or Lum)
  2. Remove the .skip from all the tests your want to run in ./tests/ledger.test.ts
  3. Connect a Ledger device and open either the Cosmos application or the Lum application
  4. Run yarn test tests/ledger.test.ts
  5. Follow the instructions on your Ledger device to pass each test that require a user input

Simulate pipelines locally

install act, for instance:

brew install act

simulate the pipeline for a pull request

act pull_request --container-architecture linux/amd64

nb: be patient, this can take up to 15min

Credits

🛠 Built with Cosmology

Code built with the help of these related projects:

Contributing

Contributions are most welcome.

Please test your changes with a local client and add unit tests coverage for your code before submission.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •