2.3.1 • Published 2 months ago

ethernal v2.3.1

Weekly downloads
60
License
ISC
Repository
github
Last release
2 months ago

ethernal-cli

CLI to sync transactions with Ethernal.

Truffle & Brownie artifacts are also synced through this CLI, if you are using Hardhat, use this plugin.

If you are looking for more detailed doc about Ethernal: https://doc.tryethernal.com

Installation

OSX / Windows

npm install ethernal -g

Linux

On Linux systems, Ethernal CLI relies on libsecret to securely store your password. Make sure it's installed by running the following command, depending on your distribution:

  • Debian/Ubuntu: sudo apt-get install libsecret-1-dev
  • Red Hat-based: sudo yum install libsecret-devel
  • Arch Linux: sudo pacman -S libsecret

Source

Then run:

npm install ethernal -g

Usage

Authentication

Authentication is done through the env variables ETHERNAL_EMAIL abd ETHERNAL_PASSWORD. They need to be set for all the following commands to work properly.

Listening to transactions

This will synchronize blocks, transactions & contracts to Ethernal The CLI will connect to the URL set on the workspace you used last.

ethernal listen

For blocks & transactions, the whole object returned by web3 is synchronized with Ethernal.

Options

-w

Connect to the specified workspace. You can also set it with the env variable ETHERNAL_WORKSPACE.

ethernal listen -w workspace

-d

Specifiy which directory to watch (one or more, separated by a comma)

ethernal listen -d ~/solidity/project,~/solidity/project2

-s

Only listen to transactions, do not watch artifacts for changes. Useful if your blockchain is not on your local environment. Will be ignore if the -l flag is passed

ethernal listen -s

-l

Only watch artifact changes, do not listen to transactions. Useful if you ran the ethernal listen -s somewhere else.

ethernal listen -l

-h

Display help

ethernal listen -h

Artifacts Uploading

Running the listen command in a Truffle or Brownie project will automatically watch your artifacts, and upload the data everytime it changes. You can also pass a path to watch with the -d flag.

ethernal listen -d ~/solidity/my-project

Watch multiple directories at once:

ethernal listen -d ~/solidity/my-project,~/solidity/other-project

By default, only the name and the ABI of the contract are going to be uploaded. If you want to use the "Storage" tab of contracts page, you'll need to have the AST uploaded as well. To do so, pass the --astUpload flag as a parameter. ethernal listen --astUpload (this will upload the ast field, as well as the source field).

For Brownie projects, the flag dev_deployment_artifacts needs to be set to true in brownie-config.yaml.

Syncing a range of blocks

This will sync all blocks in a range (start and end of the range included), and their transactions. It takes two mandatory parameters: -f or --from is the first block to be synchronized, and -t or --to which is the last block.

ethernal sync -f 1 -t 10

Resetting a workspace

This will delete all accounts/blocks/transactions/contracts from a specific workspace

ethernal reset [workspace]

Public Explorer Verifying a contract

It is possible to verify a contract deployed on a public explorer using ethernal verify with the parameters described below. Contracts are verified using partial matches, meaning that metadata are stripped before doing the verification.

ArgumentShorthanddescriptionTypeRequired
--slug-sSlug of the explorer to connect tostringYes
--address-aAddress of the contract to verifystringYes
--compiler-cSolidity compiler version to use (See list here https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/list.json, use "longVersion" field)stringYes
--name-nName of the contract to verifystringYes
--path-pPath to the file containing the contract to verifystringYes
--libraries-lLink external library. Format path/to/library.sol:Library1=0x1234,path/to/library.sol:Library2=0x12345stringNo
--constructorArguments-gSpecify constructor arguments (ABI encoded)stringNo
--evmVersion-eSpecify EVM version (see https://docs.soliditylang.org/en/v0.8.16/using-the-compiler.html#target-options for valid options). Default to lateststringNo
--optimizer-oEnable optimizer. Default to falsebooleanNo
--runs-rNumber of runs if optimizer is enablednumberno

Example:

ethernal verify \
    --address="0xa4c190681d2b5cc3d86e62379e0bc94afe2282e7" \
    --slug="ethernal" \
    --path="contracts/ExampleERC20.sol" \
    --compiler="v0.8.0+commitc7dfd78e" \
    --name="ExampleERC20" \
    --optimizer=true \
    --runs=1000 \
    --evmVersion="byzantium" \
    --constructorArguments="000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000024869000000000000000000000000000000000000000000000000000000000000"
2.3.1

2 months ago

2.2.1

1 year ago

2.2.0

1 year ago

2.2.2

1 year ago

2.3.0

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

1.1.0

2 years ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

2 years ago

0.15.0

2 years ago

0.14.0

2 years ago

0.13.1

2 years ago

0.14.1

2 years ago

0.13.2

2 years ago

0.13.0

2 years ago

0.11.0

2 years ago

0.12.0

2 years ago

0.12.2

2 years ago

0.12.3

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.8.0

3 years ago

0.7.6

3 years ago

0.7.5

3 years ago

0.7.2

3 years ago

0.6.2

3 years ago

0.7.4

3 years ago

0.7.3

3 years ago

0.6.1

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago