Introducing: Jarvis - Your Personal Assistant for Steem

in #steem6 years ago (edited)

Jarvis (for Steem) is a script that automates essential functions for your Steem account[s]. Currently, Jarvis is able to do the following tasks:

  • Transfer SBD & STEEM to a specified account (incl. encrypted memo)
  • Power-up STEEM to a specified account
  • Delegate STEEMPOWER to specified account[s]
  • Claim SBD, STEEM & STEEMPOWER rewards

jarvis.png


Here are some examples of how Jarvis can help you:

  • Your alt accounts received some Steem? Jarvis can power it up automatically to your main account.
  • You have a specific cold-storage account. Jarvis can transfer new incoming liquid STEEM & SBD of all your accounts to the specified cold-storage account while keeping track of how much you want to keep on your other accounts.
  • You've got multiple accounts, to diversify your holdings and which should all powerup automatically to themselves, but your main-account should have that Steempower delegated for use? Well, Jarvis can do that for you.

Interested? Great! Setting it up isn't too difficult either.


Github

https://github.com/therealwolf42/steem-jarvis


Disclaimer: This software has been developed with rigour and cautiousness, but I'm not taking any responsibility for possible bugs or misuse/mistakes from the user. If you're using this software, you're accepting full responsibility for your own funds & accounts.


Getting Started


Docker Installation (Recommended)

It is recommended to use Docker.

git clone https://github.com/therealwolf42/steem-jarvis.git
cd steem-jarvis
chmod +x run.sh
./run.sh install_docker

# Choose MODE (Default: development => testing-mode without broadcasts to blockchain)
./run.sh build MODE # MODE is either production OR development
./run.sh start

# To get a list of possible commands, use: ./run.sh help

Manual Installation

However, you can also run the node manually, with PM2 or your favourite program.

Requirement: Node >= 8
sudo apt update
sudo apt install -y curl software-properties-common gnupg build-essential libssl-dev
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm i npm@latest -g


1.) Clone Repository and install packages

git clone https://github.com/therealwolf42/steem-jarvis.git
cd steem-jarvis
npm i


2.) Edit your Config


# There are 3 different example configs
# config.example.json (clean version)
# config.example.detailed.json (detailed version)
# config.example.smartsteem.json (version for Smartsteem.com)
cp configs/config.example.json configs/config.json
nano configs/config.json


Config Detailed Example


{
  "RPC_NODES": [
    "https://api.steemit.com",
    "https://api.steemitstage.com",
    "https://steemd.privex.io",
    "https://gtg.steem.house:8090",
    "https://rpc.buildteam.io",
    "https://steemd.minnowsupportproject.org"
  ],
  "KEY_PAIRS": [
    {
      "account": "veryuniqueaccount2",
      "type": "posting",
      "key": "5HFAKSS"
    },
    {
      "account": "veryuniqueaccount2",
      "type": "active",
      "key": "5JFJSFD"
    },
    {
      "account": "veryuniqueaccount2",
      "type": "memo",
      "key": "5JFJSFD"
    }
  ],
  "GENERAL": {
    "minimum_steem_for_powerup": 0,
    "minimum_steem_for_transfer": 0,
    "minimum_steem_for_delegation": 2,
    "interval_in_minutes": 30,
    "test_mode": false
  },
  "ACCOUNTS": [
    {
      "name": "veryuniqueaccount1",
      "claim_rewards": true,
      "key_account": "veryuniqueaccount2",
      "actions": [
        {
          "action_type": "powerup",
          "to": "veryuniqueaccount2",
          "asset": "STEEM",
          "keep": 5,
          "memo": "yourmemo"
        },
        {
          "action_type": "transfer",
          "to": "veryuniqueexchange",
          "asset": "SBD",
          "memo": "12345yourexchangeid",
          "encrypted": true
        },
        {
          "action_type": "delegate",
          "to": ["veryuniqueaccount2", "veryuniqueaccount3"],
          "keep": 5,
          "percentage": [60, 40]
        }
        
      ]
    },
    {
      "name": "veryuniqueaccount2",
      "claim_rewards": true,
      "key_account": "veryuniqueaccount2",
      "actions": [
        {
          "action_type": "delegate",
          "to": "veryuniqueaccount3",
          "percentage": 100
        }
        
      ]
    },
    {
      "name": "veryuniqueaccount3",
      "claim_rewards": true,
      "key_account": "veryuniqueaccount2",
      "actions": []
    }
  ]
}

Config Explanation

In the example above, I added all possible paths of using Jarvis so this should give you an idea, how to configure it, but here is the explanation in detail.


  • Key Pairs => Array of object
    • account=> Your account name
    • type=> either activeor postingor memo
    • key=> private key

  • General => General settings
    • minimum_steem_for_powerup => threshold for powerups
    • minimum_steem_for_transfer => threshold for transfers
    • minimum_steem_for_delegation => threshold for delegations
    • interval_in_minutes => how much time should pass between intervals of checking for work
    • test_mode => whether test mode should be forced (no actual transactions will be made)

  • Accounts => List your accounts here
    • name => Account name
    • claim_rewards => Whether rewards should be claimed (requires posting key)
    • key_account => If the key_authority should be used from another account (you could essentially give one account all your key authorities and use only 1 key-pair)
    • actions => Array of actions, see below

  • Action => What each account should do
    • action_type => can be transfer, powerup or delegate
    • to => account[s] that should be targeted i.e: where transfer/powerup/delegation should go to
    • asset => can be STEEM or SBD - only required for transfer & powerup (has to be STEEM for powerup)
    • keep => how much of the asset should be kept in the account
    • memo => only usable by transfers
    • encrypted => if the given memo should be encrypted (requires memo key as key-pair)
    • percentage => only required for delegate, how much of your total Steempower should go towards the user (has to be the same order as to field)

Manual Start


You can either run it directly with npm start or by using PM2.

sudo npm install pm2 -g # if you haven't installed it yet

pm2 start ecosystem.config.js --env production

Manual Testing


You can either set the test_mode inside the config to force the test-mode or start the program in development mode

npm run dev
# or
# pm2 start ecosystem.config.js

That's it for the technical post. Please let me know if the explanations were good enough.

I'll try to create another post in the near future, where I display some examples, how I'm personally utilizing Jarvis.

All the best,
Wolf


Do you believe that my work is valuable for Steem? Then please vote for me as witness.

Sort:  

Looks like a very useful project for people who have multiple accounts, great stuff! As @geronimo said, it would make a lot of sense to have a UI for the laymen out there - hopefully someone takes on that task for you.

As for the code itself:

  • Great to see you included so many tests!
  • Was wondering what __awaiter is - it's duplicated across multiple files many times, which could maybe be refactored.
  • There are a lot of functions like steem_to_vest, power_up etc. that I presume you also use in other projects; can't you make an npm package for these (I'm not exactly knowledgable about doing this, so I could be completely wrong).
  • Some small inconsistencies that could be fixed by using a linter, but other than that, it looks like a lot of high quality work.
  • Would be better to split up the commits instead of having one big one, but you know that already.
  • Great documentation on how to use the config!

Another great project from you, as always. Thanks for all the amazing work you do on the blockchain!


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

As @geronimo said, it would make a lot of sense to have a UI for the laymen out there - hopefully someone takes on that task for you.

I think so as well! :D

Was wondering what __awaiter is - it's duplicated across multiple files many times, which could maybe be refactored.

__awaiter is part of the compiled code dist. Normally, I don't ship this but when I'm expecting end-users to handle them, I do. It's def. not best practice and I might stop doing that in the future.

There are a lot of functions like steem_to_vest, power_up etc. that I presume you also use in other projects; can't you make an npm package for these (I'm not exactly knowledgable about doing this, so I could be completely wrong).

That's actually a goal, but I didn't have enough time for that and I didn't want to push something half-backed :D

Would be better to split up the commits instead of having one big one, but you know that already.

I had 50+ commits, but reduced them to one, simply as an initial commit.


Thanks for the in-depth feedback!

That's actually a goal, but I didn't have enough time for that and I didn't want to push something half-backed :D

Would be great, as I will be needing something like this in the future, haha!

WOMAN; you fall in love with the features that make you happy, and they try to take that feature from you.

Thank you for your review, @amosbastian! Keep up the good work!

wouldn`t make it sense to create an UI for this?

Yes. I would have done it myself, but I don't have enough time right now, so I'll create a task request. A simple html interface should be enough.

Maybe you can buy a html template from themeforest or templatemonster. Would save a lot of time. Keep up the good work!

Posted using Partiko iOS

Can we add “auto claiming discounted account” via RC ?

This would be a dominant feature. Set the minimum level that we want to allow rc to be depleted to, and claim an account when RC > Set Minimum + Account claim cost.

great project :)

sounds nice....

Oh man..... Jarvis is too hot for Mrs. Crabtree!

Congratulations! You have created a new element.

As always, you are the one, @therealwolf!

Mark Zuckerberg got Jarvis, but no FB user can use it. STEEM user have their own Jarvis.

Time to shill STEEM to FB users aggressively.

Posted using Partiko Android

Hell ya! Badass features thanks wolf!

My pleasure!

Could it be setup to automatic send steem with the newest post in memo to bots? :)

Posted using Partiko Android

Well, time to get an alt account and start using ActiFit + share2steem... Congrats @therealwolf, always building new things on the blockchain!