This project provides JavaScript scripts to interact with the Steem blockchain. It includes tools for delegating and returning vesting shares, using the steem-js library with multi-node failover support.
- Delegation: Delegate STEEM Power (VESTS) to other accounts
- Return Delegation: Return delegated STEEM Power (VESTS) from other accounts
- Easy Input: Specify amounts in STEEM instead of VESTS for user convenience
- Multi-Node Support: Automatic failover between multiple Steem nodes
- Connection Testing: Test connectivity to Steem nodes with detailed information
Before running the scripts, ensure you have the following installed:
-
Clone this repository:
git clone https://github.com/Steemblocks/Steem-Local-Broadcast.git cd Steem-Local-Broadcast -
Install the required dependencies:
npm install
-
Edit the
config.jsfile and add your Steem account details and preferred nodes:module.exports = { username: 'your-userid', // Replace with your Steem username activeKey: 'your-active-key', // Replace with your active private key nodes: [ 'https://api.steemit.com', 'https://api.moecki.online', 'https://steemd.steemworld.org', 'https://api.steemitdev.com' ], currentNodeIndex: 0 // Index of the initially selected node };
Replace
your-usernameandyour-active-keywith your Steem account credentials. The nodes list can be modified according to your preferences.
Before performing any operations, you can test the connection to the Steem nodes:
node testConnection.jsThis will:
- Connect to the first available node
- Display detailed blockchain information
- Automatically switch to alternative nodes if the current one fails
To delegate STEEM Power to another account, use the steemDelegate.js script:
node steemDelegate.js <delegatee> <steemAmount><delegatee>: The account you want to delegate to<steemAmount>: The amount of STEEM to delegate
Example:
node steemDelegate.js "the-gorilla" 1000This delegates 1000 STEEM worth of VESTS to the account the-gorilla. If the current node fails, the script will automatically try other available nodes.
To return delegated STEEM Power from another account, use the cancelDelegation.js script:
node cancelDelegation.js <delegatee> <steemAmount><delegatee>: The account you want to return delegation from<steemAmount>: The amount of STEEM to return
Example:
node cancelDelegation.js "avro33" 0.00This returns all STEEM delegation from the account avro33. After canceling, you can delegate again using steemDelegate.js with your desired amount.
All scripts include automatic node failover:
- If the primary node fails, the system automatically switches to the next available node
- The operation is retried on the new node without user intervention
- The process continues until a working node is found or all nodes have been tried
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
- steem-js: The JavaScript library for interacting with the Steem blockchain.
- Steem Developers: Official Steem developer documentation.
If you have any questions or need help, feel free to open an issue or contact the maintainers. https://steemit.com/@dhaka.witness