New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

croncat

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

croncat

cron.cat CLI and Agent Runner

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

croncat JS & CLI

croncat CLI is a Node.js application that relies on near-api-js to generate secure keys, connect to the NEAR platform and send transactions to the network on your behalf.

note that Node.js version 10+ is required to run croncat CLI

CLI Installation

npm install -g croncat

Commands

For a list of up-to-date commands, run croncat --help in your terminal.

Usage: croncat <command> [options]

Commands:
  croncat register <accountId> <payableAccountId>  Add your agent to cron known agents
  croncat update <accountId> <payableAccountId>    Update your agent to cron known agents
  croncat unregister <accountId>                   Account to remove from list of active agents.
  croncat withdraw <accountId>                     Withdraw all rewards earned for this account
  croncat status <accountId>                       Check agent status and balance for this account
  croncat tasks                                    Check how many tasks are available
  croncat go <accountId>                           Run tasks that are available, if agent is registered and has balance

Docker Installation & Setup

Before running the image make sure you are logged in with near:

near login

This should create the following directory (if it doesn't exist already):

ls ~/.near-credentials
default testnet

Build the image:

yarn docker:build

Run docker in detached mode and set the agent account id:

docker run --rm -d --env AGENT_ACCOUNT_ID=your_agent.testnet -v ~/.near-credentials:/root/.near-credentials croncat

Run the cli:

docker run --rm -it croncat ./croncat-cli

Add an alias for convenience:

alias croncat="docker run --rm -it croncat ./croncat-cli"

This will allow you to run the commands as seen below.

Development & Local Testing

To develop, you will need to:

  1. npm i or yarn
  2. npm run dev or yarn dev

For local testing: npm start or yarn start

You can also test against other networks: NODE_ENV=production yarn start which is the same as NODE_ENV=mainnet yarn start

Local CLI testing

To test methods, utilize local execution with the command syntax:

node bin/croncat COMMAND ARGS

Example:

node bin/croncat tasks

Deploy

Croncat CLI is available via npm, which auto-publishes every update to master.

For deploying docker, simply do the following commands:

npm run build:cli
npm run docker:build
docker tag croncat/agent:latest
docker push croncat/agent:latest

Keywords

FAQs

Package last updated on 19 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc