0.4.10 • Published 1 year ago

sds-cli v0.4.10

Weekly downloads
-
License
GNU General Publi...
Repository
github
Last release
1 year ago

SDS Cli

Software Development Service's command line interface.

This is a nodejs library for Smartcontract Developers. It's an SDS tool that allows smartcontract setup.


The SDS Cli is intended to be used along with smartcontract frameworks.

Supported smartcontract frameworks:

Installation

In your smartcontract framework run:

npm i sds-cli

Requirements

The smartcontract developer account that registers the smartcontract should be whitelisted in the SDS.

The library requires environment variables:

SDS_ORGANIZATION_NAME=
SDS_PROJECT_NAME=
SDS_GATEWAY_HOST=localhost:3500

ZMQ

It also requires ZeroMQ library, libsodium to be installed on your machine.

Features

The SDS Cli supports two following operations with SDS.

  1. register smartcontract adds a new smartcontract to the SDS.
  2. enable bundling enables parameter bundling for smartcontracts, that has array arguments.

Hardhat example

Smartcontract registration

You should change the script that deploys smartcontract to something like the code below:

let { Smartcontract }  = require('sds-cli');
const { ethers }       = require("hardhat");

(async () => {
  let name            = "Greeter";
  let group           = "simple-test";

  // We get the contract to deploy
  const Greeter       = await ethers.getContractFactory(name);
  let deployer        = await ethers.getSigner();
  let smartcontract   = new Smartcontract(name, group);

  // constructor argument
  let constructor = ["Hello World!"];

  await smartcontract
    .deployInHardhat(deployer, Greeter, constructor)
    .catch(console.error);

  console.log(`\n\nDeployment Finished!\n\n`);
})()
  

If the code above was saved as <project directory>/scripts/greeter.js. Then run it using hardhat:

npx hardhat run scripts/greeter.js --network goerli-testnet

If everything is successful, that smartcontract will be registered in the SDS. To interact with smartcontract use the SDK libraries:


Contribution

The following part is for the maintainer of this project. It's mostly for me ahmetson as the main maintainer I want to be able to remember how to work on this project.

Installation

  1. fork this repo.
  2. download docker.
  3. create .env based on the .example.env
  4. create the docker image and run a container based on the image: docker-compose up -d
  5. enter into the container: docker exec -it seascape-js bash

Development

  1. Compile the Typescript to Javascript code

npx tsc

  1. Add the tests.
  2. Add the example of code used in the examples folder.
  3. Add the part of the code in README.md.
  4. Update the version in package.json and push it to GitHub.
  5. upload npm publish

Publishing for contributors


Tests

See the test scripts to see how it's used. In order to run the test scripts, run the following command:

npx ts-node test/<test file name>
0.4.10

1 year ago

0.4.9

1 year ago

0.4.8

1 year ago

0.4.7

1 year ago

0.4.6

1 year ago

0.4.1

1 year ago

0.3.9

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.0.1

2 years ago