@motionwerk/sharecharge-cli v0.11.0
Share & Charge Command Line Interface
The S&C CLI provides tools for creating and managing wallets, provisioning charge points and managing charge sessions on the Share & Charge e-Mobility network.
Install
The S&C CLI is available as an NPM package:
npm install -g @motionwerk/sharecharge-cliRun and show possible commands:
sc-cli -hThe help flag can be used to invoke usage tips, for example:
sc-cli token -hUsage examples
There are several modules included:
config: Read and edit the Share & Charge configurationcdr: Access and filter Charge Detail Recordscharging: Control EV charging sessionsstore: Add and query data stored on the Share & Charge EV Networktoken: Deploy and manage a Mobility Service Provider tokenwallet: Create and manage a Share & Charge wallet
config
The Share & Charge software stack (including the CLI, the API and the Core Client) all read from a configuration file in $HOME/.sharecharge.
It is possible to edit this file directly via the CLI, should a default editor already be set.
sc-cli config editAdditionally, it is possible to get the entire configuration, or individual values:
sc-cli config get
sc-cli config get ethProviderLikewise, it is possible to set config values from the command line:
sc-cli config set ethProvider ws://localhost:8546wallet
With this subcommand it is possible to generate a wallet and get information about it. To generate a wallet:
$ sc-cli wallet generate
Wallet created. Update the seed in your configuration to use.
coinbase: 0x7fe79a250d9d24fa8fe13e27e30121dfe8623f2c
seed: clog side swap city lawn disorder group pottery business armed swallow describeTaking the seed, update the configuration accordingly:
sc-cli config set seed "clog side swap city lawn disorder group pottery business armed swallow describe"Verify that the seed was correctly set by checking if the coinbase matches the previous output. The coinbase is the primary account of the wallet.
$ sc-cli wallet info
coinbase: 0x7fe79a250d9d24fa8fe13e27e30121dfe8623f2c
tx count: 0It is also possible to check the quantity of Ether (infrastructure token of Ethereum based blockchains) which will be used to pay for transactions:
$ sc-cli wallet balance
balance: 1000000000000000000 Wei (1.00000000000000000 Ether)token
This modules provides functionality for managing Mobility Service Provider (MSP) tokens for drivers. As an MSP, a token contract can be deployed from which individual tokens of the kind specified by the contract may be minted for drivers to pay for charging sessions.
To deploy a new token contract, use the following command:
sc-cli token deployAt the end, the address of the contract on the network should be displayed:
New contract created at address 0x176E2F60cFF83B8A1A7BEfa99E19fc077a123bCa
Save this address in your config under "tokenAddress" to use itSave the address using the config module:
sc-cli config set tokenAddress 0x176E2F60cFF83B8A1A7BEfa99E19fc077a123bCaTo verify the address was correctly set, ensure the name, symbol and owner are correct:
$ sc-cli token info
Name: Park & Charge Token
Symbol: PCT
Address: 0x176E2F60cFF83B8A1A7BEfa99E19fc077a123bCa
Owner: 0x7fe79a250d9d24fa8fe13e27e30121dfe8623f2cFollowing this, it is now possible to mint tokens for drivers:
$ sc-cli token mintstore
The storage module allows adding location (charge point) and tariff data to the network via IPFS.
Locations are stored in $HOME/.sharecharge/locations.json. in OCPI format.
After editing the locations.json file, the location(s) can be added to the network:
sc-cli store add-locationsThe file can be updated, and similarly the network updated:
sc-cli store update-locationsThe same is true for tariffs (also in OCPI format):
sc-cli store add-tariffs
sc-cli store update-tariffscharging
The CLI can also request charging session starts for drivers. In fact, all aspects of the charging session can be controlled via the CLI, including requesting session stops, confirming sessions and issuing charge detail records (CDRs).
To request a start:
sc-cli charging request-startAn interactive wizard will guide the driver through the request.
To request a stop:
sc-cli charging request-stopIn the event that errors occur during the charging session, the CLI can also be used to manage the driver's session on the network:
sc-cli charging confirm-start
sc-cli charging confirm-stop
sc-cli charging cdrcdr
The charge detail record module allows for querying CDRs issued by charge point operators on the network. To return all CDRs issued on the network:
sc-cli cdr infoTo filter by specific CDR parameters:
sc-cli cdr filter7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago