Testrpc

Testrpc 並使用相同的埠啟動

  • June 12, 2017

在為 ethereum 設置環境時,我得到一個錯誤,埠 8545 被另一個程序監聽,實際上 testrpc 和登船模擬器都使用相同的埠。如果我殺死一個程序並給另一個程序,那麼情況並非如此。我想使用不同的埠來使用這兩個程序。如何更改該程序的埠號(testrpc 或登船)。如何更改登船模擬器的埠(或 testrpc 的埠)?

您可以設置啟動區塊鏈在所用網路(即)config/blockchain.json的參數處監聽的埠,如下所述:https ://github.com/iurimatias/embark-framework#working-with-different-chainsrpcPort``livenet/testnet/privatenet

您可以根據使用詳細資訊使用(or ) 選項設置testrpc’s 埠:-p``--port

$ testrpc <options>
Options:

-a or --accounts: Specify the number of accounts to generate at startup.
-b or --blocktime: Specify blocktime in seconds for automatic mining. Default is 0 and no auto-mining.
-d or --deterministic: Generate deterministic addresses based on a pre-defined mnemonic.
-n or --secure: Lock available accounts by default (good for third party transaction signing)
-m or --mnemonic: Use a specific HD wallet mnemonic to generate initial addresses.
-p or --port: Port number to listen on. Defaults to 8545.
-h or --hostname: Hostname to listen on. Defaults to Node's server.listen() default.
-s or --seed: Use arbitrary data to generate the HD wallet mnemonic to be used.
-g or --gasPrice: Use a custom Gas Price (defaults to 20000000000)
-l or --gasLimit: Use a custom Gas Limit (defaults to 0x47E7C4)
-f or --fork: Fork from another currently running Ethereum client at a given block. Input should be the HTTP location and port of the other client, e.g. http://localhost:8545. You can optionally specify the block to fork from using an @ sign: http://localhost:8545@1599200.
-i or --network-id: Specify the network id the TestRPC will use to identify itself (defaults to the current time or the network id of the forked blockchain if configured)
--db: Specify a path to a directory to save the chain database. If a database already exists, the TestRPC will initialize that chain instead of creating a new one.
--debug: Output VM opcodes for debugging
--mem: Output TestRPC memory usage statistics. This replaces normal output.

引用自:https://ethereum.stackexchange.com/questions/17772