Giter Site home page Giter Site logo

tenderly / tenderly-cli Goto Github PK

View Code? Open in Web Editor NEW
507.0 25.0 121.0 977 KB

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

Home Page: https://tenderly.co

License: GNU General Public License v3.0

Go 99.44% Shell 0.54% Makefile 0.02%
smart-contracts monitoring error-tracking ethereum cli alerting developer-tools real-time-analytics

tenderly-cli's Introduction

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.

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
      - "5" # goerli
  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

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

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

tenderly-cli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tenderly-cli's Issues

Push fails with imported contracts

Hi, I'm using hardhat seems like an issue with imports?

This worked:

interface IUniswapV2Pair {
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}

contract Reserves {
...
}

This didn't:

import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";

contract Reserves {
...
}

I got compiler_error when running tenderly contracts push.

dont have deployments directory

Enviroment

hardhat: 2.9.3
terderly: v1.4.2
OS: MacBook Pro (13-inch, M1, 2020)
I am using hardhat, following the documentation, but the deployments directory does not appear, so I cannot tenderly init.

Unable to get transaction rerunning information: error processing transaction: user error: gas mismatch between receipt and actual gas used, message: Rerun gas mismatch for transaction

Scenario :

Local ganache in forked mode.
Ganache Command :

ganache-cli -f <my rpc url> -i 1

Yaml Config

account_id: <my account id>
project_slug: <my project name> 

exports: # running tenderly export will export local transaction to the provided project
  my-network:
    project_slug: <my project name>
    rpc_address: 127.0.0.1:8545 // local ganache node in forked mode
    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)

Command :
tenderly export 0x2f226311b066a0361e1505319e5061087247199bce513f5f02577f87978c6138 --debug

Error :

Collecting network information...
Collecting transaction information...

Unable to get transaction rerunning information: error processing transaction: user error: gas mismatch between receipt and actual gas used, message: Rerun gas mismatch for transaction 0x2f226311b066a0361e1505319e5061087247199bce513f5f02577f87978c6138. This can happen when the chain config is incorrect or the local node is not running the latest version.

Please check which hardfork is active on your local node. If you are not running the newest fork, comment out the forks block in tenderly.yaml



Buidler support

Hey, I see that using tenderly-cli you can push contracts from a truffle project, is it possible to do the same on a Buidler one?

Maybe as a workaround it would be great to "import verified" contracts based on the address as it's done from the web app but programatically.

error when using tenderly fork rpc

error message:
Internal JSON-RPC error. { "code": -32603, "message": "internal error", "data": "EstimateGas: call simulate api: {"code":403,"id":"907cefbd-a69b-4819-9e25-2b22aa82238c","msg":"intent execution not allowed","slug":"intent_execution_not_allowed"}" }

Tenderly-cli login troubleshooting

Hello,

My setup is Ubuntu 22LTS & i get this error message on tenderly cli when entering my email credentials or via token in tender login :
"couldn' write global confog file "

Any insights would help.

Couldn't read Truffle config file

tenderly.yaml in same dir as truffle-config.js

tenderly push

Setting up your project...
Analyzing Truffle configuration...
Couldn't read Truffle config file

"Couldn't extract trace"

This is a very promising tool! We've been looking for something exactly like this.

I'm testing locally with the latest release (v0.2.6), but I'm not getting the expected stack trace that points to a line of code in the smart contract. For example, when I run truffle exec on one of the scripts I get this:

/usr/src/tenderly-cli/demo # truffle exec scripts/fail-multi-contract-1.js  --network proxy
Using network 'proxy'.

Successfully thrown error! Error: Invalid number of arguments to Solidity function
    at Object.InvalidNumberOfSolidityArgs (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:25:1)
    at SolidityFunction.validateArgs (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/function.js:74:1)
    at SolidityFunction.toPayload (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/function.js:90:1)
    at SolidityFunction.sendTransaction (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/function.js:163:1)
    at SolidityFunction.execute (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/function.js:256:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/contract.js:204:1
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/contract.js:155:1

And in the tenderly logs I see:

Couldn't extract trace

Replacing contracts instead of pushing

Hello,

It would be very useful to be able to replace a contract on tenderly that has been pushed by a newer version.
Especially on testnets when it's pretty common to deploy multiple versions for testing.
I'm using tenderly with hardhat and the process is:

  • dev pushes a feature on an existing contract
  • feature is merged on master
  • CI pushes automatically on tenderly on multiple networks

Without the replace option, i would end up with multiple versions of the same contract

Nevertheless, awesome product!
Maxime

Cannot export local transaction to tenderly using cli

Tenderly Current CLI version: v1.4.7
Hardhat Version: 2.12.2
Compiler version: 0.8.15

Trying to export a local transaction. It used to work bu not anymore.

The export fails with the following error message: Couldn't read Hardhat config file:
When I debug it there is this error:

[eval]:20
                var jsonConfig = JSON.stringify(config, (key, value) => {
                                      ^

TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)
    at [eval]:20:25
    at Script.runInThisContext (node:vm:129:12)
    at Object.runInThisContext (node:vm:305:38)
    at node:internal/process/execution:75:19
    at [eval]-wrapper:6:22
    at evalScript (node:internal/process/execution:74:60)
    at node:internal/main/eval_string:27:3

Let me know if you need anything else

Edit: With 2.8.0 hardhat it works just fine not sure where the problem is

tenderly export failed

  1. Run a hardhat node npx hardhat node --fork https://eth-mainnet.alchemyapi.io/v2/<API_KEY> --fork-block-number 15120938
  2. Run my script to create a transaction, after that I got a transaction hash
  3. Run tenderly export 0xa891b44b6c2270162f83d5135d4b288c1c2dd70518e5293301093cbe3762103e --debug, output below:
Trying OpenZeppelin config path: networks.js
couldn't read new OpenzeppelinConfig config file
Trying buidler config path: buidler.config.js
couldn't read new Buidler config file
Trying hardhat config path: hardhat.config.js
unable to fetch config
 Couldn't read Hardhat config file
Trying hardhat ts config path: hardhat.config.ts
Making request
Got response with body
Collecting network information...

Collecting transaction information...
  1. hardhat node output infinity... seems stuck in somewhere
eth_getTransactionReceipt
eth_getStorageAt

  Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x1' has a length of 3

eth_getTransactionReceipt
eth_getStorageAt

  Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x1' has a length of 3

eth_getTransactionReceipt
eth_getStorageAt

  Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x1' has a length of 3

eth_getTransactionReceipt
eth_getStorageAt

  Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x1' has a length of 3

eth_getTransactionReceipt
eth_getStorageAt

  Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x1' has a length of 3

eth_getTransactionReceipt
eth_getStorageAt

  Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x1' has a length of 3

eth_getTransactionReceipt
eth_getStorageAt

  Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x1' has a length of 3
...

cannot receipt output data using tenderly fork rpc

This is my code
image
This is the receipt
image

other parameters likes "from","to"exist,but not output data of the functions,the output data exits in frontend of tenderly but i want to get it in code.

This is the frontend of the tx.
image

Cannot export transaction from localhost network (hardhat node) in hardhat project

Running tenderly export <trx hash> in my hardhat project fails.

Here's the end of the output from tenderly export <trx hash> --output json --debug:

{"file":"/go/pkg/mod/github.com/sirupsen/[email protected]/logger.go:192","func":"github.com/sirupsen/logrus.(*Logger).Log","level":"info","msg":"Collecting transaction information...\n","time":"2022-04-05T23:38:37+01:00"}
{"file":"/go/pkg/mod/github.com/sirupsen/[email protected]/logger.go:192","func":"github.com/sirupsen/logrus.(*Logger).Log","level":"info","msg":"Collecting contracts...","time":"2022-04-05T23:38:37+01:00"}
{"file":"/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:314","func":"github.com/sirupsen/logrus.(*Entry).Logf","level":"debug","msg":"Trying Hardhat config path: /Users/my_project_path/hardhat.config.js","time":"2022-04-05T23:38:37+01:00"}
{"file":"/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:314","func":"github.com/sirupsen/logrus.(*Entry).Logf","level":"debug","msg":"Trying Hardhat config path: /Users/my_project_path/hardhat.config.ts","time":"2022-04-05T23:38:37+01:00"}
{"file":"/go/pkg/mod/github.com/sirupsen/[email protected]/logger.go:192","func":"github.com/sirupsen/logrus.(*Logger).Log","level":"debug","msg":"encountered unexcepted error: runtime error: invalid memory address or nil pointer dereference","time":"2022-04-05T23:38:39+01:00"}
{"file":"/go/pkg/mod/github.com/sirupsen/[email protected]/logger.go:192","func":"github.com/sirupsen/logrus.(*Logger).Log","level":"error","msg":"\nEncountered an unexpected error. This can happen if you are running an older version of the Tenderly CLI.","time":"2022-04-05T23:38:39+01:00"}

And here is my (stripped-down) hardhat.config.ts:

import { HardhatUserConfig } from "hardhat/config";

const config: HardhatUserConfig = {
  solidity: {
    compilers: [
      {
        version: "0.8.9",
      },
    ],
  },
  networks: {
    localhost: {
      url: "http://127.0.0.1:8545",
    },
  },
  paths: {
    sources: "./contracts",
    tests: "./test",
    cache: "./cache",
    artifacts: "./artifacts",
  },
};

export default config;

npx hardhat --version: 2.8.0
tenderly version: Current CLI version: v1.4.1

Any idea what's going wrong, or how I find out?

Unable to brew tap

Unable to perform brew tap tenderly/tenderly as mentioned in README.

% brew tap tenderly/tenderly
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
autorestic           [email protected]            imath                lm-sensors           qodem                seqkit               sysstat              webhook
fabric-installer     gtksourceview5       lefthook             nox                  revive               stp                  tssh
==> Updated Formulae
Updated 489 formulae.

==> Tapping tenderly/tenderly
Cloning into '/opt/homebrew/Library/Taps/tenderly/homebrew-tenderly'...
remote: Enumerating objects: 554, done.
remote: Counting objects: 100% (87/87), done.
remote: Compressing objects: 100% (87/87), done.
remote: Total 554 (delta 28), reused 0 (delta 0), pack-reused 467
Receiving objects: 100% (554/554), 66.50 KiB | 2.46 MiB/s, done.
Resolving deltas: 100% (179/179), done.
Error: Invalid formula: /opt/homebrew/Library/Taps/tenderly/homebrew-tenderly/tenderly.rb
formulae require at least a URL
Error: Cannot tap tenderly/tenderly: invalid syntax in tap!

% brew install tenderly
==> Tapping homebrew/cask
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 567803, done.
remote: Total 567803 (delta 0), reused 0 (delta 0), pack-reused 567803
Receiving objects: 100% (567803/567803), 251.52 MiB | 1.98 MiB/s, done.
Resolving deltas: 100% (400984/400984), done.
Tapped 3895 casks (4,013 files, 269.8MB).
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "tenderly".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

Local Transactions in Ganache BSC fork

I am unable to export local transaction of a forked binance chain in ganache.

I am using truffle and I run the commands in the truffle directory:

This is the command tenderly export init

✔ Choose the name for the exported network: Ganache
✔ BigFoot
✔ Enter rpc address (default: 127.0.0.1:8545): xxx.xxx.xxx.xxx:8546
✔ Binance

But when I run tenderly export

tenderly export 0x55fb651dd7da5533889e8780b07f50065d899982188965a8bd166953fb88a1dd --rpc xxx.xxx.xxx.xxx:8546 --debug
Trying OpenZeppelin config path: networks.js
couldn't read new OpenzeppelinConfig config file
Trying buidler config path: buidler.config.js
couldn't read new Buidler config file
Trying hardhat config path: hardhat.config.js
Trying hardhat ts config path: hardhat.config.ts
Trying brownie config path: brownie-config.yaml
Trying truffle config path: truffle-config.js
Collecting network information...

Collecting transaction information...

Unable to get transaction rerunning information: error processing transaction: user error: %!s(<nil>), message: Missing block base fee parameter for block 11109803, london hard fork is probabbly not activated.
Transaction processing failed. To see more info about this error, please run this command with the --debug flag.
Try exporting with --force to ignore some validation

May be that not work with forked bsc chain ?

truffle verify give me an error:

root@bsctoken:/node/bigfoot-finance/contracts# tenderly verify
Verifying your contracts...
Analyzing provider configuration...
Couldn't read provider build files at: build/contracts

But directory build/contracts exists and it has the contracts in json.

Any help?

Thanks in advance

Transaction export error (couldn't read hardhat config file)

Trying OpenZeppelin config path: networks.js
couldn't read new OpenzeppelinConfig config file
Trying buidler config path: buidler.config.js
couldn't read new Buidler config file
Trying hardhat config path: hardhat.config.js
Making request
Got response with body
Collecting network information...

Collecting transaction information...

Collecting contracts...
Trying Hardhat config path: /Users/stkolmagorov/Documents/Projects/smart-contracts/Development/dapp/hardhat.config.js
Trying Hardhat config path: /Users/stkolmagorov/Documents/Projects/smart-contracts/Development/dapp/hardhat.config.ts
Unable to get contract: unable to fetch config: stat /Users/stkolmagorov/Documents/Projects/smart-contracts/Development/dapp/hardhat.config.ts: no such file or directory
Couldn't read Hardhat config file

For some reason tenderly export [tx-hash] won't work but hardhat.config.js exists in dapp folder. Could someone explain why?

Couldn't read Truffle config file when running tenderly proxy

I am trying to run tenderly proxy on my project and whenever I run the command tenderly proxy in my root directory where my truffle config is i get the error Couldn't read Truffle config file
the truffle-config.js is there and looks like this:
// See http://truffleframework.com/docs/advanced/configuration
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "", // Match any network id
gasPrice: 20000000000, // Gas price used for deploys
gas: 6721975 // Gas limit used for deploys
},
production: {
host: "localhost",
port: 7545,
network_id: "
", // Match any network id
gasPrice: 20000000000, // Gas price used for deploys
gas: 6721975 // Gas limit used for deploys
},
coverage: { // See https://www.npmjs.com/package/solidity-coverage#network-configuration
host: "localhost",
port: 7555, // Also in .solcover.js
network_id: "*", // Match any network id
gasPrice: 0x1, // Gas price used for deploys
gas: 0x1fffffffffffff // Gas limit used for deploys
}
},
compilers: {
solc: {
version: "0.4.26" // ex: "0.4.20". (Default: Truffle's installed solc)
}
},
mocha: {
enableTimeouts: false,
useColors: true,
bail: true,
reporter: "list" // See https://mochajs.org/#reporters
},
solc: {
version: "0.4.26",
optimizer: {
enabled: true,
runs: 200
}
}
};

Hardhat configuration "was not detected" (bug)

The CLI does not recognize a hardhat repository. Both init and export state this error:

Brownie, Hardhat, Buidler, OpenZeppelin or Truffle configuration was not detected.

Please re-run this command in a folder where at least one of the frameworks is configured.

tenderly export --debug --output json

{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:206","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"Trying OpenZeppelin config path: networks.js","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:222","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"couldn't read new OpenzeppelinConfig config file","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:224","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"Trying buidler config path: buidler.config.js","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:245","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"couldn't read new Buidler config file","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:247","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"Trying hardhat config path: hardhat.config.js","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:268","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"Trying hardhat ts config path: hardhat.config.ts","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:289","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"Trying brownie config path: brownie-config.yaml","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:304","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"Trying truffle config path: truffle-config.js","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:321","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"couldn't read new truffle config file: stat truffle-config.js: no such file or directory","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:323","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"Trying old truffle config path: truffle-config.js","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/util.go:332","func":"github.com/tenderly/tenderly-cli/commands.InitProvider","level":"debug","msg":"unable to fetch config\nCouldn't read old Truffle config file","time":"2022-01-28T23:18:18+01:00"}
{"file":"/go/src/github.com/tenderly/tenderly-cli/commands/common.go:23","func":"github.com/tenderly/tenderly-cli/commands.CheckProvider","level":"error","msg":"Brownie, Hardhat, Buidler, OpenZeppelin or Truffle configuration was not detected.\n\nPlease re-run this command in a folder where at least one of the frameworks is configured.","time":"2022-01-28T23:18:18+01:00"}

ls

README.md 
artifacts
contracts
deployments
node_modules
package.json
tenderly.yaml
cache
data
hardhat.config.js
package-lock.json
scripts
test

I'm assuming this is a bug. Any help is appreciated.

`tenderly init` not recognizing OpenZeppelin project

Create a new folder and run the following commands:

npm init -y
yarn add @openzeppelin/cli
yarn add --dev @openzeppelin/test-environment mocha chai
npx oz init
tenderly init

The result of the last command is

OpenZeppelin or Truffle configuration was not detected.

Please re-run this command in a folder where at least one of the frameworks is configured.

I've tried adding a contract to the contracts folder and still get the same result, and have confirmed that I'm logged in with Tenderly. I am using Tenderly CLI v0.8.0

CLI isn't easy to install with OSX and Linux install scripts

Just a heads up, the OSX and Linux install scripts both failed for me. This is the output for the OSX installer:

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

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1098  100  1098    0     0  10270      0 --:--:-- --:--:-- --:--:-- 10358
Installing version 0.2.6

dyld: Library not loaded: /opt/pkg/lib/libicuuc.63.dylib
  Referenced from: /opt/pkg/lib/libpsl.5.dylib
  Reason: image not found
sh: line 43:  4700 Done                    curl -s https://api.github.com/repos/Tenderly/tenderly-cli/releases/latest
      4701                       | grep "browser_download_url.*Darwin_amd64\.tar\.gz"
      4702                       | cut -d ":" -f 2,3
      4703 Broken pipe: 13         | tr -d \"
      4704 Abort trap: 6           | wget -qi -
tar: Option -f requires an argument
Usage:
  List:    tar -tf <archive-filename>
  Extract: tar -xf <archive-filename>
  Create:  tar -cf <archive-filename> [filenames...]
  Help:    tar --help
chmod: tenderly: No such file or directory
Moving CLI to /usr/local/bin/

mv: rename tenderly to /usr/local/bin/tenderly: No such file or directory
Tenderly CLI installed to: 

sh: line 38: tenderly: command not found
New Tenderly version installed:

On Linux I ended up downloading the latest release directly.

Local transaction export not working

I have ganache-cli running blockchain VM. On that I am performing truffle test and when I try to export a transaction, it gives me this error

Unable to get transaction rerunning information: error processing transaction: user error: %!s(<nil>), message: Missing block base fee parameter 
for block 38, london hard fork is probabbly not activated

Is it problem of ganache or tenderly?

Internal server error on init

Hello,

Just installed tenderly with brew, login is ok and when I try to init with the following command I get this return :

tenderly init --debug
Trying OpenZeppelin config path: networks.js
unable to fetch config
Couldn't read OpenZeppelin config file
couldn't read new OpenzeppelinConfig config file
Trying buidler config path: buidler.config.js
unable to fetch config
Couldn't read Buidler config file
couldn't read new Buidler config file
Trying hardhat config path: hardhat.config.js
unable to fetch config
Couldn't read Hardhat config file
Trying hardhat ts config path: hardhat.config.ts
Making request
Got response with body
Couldn't detect provider directory structure. This can be caused by:

• The directory is not set correctly. If this is the case, either check if you are in the right directory or pass an alternative directory by using the --project-dir flag.
• Tenderly is having trouble reading the directory correctly. If you think this is the case, rerun this command with the --force flag.

or with --force flag

tenderly init --force --debug
Making request
Got response with body
get projects call: internal_server_error
Internal Server Error

I got a standard hardhat project (only just src directory to run some node scripts).
image

I don't know how to get more verbose output in order to understand what is happening.

Can you please help ?
Thanks :)

tenderly-cli cannot verify on local network

user@DESKTOP:/mnt/c/Users/Ploy/Documents/hardhat-typescript$ tenderly contracts verify --networks localhost --debug
Setting up your project...
Trying OpenZeppelin config path: networks.js
unable to fetch config
 Couldn't read OpenZeppelin config file
couldn't read new OpenzeppelinConfig config file
Trying buidler config path: buidler.config.js
unable to fetch config
 Couldn't read Buidler config file
couldn't read new Buidler config file
Trying hardhat config path: hardhat.config.js
unable to fetch config
 Couldn't read Hardhat config file
Trying hardhat ts config path: hardhat.config.ts
Making request
Got response with body
Verifying your contracts...
Analyzing provider configuration...
Trying Hardhat config path: /mnt/c/Users/Ploy/Documents/hardhat-typescript/hardhat.config.js
Trying Hardhat config path: /mnt/c/Users/Ploy/Documents/hardhat-typescript/hardhat.config.ts
encountered unexcepted error: runtime error: index out of range [0] with length 0

Encountered an unexpected error. This can happen if you are running an older version of the Tenderly CLI. 

The version I use

use@DESKTOP:/mnt/c/Users/Ploy/Documents/hardhat-typescript$ tenderly version
Current CLI version: v1.4.1

I already tenderly init
What's the problem can cuase this problem? my repo here

Unable to resolve path for some of the compiled files while building/deploying

Dear tenderly team, I have found the strange behavior while compiling the files (tenderly actions build/deploy).
Context: if we will have just folders in actions/ dir, then builder will skip these folders while compiling in out/ dir
To reproduce:

  1. init a new project
  2. add any folder in actions/ dir, e.g. src/
  3. create an file with action's function, e.g. actions/src/index.ts
  4. in tenderly.yaml
sources: actions
    specs:
      example-action-name:
        description: This is just an example, but you can publish this action.
        function: src/index:functionName
  1. then run tenderly actions build
    Output: Unable to resolve path for some of the compiled files: actions/out/src/index.js
    Make sure all imported files are contained in the configured action sources directory (actions).

Solution:

  1. create any empty file in actions/, e.g. actions/any.ts
  2. run tenderly actions build

Problem in file path resolution while compiling. Builder preserves the folder structure only if other files exist in the same level as folder itself

tenderly export not working

I'm creating a node using hardhat. when I try to export a local transaction It loops through this message over the node logs

eth_getStorageAt
Errors encountered in param 1: Storage slot argument must have a length of 66 ("0x" + 32 bytes), but '0x0' has a length of 3

this is my package.json

