项目作者: sc0Vu

项目描述 :
Ethereum development package in docker.
高级语言: Dockerfile
项目地址: git://github.com/sc0Vu/ethdock.git
创建时间: 2017-07-19T13:45:30Z
项目社区:https://github.com/sc0Vu/ethdock

开源协议:GNU General Public License v3.0

下载


ethdock

forthebadge

Ethereum smart contract development package in moby(docker).

Usage

geth

Default coinbase address: 0x7ee077f7afbc121e7b63d9baff6c8a52c3a9c2f3
Default coinbase private key: 0x88e524dee8bfb0dfb52ed4668ab88db605fe30b476e497d0fa1205e717fb9cb6

Do not use this private key on mainnet.

  1. docker-compose up -d workspace geth

Place the contract in app directory and enter container

  1. docker-compose exec workspace bash

Change truffle.js development

  1. development: {
  2. from: 'your-address-on-geth-blockchain',
  3. host: 'geth',
  4. port: 8545,
  5. network_id: '*'
  6. }

Or use provider

  1. development: {
  2. from: 'your-address-on-geth-blockchain',
  3. provider: web3.currentProvider
  4. network_id: '*'
  5. }

Unlock account

  1. web3.personal.unlockAccount('your-address-on-geth-blockchain', 'your-address-password-on-geth-blockchain')

Run test

  1. truffle test

ganache

  1. docker-compose up -d workspace ganache

Place the contract in app directory and enter container

  1. docker-compose exec workspace bash

Change truffle.js host

  1. host: 'ganache'

Run test

  1. truffle test

Test account for geth

We’ve created an test account for geth.

There is a UTC--2017-10-25T06-00-32.515667900Z--7c33ce8d9edd822f4ebba8823f4b73c2804baa00 file in /geth.

If you cannot create account, you can simply move the file to /data/keystore, and you’ll see an account 7c33ce8d9edd822f4ebba8823f4b73c2804baa00 with password 123456 on the chain.

Please remember that never use this account in production environment!

If you want to use your account, remamber to edit the /geth/genesis.json befor you start the geth service.

Have Fun!

FAQ

  • When I try to build geth container, I got this error: no space left on device
    It might be the disk space is not enough to build container.

    Please try to clean the docker images or docker volumes that not in use.

    You can run this command to find volumes.

    1. $ docker volume ls

    You can run this command to find images.

    1. $ docker images

    Remove volume.

    1. $ docker volume rm ...

    Remove all images with name none.

    1. $ docker rmi -f $(docker images | grep '^<none>' | awk '{print $3}')

License

GPL3.0