Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

C3 CLI Usage Examples

Miguel Mota edited this page Jun 28, 2018 · 5 revisions

Install CLI

go get github.com/c3systems/c3

Importing keystore

$ c3 import account keystore.json
> enter password to decrypt: ******
imported key pair

Importing private key

$ c3 import account --private-key privatekey.txt
imported key pair

Deploy image

$ c3 deploy mylocalimage:latest
pushing to registry...
deployed 5b2c19808f6c6e51f32525cbcf34f78f04966cb746aa26698da8dd24e60fc33f

Ping image (to know that it exists)

$ c3 ping -i 5b2c19808f6c6e51f32525cbcf34f78f04966cb746aa26698da8dd24e60fc33f
pong

Ping using cURL

$ curl -X POST https://gw.c3labs.io -d '{"method": "c3_ping", "id": 1, "jsonrpc": "2.0", "args": ["5b2c19808f6c6e51f32525cbcf34f78f04966cb746aa26698da8dd24e60fc33f"]}'
{ "jsonrpc": "2.0", "id": 1, "result": "pong" }

Invoke method

$ c3 invokeMethod -i 5b2c19808f6c6e51f32525cbcf34f78f04966cb746aa26698da8dd24e60fc33f -m myMethod -p "foo"
bar
Clone this wiki locally