{ "dependencies": { "@tenderly/hardhat-tenderly": "^1.1.4", "hardhat": "^2.10.1", "yarn-upgrade-all": "^0.7.1" }, "devDependencies": { "@ethersproject/abi": "^5.6.4", "@ethersproject/providers": "^5.6.8", "@nomicfoundation/hardhat-chai-matchers": "^1.0.2", "@nomicfoundation/hardhat-network-helpers": "^1.0.3", "@nomicfoundation/hardhat-toolbox": "^1.0.2", "@nomiclabs/hardhat-ethers": "^2.1.0", "@nomiclabs/hardhat-etherscan": "^3.1.0", "@typechain/ethers-v5": "^10.1.0", "@typechain/hardhat": "^6.1.2", "chai": "^4.3.6", "ethers": "^5.6.9", "hardhat-gas-reporter": "^1.0.8", "solidity-coverage": "^0.7.21", "typechain": "^8.1.0" } }

Couldn't read Truffle build files at: build/contracts

When I run "truffle push" from truffle directory I get this error, but the directory build/contracts exists and the .json files are there.

# tenderly push --debug
Setting up your project...
Trying OpenZeppelin config path: networks.js
couldn't read new OpenzeppelinConfig config file
Trying buidler config path: buidler.config.js
couldn't read new Buidler config file
Trying hardhat config path: hardhat.config.js
Trying hardhat ts config path: hardhat.config.ts
Trying brownie config path: brownie-config.yaml
Trying truffle config path: truffle-config.js
Analyzing Truffle configuration...
Trying truffle config path: /node/bigfoot-finance/contracts/truffle-config.js
Pushing Smart Contracts for project: bigfoot
unable to upload contracts: unable to get provider contracts: failed reading contract source file: open project:/contracts/bsc/BscMasterChef.sol: no such file or directory
Couldn't read Truffle build files at: build/contracts

Unable to push hardhat contracts

Hi, I'm trying to debug failed transactions from a local ganache network with a dapp that has been built using hardhat.

After checking out this repo & and adding a ganache network to the hardhat.config.ts (see below for details), I run

  1. yarn hardhat deploy --network ganache
  2. tenderly init
  3. tenderly push --networks ganache

And am getting the following error:

Couldn't read Hardhat build files at: deployments

This is my ganache config:

ganache: {
  ...sharedNetworkConfig,
  url: `http://localhost:8545`,
},

The same applies without specifying any networks (despite the contracts being deployed on Rinkeby, xDAI and Mainnet).

Would you be able to provide any pointers as to what configuration I might be missing?

Thanks

Better documentation

As it stands, the current documentation makes it rather hard to understand how to operate the cli. For example, it is not apparent how one is supposed to upload missing source files in order to trace blockchain transactions found through the site's explorer.

Some examples would be very helpful and would better illustrate the usefulness of this tool.

show "Compiler version is inconsistent" when doing `tenderly export`

✗ tenderly export --export-network p2 0x7e84858a5827........45e3580da34a697b7c3a
Collecting network information...

Collecting transaction information...

Collecting contracts...
Compiler version is inconsistent

any idea what this means?

version info:

  • tenderly CLI version: v1.4.5
  • solidity version of the contract: 0.8.15

Error when pushing to tenderly (kovan network), contract that imports from @openzeppelin [Hardhat]

Hi!

I receive this error when pushing to push a single contract that imports other contracts from @openzepplin, installed in node_modules) (through tenderly push)

image

If I try to do this through my deployment function in hardhat (which contains the following calls):

    await tenderly.persistArtifacts({
      name: contractName,
      address: contractAddress
    });

    let verification = await tenderly.verify({
        name: contractName,
        address: contractAddress,
        network: targetNetwork
      })

It returns the following error

Error in hardhat-tenderly: There was an error during the request. Contract verification failed

What am I doing wrong?

Project is initiated at my repo with correct credentials, contract compiles and deploys to kovan correctly.

Thanks

Error: "flag provided but not defined: -target-host"

When I try to run the Linux version of tenderly inside a Docker container with this command:

./tenderly --target-host "host.docker.internal" proxy

I get this error:

flag provided but not defined: -target-host

in a rapidly repeating infinite loop.

I did check that the correct port is open on that host:

/src # nc -vz host.docker.internal 8545
host.docker.internal (192.168.65.2:8545) open

If you clone my fork of the repo (https://github.com/markerdmann/tenderly-cli), you can test this easily by running docker-compose run app sh in the /demo directory and then running CLI command above.

Brownie configuration structure mismatch

Description

The current go specification that is used to unmarshal Brownie configuration YAML files does not conform to the official Brownie configuration file layout:

type Config struct {
ProjectDirectory string `json:"project_directory" yaml:"project_directory"`
BuildDirectory string `json:"contracts_build_directory" yaml:"build_directory"`
Networks map[string]NetworkConfig `json:"networks" yaml:"-"`
Solc map[string]Optimizer `json:"solc" yaml:"solc"`
Compilers map[string]Compiler `json:"compilers" yaml:"compiler"`
ConfigType string `json:"-"`
Paths Paths `json:"paths" yaml:"paths"`
}

The Brownie config is currently unmarshalled into this structure here.

Proposed solution

Currently, I have a draft PR that includes a Brownie configuration read test, but doesn't modify the common Config structure.

The obvious solution here would probably be to create a separate configuration structure for each provider, because they can have subtle differences, and use that.

Should I open a separate PR that standardizes these configuration reads?

@delta003 @Riphal @mspuz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.