• Stars
    star
    500
  • Rank 85,353 (Top 2 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created over 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CLI tool for Smart Contract error tracking, monitoring and alerting.

Tenderly CLI

GitHub tag (latest SemVer)

Tenderly CLI is a suite of development tools that allows you to debug, monitor and track the execution of your smart contracts.

Table of Contents

Installation

macOS

You can install the Tenderly CLI via the Homebrew package manager:

brew tap tenderly/tenderly
brew install tenderly

Or if you prefer you can also install by using cURL and running our installation script:

curl https://raw.githubusercontent.com/Tenderly/tenderly-cli/master/scripts/install-macos.sh | sh

Linux

You can install the Tenderly CLI by using cURL and running our installation script.

With root privileges user:

curl https://raw.githubusercontent.com/Tenderly/tenderly-cli/master/scripts/install-linux.sh | sh

Or with sudo user:

curl https://raw.githubusercontent.com/Tenderly/tenderly-cli/master/scripts/install-linux.sh | sudo sh

Windows

Go to the release page, download the latest version and put it somewhere in your $PATH.

Updating

You can check the current version of the CLI by running:

tenderly version

To upgrade it via Homebrew:

brew upgrade tenderly

Usage

Login

The login command is used to authenticate the Tenderly CLI with your Tenderly Dashboard.

tenderly login

Command Flags

Flag Default Description
--authentication-method / Pick the authentication method. Possible values are email or access-key
--email / The email used when authentication method is email
--password / The password used when authentication method is email
--access-key / The token used when authentication method is access-key
--force false Don't check if you are already logged in
--help / Help for login command

Init

The init command is used to connect your local project directory with a project in the Tenderly Dashboard.

tenderly init

Command Flags

Flag Default Description
--project / The project name used for generating the configuration file
--create-project false Creates the project provided by the --project flag if it doesn't exist
--re-init false Force initializes the project if it was already initialized
--help / Help for init command

Example how to initialize tenderly project

For Tenderly CLI to work you need to have a deployments directory inside your project. You can generate that one using hardhat-tenderly

  1. To install hardhat-tenderly run.
npm install --save-dev @tenderly/hardhat-tenderly
  1. Add the following statement to your hardhat.config.js:
require("@tenderly/hardhat-tenderly");

Or, if you are using typescript:

import "@tenderly/hardhat-tenderly"
  1. Then you need to call it from your scripts (using ethers to deploy a contract):
const Greeter = await ethers.getContractFactory("Greeter");
const greeter = await Greeter.deploy("Hello, Hardhat!");

await greeter.deployed()

await hre.tenderly.persistArtifacts({
    name: "Greeter",
    address: greeter.address,
})

persistArtifacts accept variadic parameters:

const contracts = [
    {
        name: "Greeter",
        address: "123"
    },
    {
        name: "Greeter2",
        address: "456"
    }
]

await hre.tenderly.persistArtifacts(...contracts)
  1. Run: npx hardhat compile to compile contracts
  2. Run: npx hardhat node --network hardhat to start a local node
  3. Run: npx hardhat run scripts/sample-script.js --network localhost to run a script
  4. And at the end now when deployments directory was built you can run tenderly init

Push

If you are using Hardhat, take a look at docs instead of using this command.

The push command is used to add your contracts to the Tenderly Dashboard.

Note that the push command is used only for adding contracts that are deployed to a public network. For local networks see the export command.

tenderly push

Command Flags

Flag Default Description
--networks / A comma separated list of network ids to push
--tag / Optional tag used for filtering and referencing pushed contracts
--project-slug / Optional project slug used to pick only one project to push (see advanced usage)
--help / Help for push command

Advanced usage

It is possible to push to multiple projects by editing the tenderly.yaml file and providing a map of projects and their networks. To do this remove the already provided project_slug property and replace it with the projects property like the example below;

projects: # running tenderly push will push the smart contracts to all of the provided projects
  my-cool-project:
    networks:
      - "1" # mainnet
      - "42" # kovan
  my-other-project:
  # if the networks property is not provided or is empty the project will be pushed to all of the migrated networks
  company-account/my-other-project:
  # if you want to push to a shared project provide the full project identifier
  # the identifier can be found in your Tenderly dashboard under the projects name

Export init

In order to use the tenderly export command you need to define a configuration file (which is described in more detail in the export command advanced usage section).

tenderly export init

Command Flags

Flag Default Description
--project / The project name used for network configuration
--rpc / Rpc server address (example: 127.0.0.1:8545)
--forked-network / In case you forked a public network (example: mainnet)
--help / Help for export init command

Export

The export command can be used to access transaction debugging tooling available at https://dashboard.tenderly.co/ but for local transactions.

Use the Transaction Overview , Human-Readable Stack-Traces , Debugger , Gas Profiler , Decoded Events and State to boost your local development productivity.

tenderly export {{transaction_hash}}

Command Arguments

Name Description
transaction hash Hash of the local transaction to debug

Command Flags

Flag Default Description
--export-network / The name of the exported network in the configuration file
--project / The project in which the exported transactions will be stored
--rpc 127.0.0.1:8545 The address and port of the local rpc node
--forked-network / Optional name of the network which you are forking locally. Can be one of Mainnet, Goerli, Kovan, Ropsten, Rinkeby, xDai
--protocol / Specify the protocol used for the rpc node. By default wss, https, ws, http are tried in that order
--help / Help for export command
--force false Export the transaction regardless of gas mismatch

Advanced usage

If your local node has different blocks defined for hardforks or you want to generate the configuration file yourself, you can find the example bellow:

exports: # running tenderly export will export local transaction to the provided project
  my-network:
    project_slug: my-cool-project
    rpc_address: 127.0.0.1:8545
    protocol: http
    forked_network: mainnet
    chain_config:
      homestead_block: 0 # (default 0)
      eip150_block: 0 # (default 0)
      eip150_hash: 0x0 # (default 0x0)
      eip155_block: 0 # (default 0)
      eip158_block: 0 # (default 0)
      byzantium_block: 0 # (default 0)
      constantinople_block: 0 # (default 0)
      petersburg_block: 0 # (default 0)
      istanbul_block: 0 # (default 0)
      berlin_block: 0 # (default 0)
      london_block: 0 # (default 0)

  my-company-network:
    project_slug: company-account/my-other-project
    rpc_address: rpc.ethereum.company:8545
    # if you want to export to a shared project provide the full project identifier
    # the identifier can be found in your Tenderly dashboard under the projects name

Verify

The verify command uploads your smart contracts and verifies them on Tenderly.

tenderly verify

Command Flags

Flag Default Description
--networks / A comma separated list of network ids to verify
--help / Help for verify command

Check for updates

The update-check command checks if there is a new version of the Tenderly CLI and gives update instructions and changelog information.

Version

The version command prints out the current version of the Tenderly CLI.

tenderly version

Who am I?

The whoami command prints out basic information about the currently logged in account

tenderly whoami

Logout

The logout command disconnects your local Tenderly CLI from your Tenderly Dashboard

tenderly logout

Proxy Debugging

The proxy command is deprecated in favor of the export command.

Global Flags

In addition to command specific flags, the following flags can be passed to any command

Flag Default Description
--debug false Turn on debug level logging
--output text Which output mode to use: text or json. If not provided. text output will be used.
--global-config config Global configuration file name (without the extension)
--project-config tenderly Project configuration file name (without the extension)
--project-dir "./" The directory in which your Truffle project resides

Report Bugs / Feedback

We look forward to any feedback you want to share with us or if you're stuck with a problem you can contact us at [email protected].


Made with ♥ by Tenderly

More Repositories

1

hardhat-tenderly

Tenderly plugin for HardHat
TypeScript
146
star
2

integration-samples

This repository offers a collection of standalone Tenderly integration examples, catering to diverse use cases, to jumpstart your projects.
TypeScript
41
star
3

tenderly-sdk

With the Tenderly SDK, you can simulate individual transactions or bundles of transactions, manage contracts and wallets, and verify contracts from your code.
TypeScript
33
star
4

ethberlinzwei-maglev

An Ethereum Tx Station - Batch transactions and save 30% on gas costs. 🚄🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃💨
Go
29
star
5

node-extensions-library

Create custom JSON-RPC methods with Tenderly Node Extension Library
TypeScript
26
star
6

tenderly-actions

Deploy a custom JavaScript/Typescript function that hooks into an on-chain event and builds active monitoring or a serverless backend for a dapp, improves dapp UX, and connects different services.
TypeScript
26
star
7

tenderly-examples

This repository contains examples showcasing the Tenderly development platform.
TypeScript
23
star
8

sol.tty

JavaScript
22
star
9

ethparis-txflow

See the full execution path for a given transaction, both cross contract and within a single contract.
CSS
17
star
10

examples-web3-actions

A repository of Tenderly's Web3 actions examples
TypeScript
16
star
11

tenderly-docs

Documentation website for Tenderly WIP
13
star
12

tenderly-snap

Tenderly TX Preview allows you to see the exact transaction outcomes before sending them on-chain using the Tenderly Simulation Infrastructure. 🦊
TypeScript
9
star
13

debugger-chrome-extension

JavaScript
8
star
14

tenderly-metamask-snap-simulate-asset-changes

Tenderly MetaMask Snap using the Tenderly Simulation API to showcase transaction asset changes. 🦊
TypeScript
7
star
15

devnet-examples

This repo provides a collection of resources and examples to help developers leverage DevNets' managed environments and tools for efficient, secure, and independent smart contract development.
TypeScript
5
star
16

ethparis-zippo

Zippo - Hot Module Replacement (HMR) for Solidity contacts developed on EthParis 2019 Hackathon.
Go
4
star
17

boba

Go
3
star
18

remix-tenderly

TypeScript
3
star
19

tenderly-rabby-transaction-preview

Integrate the Tenderly Simulation API into Rabby Wallet to enable a transaction preview option for wallet users.
TypeScript
3
star
20

tenderly-trace

Go
2
star
21

tenderly-gnosis-workshop-tic-tac-toe

TypeScript
2
star
22

bsc

Go
2
star
23

minimal-contract-verification

TypeScript
2
star
24

nitro

Go
1
star
25

war-room-workshop-dappcon-22

Quantstamp and Tenderly War Room Simulation
Solidity
1
star
26

rsk-core

Go
1
star
27

mini-multisig

Tenderly Demo using a mini-multisig as an example
TypeScript
1
star
28

.github

Tenderly GitHub
1
star
29

uniswap-playground-mode

Learn how to build a dapp playground mode for Uniswap's UI using Tenderly Forks.
TypeScript
1
star