gethelp

module
v0.0.0-...-a308a5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2023 License: MIT

README

GETHELP

This is a simple project (Built with Kratos) to demo some capabilities of Go Etherium and provide helpful insights.

Note: This project is named as geth-help, not Get Help.

Tools Installation

  1. Install golang
  2. Install geth cli
  3. Install Make cli
  4. Run make init

Initial Setup

  1. Create a datadir folder for the eth node, e.g. blockchain-data, and cd into the folder
  2. Run geth --datadir ..\blockchain-data --keystore %LocalAppData%\Ethereum\Keystore init .\geth\genesis.json
  3. Create a new account using geth account new, then enter your password
  4. Retrieve your account address using geth account list, example "929548598a3b93362c5aa2a24de190d18e657ae0"
  5. Start local eth node using geth --datadir ..\blockchain-data --keystore %LocalAppData%\Ethereum\Keystore --mine --miner.etherbase "0x929548598a3b93362c5aa2a24de190d18e657ae0" --miner.threads 3
    • NOTE: Your node will start mining immediately, use geth attach and miner.stop() to stop mining while keeping the node alive.
Reproduce Steps
  1. To reset the blockchain, remove the contents in datadir (geth folder).
    • You may also remove the contents in %LocalAppData%\Ethereum\Keystore for accounts removal.
  2. Redo Initial Setup

Running the Application

  1. Start by running make run

Docker (TODO)

# build
docker build -t <your-docker-image-name> .

# run
docker run --rm -p 8000:8000 -p 9000:9000 -v </path/to/your/configs>:/data/conf <your-docker-image-name>

TODO List

  • Setup local eth node
  • Perform transactions on the node
    • Send eth
    • Validate recipient (Stretch goal)
  • Deposit money into wallet
    • Withdraw money from wallet
    • Make a HD Wallet (Stretch goal)
  • Simple REST API
    • GET Account balance (+Pending Balance)
      • Format output
    • GET Gas price
    • GET Transaction verification
    • Implement challenge for client (Stretch goal)
  • Create & Deploy Smart Contract (Stretch goal)
Tools Versions
Name Version
Go 1.20.4
Geth 1.11.6-stable-ea9e62ca
Kratos v2.0.0-20230515030202-6d741828c2d4
Protoc-gen-go v1.30.0

Directories

Path Synopsis
api
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL