Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cyber-prophet/cy
Cy ๐ - a Nushell module for interacting with Cybergraphs๐ต. IPFS for receiving and sharing data. Pueue as a queue manager. Export graphs into Cosmograph and Gephi formats. Dataframes for graph manipulations. Batch cyberlinks creation. Manage profiles for different private keys. Perform token operations. And more.
https://github.com/cyber-prophet/cy
blockchain browser cosmos-sdk cyber geektool ipfs markdown nushell wrapper
Last synced: 3 months ago
JSON representation
Cy ๐ - a Nushell module for interacting with Cybergraphs๐ต. IPFS for receiving and sharing data. Pueue as a queue manager. Export graphs into Cosmograph and Gephi formats. Dataframes for graph manipulations. Batch cyberlinks creation. Manage profiles for different private keys. Perform token operations. And more.
- Host: GitHub
- URL: https://github.com/cyber-prophet/cy
- Owner: cyber-prophet
- License: mit
- Created: 2022-10-06T11:17:26.000Z (about 2 years ago)
- Default Branch: dev
- Last Pushed: 2024-04-11T06:22:00.000Z (7 months ago)
- Last Synced: 2024-04-11T08:51:50.165Z (7 months ago)
- Topics: blockchain, browser, cosmos-sdk, cyber, geektool, ipfs, markdown, nushell, wrapper
- Language: Nushell
- Homepage: https://github.com/cyber-prophet/cy
- Size: 837 KB
- Stars: 16
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cy๐
Cy - a [Nushell](https://www.nushell.sh/) wrapper for `cyber`, `ipfs` and other CLIs for interacting with Cybergraphs.
## Status
Very much WIP. Actively developed.
## Key features of Cy
- Different settings for different profiles (RPC endpoints, private keys, networks, etc.)
- Seamlessly upload and download data to a Cybernode or to a local IPFS node
- Create multiple cyberlinks and publish them simoltaneously
- Export Cybergraphs to formats of Cosmograph, Gephi, Graphviz
- Shortcuts for interacting with the Bostrom's passport smart contract
- Cyber search in terminal
- Many more (see list of functions below)## Installation
### Quick start
If you have `nushell`, `git` and `cyber` CLI-s installed:
```nushell
git clone https://github.com/cyber-prophet/cy; cd cy;
overlay use -pr cy/
```### Install all the necessary apps using homebrew (Mac, Linux)
Open Terminal app on your computer.
1. Install [brew](https://brew.sh/)
2. Add a custom tap to your Homebrew, install all the dependencies for running Cy:```sh
brew tap cyber-prophet/homebrew-taps; brew install cybundle; cybundle
```3. The commands above will install the following software on your computer if it is not installed yet:
1. [cybundle script](https://github.com/cyber-prophet/homebrew-taps/blob/main/src/cybundle)
1. [nushell](https://www.nushell.sh/) app
1. [rustup](https://github.com/rust-lang/rustup): the Rust toolchain installer (needed for installation of `nu_plugin_polars`)
1. [curl](https://curl.se/) (optional)
1. [cyber](https://github.com/cybercongress/go-cyber) (optional)
1. [pussy](https://github.com/greatweb/space-pussy) (optional)
1. [kubo](https://github.com/ipfs/kubo): ipfs cli (optional)
1. [mdcat](https://github.com/swsnr/mdcat): markdown viewer (optional)After installation, you can launch `nu` in your terminal with already configured `cy` in it.
## First steps using Cy
To start using Cy, follow the instructions on your screen. They should include:
0. Add a key to your `cyber` cli (`cyber keys add 'test'`)
1. Go through the wizard `cy config-new`.
2. See all the commands in logical order by executing `cy`.
3. See all the commands suggestions by entering `cy` + tab.## Installation (Windows)
Windows supports WSL2. Install it first: https://learn.microsoft.com/en-us/windows/wsl/install.
By default, it should install Ubuntu on your computer. And when Ubuntu is installed and launched,
proceed with the steps described in the [section of installation for MacOS and Linux](#installation-mac-linux)
of this manual.## Cyber-family blockchains
Bostrom is the name of the consensus computer that maintains a general-purpose, permissionless informational graph where nodes are CIDs of files in the IPFS network, and edges are Cyberlinks (consisting of source, destination, author, height - records) written into the blockchain. The information written into the blockchain is secured to remain in existence as long as the blockchain is operative. The blockchain is designed with economic incentives that motivate validators to sustain the network. For further information about Cyber blockchains, please refer to [Bostrom Journal.](https://github.com/cyber-prophet/bostrom-journal/blob/manual/BostromJournal001.md)
## References to the documentation of Cy
I intend to locate all the documentation of Cy in one place to prevent fragmentation of attention.
1. In the comments to its code (`.nu` files of this repository, mainly in [cy.nu](https://github.com/cyber-prophet/cy/blob/dev/cy.nu)).
2. From the code, the documentation is semi-automatically parsed and written to `.md` documents of this repository (mainly to [README.md](https://github.com/cyber-prophet/cy/blob/dev/README.md)).The main feedback resource is GitHub [issues](https://github.com/cyber-prophet/cy/issues).
## Commands
### cy pin-text
```
Pin a text particleUsage:
> pin-text {flags} (text_param)> cy pin-text 'cyber'
QmRX8qYgeZoYM3M5zzQaWEpVFdpin6FvVXvp6RPQK3oufV> "cyber" | save -f cyber.txt; cy pin-text 'cyber.txt'
QmXLmkZxEyRk5XELoGpxhQJDBj798CkHeMdkoCKYptSCA6> "cyber" | save -f cyber.txt; cy pin-text 'cyber.txt' --follow_file_path
QmRX8qYgeZoYM3M5zzQaWEpVFdpin6FvVXvp6RPQK3oufV> cy pin-text 'QmRX8qYgeZoYM3M5zzQaWEpVFdpin6FvVXvp6RPQK3oufV'
QmRX8qYgeZoYM3M5zzQaWEpVFdpin6FvVXvp6RPQK3oufV> cy pin-text 'QmRX8qYgeZoYM3M5zzQaWEpVFdpin6FvVXvp6RPQK3oufV' --ignore_cid
QmcDUZon6VQLR3gjAvSKnudSVQ2RbGXUtFFV8mR6zHZK8FFlags:
--only_hash - calculate hash only, don't pin anywhere
--ignore_cid - work with CIDs as regular texts, don't use them as they are
--follow_file_path - check if `text_param` is a valid path, and if yes - try to open it
--skip_save_particle_in_cache - don't save particle to local cache in cid.md file #totestParameters:
text_param : (optional)Input/output types:
โญโโinputโโโฌโoutputโโฎ
โ string โ string โ
โ nothing โ string โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy link-texts
```
Add a 2-texts cyberlink to the temp tableUsage:
> link-texts {flags}> cy link-texts 'cyber' 'cyber-prophet' --disable_append | to yaml
from_text: cyber
to_text: cyber-prophet
from: QmRX8qYgeZoYM3M5zzQaWEpVFdpin6FvVXvp6RPQK3oufV
to: QmXFUupJCSfydJZ85HQHD8tU1L7CZFErbRdMTBxkAmBJaDFlags:
-D, --disable_append - Disable adding the cyberlink into the temp table
-q, --quiet - Don't output a cyberlink record after executing the command
--only_hash - calculate hash only, don't pin anywhere
--ignore_cid - work with CIDs as regular texts
--follow_file_path - check if `text_param` is a valid path, and if yes - try to open itParameters:
text_from :
text_to :```
### cy link-chain
```
Add a link chain to the temp tableUsage:
> link-chain ...(rest)> cy link-chain "a" "b" "c" | to yaml
- from_text: a
to_text: b
from: QmfDmsHTywy6L9Ne5RXsj5YumDedfBLMvCvmaxjBoe6w4d
to: QmQLd9KEkw5eLKfr9VwfthiWbuqa9LXhRchWqD4kRPPWEf
- from_text: b
to_text: c
from: QmQLd9KEkw5eLKfr9VwfthiWbuqa9LXhRchWqD4kRPPWEf
to: QmS4ejbuxt7JvN3oYyX85yVfsgRHMPrVzgxukXMvToK5tdParameters:
...rest : consecutive particles to cyberlink in a linkchainInput/output types:
โญโโโinputโโโโฌโoutputโโฎ
โ nothing โ table โ
โ list โ table โ
โฐโโโโโโโโโโโโดโโโโโโโโโฏ```
### cy link-files
```
Pin files from the current folder to the local node and append their cyberlinks to the temp tableUsage:
> link-files {flags} ...(files)> mkdir linkfilestest; cd linkfilestest
> 'cyber' | save cyber.txt; 'bostrom' | save bostrom.txt
> cy link-files --link_filenames --yes | to yaml
- from_text: bostrom.txt
to_text: pinned_file:bostrom.txt
from: QmPtV5CU9v3u7MY7hMgG3z9kTno8o7JHJD1e6f3NLfZ86k
to: QmU1Nf2opJGZGNWmqxAa9bb8X6wVSHRBDCY6nbm3RmVXGb
- from_text: cyber.txt
to_text: pinned_file:cyber.txt
from: QmXLmkZxEyRk5XELoGpxhQJDBj798CkHeMdkoCKYptSCA6
to: QmRX8qYgeZoYM3M5zzQaWEpVFdpin6FvVXvp6RPQK3oufV
> cd ..; rm -r linkfilestestFlags:
-n, --link_filenames - Add filenames as a `from` link
--include_extension - Include a file extension (works only with `--link_filenames`)
-D, --disable_append - Don't append links to the links table
--quiet - Don't output results page
-y, --yes - Confirm uploading files without requestParameters:
...files : filenames of files to pin to the local ipfs nodeInput/output types:
โญโโinputโโโฌโoutputโโโฎ
โ nothing โ table โ
โ nothing โ nothing โ
โฐโโโโโโโโโโดโโโโโโโโโโฏ```
### cy link-folder
```
Link folders to filenames and filenames to files hierarchy in a specified or current folderUsage:
> link-folder {flags} (folder_path)Flags:
--include_extension - Include a file extension
-D, --disable_append - Don't append links to the links table
--no_content - Use only directory and filenames, don't create cyberlinks to file contents
--no_folders - Don't link folders to their child members (is not available if `--no_content` is used)
-y, --yes - Confirm uploading files without requestParameters:
folder_path : path to a folder to link files at (optional)Input/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ table โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy follow
```
Create a cyberlink according to semantic convention of following a neuronUsage:
> follow {flags}> cy follow bostrom1h29u0h2y98rkhdrwsx0ejk5eq8wvslygexr7p8 | to yaml
from_text: QmPLSA5oPqYxgc8F7EwrM8WS9vKrr1zPoDniSRFh8HSrxx
to_text: bostrom1h29u0h2y98rkhdrwsx0ejk5eq8wvslygexr7p8
from: QmPLSA5oPqYxgc8F7EwrM8WS9vKrr1zPoDniSRFh8HSrxx
to: QmYwEKZimUeniN7CEAfkBRHCn4phJtNoNJxnZXEAhEt3afFlags:
--use_local_list_only - follow a neuron locally onlyParameters:
neuron : neuron's address to followInput/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ record โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy tweet
```
Add a tweet and send it immediately (unless of `--disable_send`)Usage:
> tweet {flags} (text_to)> cy links-clear; cy tweet 'cyber-prophet is cool' --disable_send | to yaml
from_text: QmbdH2WBamyKLPE5zu4mJ9v49qvY8BFfoumoVPMR5V4Rvx
to_text: cyber-prophet is cool
from: QmbdH2WBamyKLPE5zu4mJ9v49qvY8BFfoumoVPMR5V4Rvx
to: QmWm9pmmz66cq41t1vtZWoRz5xmHSmoKCrrgdP9adcpoZKFlags:
-D, --disable_send - don't send tweet immediately, but put it into the temp tableParameters:
text_to : text to tweet (optional)Input/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ record โ
โ string โ record โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy link-random
```
Make a random cyberlink from different APIs (chucknorris.io, forismatic.com)Usage:
> link-random {flags} (n)> cy link-random
==========================================================
Chuck Norris IS Lukes father.via [Chucknorris.io](https://chucknorris.io)
====================================================================================================================
He who knows himself is enlightened. (Lao Tzu )
> cy link-random --source forismatic.comvia [forismatic.com](https://forismatic.com)
==========================================================Flags:
--source choose the source to take random links from (default: 'forismatic.com')Parameters:
n : Number of links to append (optional, default: 1)Input/output types:
โญโโinputโโโฌโoutputโโโฎ
โ nothing โ nothing โ
โฐโโโโโโโโโโดโโโโโโโโโโฏ```
### cy links-view
```
View the temp cyberlinks tableUsage:
> links-view {flags}> cy links-view | to yaml
There are 2 cyberlinks in the temp table:
- from_text: chuck norris
to_text: |-
Chuck Norris IS Lukes father.via [Chucknorris.io](https://chucknorris.io)
from: QmXL2fdBAWHgpot8BKrtThUFvgJyRmCWbnVbbYiNreQAU1
to: QmSLPzbM5NVmXuYCPiLZiePAhUcDCQncYUWDLs7GkLqC7J
timestamp: 20230701-134134
- from_text: quote
to_text: |-
He who knows himself is enlightened. (Lao Tzu )via [forismatic.com](https://forismatic.com)
from: QmR7zZv2PNo477ixpKBVYVUoquxLVabsde2zTfgqgwNzna
to: QmWoxYsWYuTP4E2xaQHr3gUZZTBC7HdNDVhis1BK9X3qjX
timestamp: 20230702-113842Flags:
-q, --quiet - Disable informational messages
--no_timestamp - Don't output a timestamps columnInput/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ table โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy links-append
```
Append piped-in table to the temp cyberlinks tableUsage:
> links-append {flags}Flags:
-q, --quiet - suppress output the resulted temp links tableInput/output types:
โญโinputโโโฌโoutputโโโฎ
โ table โ table โ
โ table โ nothing โ
โ record โ table โ
โ record โ nothing โ
โฐโโโโโโโโโดโโโโโโโโโโฏ```
### cy links-replace
```
Replace the temp table with piped-in tableUsage:
> links-replace {flags}Flags:
-q, --quiet - suppress output the resulted temp links tableInput/output types:
โญโinputโโฌโoutputโโโฎ
โ table โ table โ
โ table โ nothing โ
โฐโโโโโโโโดโโโโโโโโโโฏ```
### cy links-swap-from-to
```
Swap columns `from` and `to`Usage:
> links-swap-from-to {flags}Flags:
-D, --dont_replace - output results only, without modifying the links table
--keep_original - append results to original linksInput/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ table โ
โ table โ table โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy links-clear
```
Empty the temp cyberlinks tableUsage:
> links-clearInput/output types:
โญโโinputโโโฌโoutputโโโฎ
โ nothing โ nothing โ
โฐโโโโโโโโโโดโโโโโโโโโโฏ```
### cy links-link-all
```
Add the same text particle into the 'from' or 'to' column of the temp cyberlinks tableUsage:
> links-link-all {flags}> [[from_text, to_text]; ['cyber-prophet' null] ['tweet' 'cy is cool!']]
| cy links-pin-columns | cy links-link-all 'master' --column 'to' --empty | to yaml
- from_text: cyber-prophet
to_text: master
from: QmXFUupJCSfydJZ85HQHD8tU1L7CZFErbRdMTBxkAmBJaD
to: QmZbcRTU4fdrMy2YzDKEUAXezF3pRDmFSMXbXYABVe3UhW
- from_text: tweet
to_text: cy is cool!
from: QmbdH2WBamyKLPE5zu4mJ9v49qvY8BFfoumoVPMR5V4Rvx
to: QmddL5M8JZiaUDcEHT2LgUnZZGLMTTDEYVKWN1iMLk6PY8Flags:
-D, --dont_replace - don't replace the temp cyberlinks table, just output results
--keep_original - append results to original links
-c, --column - a column to use for values ('from' or 'to'). 'from' is default (default: 'from')
--empty - fill cids in empty cells onlyParameters:
text : a text to upload to ipfsInput/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ table โ
โ table โ table โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy links-pin-columns
```
Pin values of 'from_text' and 'to_text' columns to an IPFS node and fill `from` and `to` with their CIDsUsage:
> links-pin-columns {flags}> [{from_text: 'cyber' to_text: 'cyber-prophet'} {from_text: 'tweet' to_text: 'cy is cool!'}]
| cy links-pin-columns | to yaml
- from_text: cyber
to_text: cyber-prophet
from: QmRX8qYgeZoYM3M5zzQaWEpVFdpin6FvVXvp6RPQK3oufV
to: QmXFUupJCSfydJZ85HQHD8tU1L7CZFErbRdMTBxkAmBJaD
- from_text: tweet
to_text: cy is cool!
from: QmbdH2WBamyKLPE5zu4mJ9v49qvY8BFfoumoVPMR5V4Rvx
to: QmddL5M8JZiaUDcEHT2LgUnZZGLMTTDEYVKWN1iMLk6PY8Flags:
-D, --dont_replace - Don't replace the links cyberlinks table
--threads - A number of threads to use to pin particles (default: 3)Input/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ table โ
โ table โ table โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy links-pin-columns-using-kubo
```
Usage:
> links-pin-columns-using-kubo {flags}Flags:
-D, --dont_replace - Don't replace the links cyberlinks table
--pin_to_local_ipfs - Pin to local kubo
--ignore_cid - work with CIDs as regular texts
--skip_save_particle_in_cache - don't save particles to local cache in cid.md file
-q, --quiet - don't print information about tem folderInput/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ table โ
โ table โ table โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy pin-file-or-folder-to-cybernode
```
Usage:
> pin-file-or-folder-to-cybernode <$path>Parameters:
$path : the path to a folder or a file to pin```
### cy links-remove-existed-1by1
```
Remove existing in cybergraph cyberlinks from the temp tableUsage:
> links-remove-existed-1by1 {flags}Flags:
--all_links - check all links in the temp tableInput/output types:
โญโโinputโโโฌโoutputโโโฎ
โ nothing โ table โ
โ nothing โ nothing โ
โฐโโโโโโโโโโดโโโโโโโโโโฏ```
### cy links-remove-existed-using-snapshot
```
Remove existing links using graph snapshot dataUsage:
> links-remove-existed-using-snapshot```
### cy links-publish
```
Publish all links from the temp table to cybergraphUsage:
> links-publish {flags}Flags:
--links_per_trans```
### cy set-links-table-name
```
Set a custom name for the temp links csv tableUsage:
> set-links-table-name (name)Parameters:
name : a name for a temporary cyberlinks table file (optional)Input/output types:
โญโโinputโโโฌโoutputโโโฎ
โ nothing โ nothing โ
โฐโโโโโโโโโโดโโโโโโโโโโฏ```
### cy load-default-env
```
Usage:
> load-default-env```
### cy query-tx
```
Query tx by hashUsage:
> query-tx {flags}Flags:
--full_info - display all columns of a transactionParameters:
hash :Input/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ record โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy query-links-bandwidth-neuron
```
Usage:
> query-links-bandwidth-neuron (neuron)Parameters:
neuron : an address of a neuron (optional)Input/output types:
โญโโinputโโโฌโoutputโโฎ
โ nothing โ table โ
โฐโโโโโโโโโโดโโโโโโโโโฏ```
### cy config-new
```
Create a config JSON to set env variables, to use them as parameters in cyber cliUsage:
> config-new```
### cy config-view
```
View a saved JSON config fileUsage:
> config-view (config_name)Parameters:
config_name : (optional)```
### cy config-save
```
Save the piped-in JSON into a config file inside of `cy/config` folderUsage:
> config-save {flags}Flags:
--inactive - Don't activate current configParameters:
config_name :```
### cy config-activate
```
Activate the config JSONUsage:
> config-activateParameters:
config_name :```
### cy set-cy-setting
```
Usage:
> set-cy-setting {flags} (key) (value)Flags:
--output_value_onlyParameters:
key : (optional)
value : (optional)```
### cy help-cy
```
An ordered list of cy commandsUsage:
> help-cy```