はらぺこらいおん

日々、思ったことを。

Solidityの開発Tips

コンパイラー(solc)のインストール

https://book.ethereum-jp.net/first_use/contract.html

brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity
brew linkapps solidity
solc --version

MistをPrivate Netに接続する

mac OS how connect private chain · Issue #1403 · ethereum/mist · GitHub

gethのオプションに以下を追加する。Walletのデフォルトの動きとして以下のディレクトリーにソケットを探しに行くため。

--ipcpath ~/Library/Ethereum/geth.ipc
geth --datadir ./data --mine --nodiscover --maxpeers 0 --networkid 15 --rpc --rpcport 8545 --rpcaddr "0.0.0.0" --rpcapi="db,eth,net,web3,personal,web3" --rpccorsdomain "*" --ipcpath ~/Library/Ethereum/geth.ipc

Parityにconsole接続

How to open the JavaScript console on Parity? - Ethereum Stack Exchange

gethを利用する。

Linux

geth attach ~/.local/share/io.parity.ethereum/jsonrpc.ipc

Mac

geth attach ~/Library/Application Support/io.parity.ethereum/jsonrpc.ipc

Listenしているポートを確認

How to check if port is in use on Linux or Unix - nixCraft

Linux

sudo lsof -i -P -n | grep LISTEN