npm

Need private packages and team management tools?Check out npm Orgs. »

eth-contract-signed-tx-deployer

1.2.1 • Public • Published

toixe

Start

    npm i -g eth-contract-signed-tx-deployer

Commands list:

- toixe -v
- toixe init
- toixe deploy

More info:

Show version.

    toixe -v

Show installed version of the package.

Init by toixe

    mkdir test_folder_toixe
    cd test_folder_toixe
    toixe init

If the initialization is completed you will have a folder "toixe" with the default files:

  • toixe.conf
  • toixe.js
  • toixe.sol
toixe.conf

Config file which contains the deploy parameters.

  • ownerAddress - Address which pays for a deploy transaction. In transaction body this address listed as "from".

  • ownerKey - Private key to ownerAddress.

    Note: If key was set but it's wrong, then you won't get an error but your contract will be deployed from another address.

  • dataDir - Full path to "dataDir" of your "geth" which stores a keystore folder with files of keys. (it is used when "ownerKey" isn't set)

  • password - Password to keystore file of "ownerAddress". (it is used when "ownerKey" isn't set)

  • enodePath - Full path (with port if it's needed) to the enode for deploy.

  • gasLimit - gasLimit of your deploy transaction.

  • gasPrice - gasPrice of your deploy transaction.

  • chainId - chainId of network to deploy to. (by default the value of variable equals to "3" for deploy to Ropsten(testnet))

    Note: It's not a networkId

  • artifacts - Path to empty folder where toixe will save the global json of compilation to (it's a result of solc compilation).

  • contracts - Lists objects by solidity files. Objects should contain the keys:

    • name - name of this file
    • path - path to this file

    Note: See the default config file.

toixe.js

The example js file for simple contract deploy.

toixe.sol

The example sol file of simple contract.

Note: toixe.conf and toixe.js are reserved names of files for toixe. If one of them is not set then toixe will not work.

Deploy by toixe

    toixe deploy

Example of result:

                  °°°·.°·..·°¯°·._.· 𝕋𝕆𝕀𝕏𝔼 ·._.·°¯°·.·° .·°°°
                  
                 °°°·.°·..·°¯°·._.· 𝔻𝕖𝕡𝕝𝕠𝕪𝕖𝕣 ·._.·°¯°·.·° .·°°°
                 
 ⮚⮚⮚⮚⮚  ✉️      Global estimateGas is not calculated.
 ⮚⮚⮚⮚⮚  ✉️      Config ownerAddress - 0x38d4891cbbd2189ac0fcef8076ffdaaba54ab5e6 and dataDir - /path/to/my/dataDir
 ⮚⮚⮚⮚⮚  ✔      Key loading is complete.   🔑
 ⮚⮚⮚⮚⮚  ✉️      privateKey: bbd045706ce36236fe8c4e63b639e9██████████████████████████████████
 ⮚⮚⮚⮚⮚  ✉️      Bytecode has libraries:  ████████Lib.sol:████████Lib
 ⮚⮚⮚⮚⮚  ✉️      ████████Lib.sol:████████Lib library found in the result of compilation (saved to list to deploy).
 ⮚⮚⮚⮚⮚  ✉️      Estimate gas of "████████Lib" is  3680475
 ⮚⮚⮚⮚⮚  ✔      Got current "nonce". Number of this transaction is 17
 ⮚⮚⮚⮚⮚  ✔      Transaction is signed!   🖋
 ⮚⮚⮚⮚⮚  ✔      Check recover: 0x38d4891CbBd2189aC0FCeF8076fFDaaba54ab5e6
 ⮚⮚⮚⮚⮚  ✔      Hash of created transaction: 0x8c562b6a51e8423a0d5785e23da3a5d296649c7513d87f45f9eb976240969a34
 ⮚⮚⮚⮚⮚  ✔      ⌛️   Awaiting the mining...   ⛏
 ⮚⮚⮚⮚⮚  ✔      Got receipt!   🎉
 ⮚⮚⮚⮚⮚  ✔      Deploying of ████████Lib library returned the receipt -  
 { blockHash: '0x46ea44da5727ecc8a6fad7309a98b65b9f68f1ae84828d62ff6ed6f8d70eae40',
  blockNumber: 257,
  contractAddress: '0xA29321E8C7EF0e496f2d88ad863543dbD8481b1b',
  cumulativeGasUsed: 3680475,
  from: '0x38d4891cbbd2189ac0fcef8076ffdaaba54ab5e6',
  gasUsed: 3680475,
  logs: [],
  logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  root: '0xfcbea1cfd93c498625185a6e55028fc89fe567b3a19e9fc44b8c764704fb4031',
  to: null,
  transactionHash: '0x8c562b6a51e8423a0d5785e23da3a5d296649c7513d87f45f9eb976240969a34',
  transactionIndex: 0 }
 ⮚⮚⮚⮚⮚  ✉️      Estimate gas of "██████████" is  1476622
 ⮚⮚⮚⮚⮚  ✔      Got current "nonce". Number of this transaction is 18
 ⮚⮚⮚⮚⮚  ✔      Transaction is signed!   🖋
 ⮚⮚⮚⮚⮚  ✔      Check recover: 0x38d4891CbBd2189aC0FCeF8076fFDaaba54ab5e6
 ⮚⮚⮚⮚⮚  ✔      Hash of created transaction: 0x2a94be75884709da081f55cd56cf568ef1435168f4c04611714f1ed04ca82f42
 ⮚⮚⮚⮚⮚  ✔      ⌛️   Awaiting the mining...   ⛏
 ⮚⮚⮚⮚⮚  ✔      Got receipt!   🎉
 ⮚⮚⮚⮚⮚  ✉️      Deploy result -  
 { blockHash: '0x4f661b8bf6d96b4ae1e929e99a16bf29d6489d0026b1f6944de6e15f13190cd8',
  blockNumber: 260,
  contractAddress: '0x1611945921E9CD8D82Fc50553727D62AB408D3AF',
  cumulativeGasUsed: 1476622,
  from: '0x38d4891cbbd2189ac0fcef8076ffdaaba54ab5e6',
  gasUsed: 1476622,
  logs: [],
  logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  root: '0x555114bcdbf64c4758044c26de0cee2bb88f5068846c5f1858b36de1af514002',
  to: null,
  transactionHash: '0x2a94be75884709da081f55cd56cf568ef1435168f4c04611714f1ed04ca82f42',
  transactionIndex: 0 }
 ⮚⮚⮚⮚⮚  ✉️      Global estimateGas:  5157097

install

npm i eth-contract-signed-tx-deployer

Downloadsweekly downloads

27

version

1.2.1

license

ISC

repository

Gitbitbucket

last publish

collaborators

  • avatar
Report a vulnerability