sds-cli v0.4.10
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.
- register smartcontract – adds a new smartcontract to the SDS.
- 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:
- gosds for go language.
- seascape-js for typescript/nodejs.
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
- fork this repo.
- download docker.
- create
.env
based on the.example.env
- create the docker image and run a container based on the image:
docker-compose up -d
- enter into the container:
docker exec -it seascape-js bash
Development
- Compile the Typescript to Javascript code
npx tsc
- Add the tests.
- Add the example of code used in the examples folder.
- Add the part of the code in README.md.
- Update the version in package.json and push it to GitHub.
- upload
npm publish
Publishing for contributors
- Create a pull request to the https://github.com/blocklords/sds-cli
- Raise the issue with your changes.
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>
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago