Giter Club home page Giter Club logo

geth-block's Introduction

geth_block

About

Create and interact with a Private Blockchain Using GETH [Go-ETHEREUM]

QUICKSTART

To install geth,

sudo apt update
sudo apt install ethereum

To create a node account,

geth --datadir "./data" account new 

To establish a connection,

geth --datadir ./data init ../geth_block/geth_block.json

Let's now create and generate a boot key for connecting node1 to bootnode and node2 to bootnode and viseversa

Create and generate a boot key

bootnode -genkey boot.key

To start a new network connection,

bootnode -nodekey boot.key

To fully start the connection

Navigate to the bootNode directory

./GETH/bootNode 
bootnode -nodekey "./boot.key" -verbosity 7 -addr "127.0.0.1:30303"

Connect node1,

geth --networkid 14333 --datadir "./data" --bootnodes enode://903307600f04d59ff73ecc41016a2112aedebd4021799f764092872bd4aa75b55786bb14665f6171707ba5aa242afe7691b70303deea79ab46c0f63af6d59fed@127.0.0.1:0?discport=30301 --port 30300 --ipcdisable --syncmode full --rpc --allow-insecure-unlock --rpccorsdomain "*" --rpcport 8545 --unlock 0xa23b87d009c9023BeF10442568C3392CA3eeD89d --password password.txt --mine console

If rpc endpoint doesn't work, try using http as folows,

geth --networkid 14333 --datadir "./data" --bootnodes enode://903307600f04d59ff73ecc41016a2112aedebd4021799f764092872bd4aa75b55786bb14665f6171707ba5aa242afe7691b70303deea79ab46c0f63af6d59fed@127.0.0.1:0?discport=30301 --port 30303 --ipcdisable --syncmode full --http --allow-insecure-unlock --http.port 8545 --unlock 0xca9AdF6627A549c8D593439ab79E19f912E6dB11 --password password.txt --mine console

Connect node2,

geth --networkid 14333 --datadir "./data" --bootnodes enode://903307600f04d59ff73ecc41016a2112aedebd4021799f764092872bd4aa75b55786bb14665f6171707ba5aa242afe7691b70303deea79ab46c0f63af6d59fed@127.0.0.1:0?discport=30301 --port 30303 --ipcdisable --syncmode full --rpc --allow-insecure-unlock --rpccorsdomain "*" --rpcport 8545 --unlock 0xa23b87d009c9023BeF10442568C3392CA3eeD89d --password password.txt console

Want to only start a peer-2-peer network?

geth --networkid 14144 --datadir "./data" --bootnodes enode://903307600f04d59ff73ecc41016a2112aedebd4021799f764092872bd4aa75b55786bb14665f6171707ba5aa242afe7691b70303deea79ab46c0f63af6d59fed@127.0.0.1:0?discport=30301

If rpc endpoint doesn't work, try using http as follows,

geth --networkid 14333 --datadir "./data" --bootnodes enode://903307600f04d59ff73ecc41016a2112aedebd4021799f764092872bd4aa75b55786bb14665f6171707ba5aa242afe7691b70303deea79ab46c0f63af6d59fed@127.0.0.1:0?discport=30301 --port 30303 --ipcdisable --syncmode full --http --allow-insecure-unlock --http.port 8545 --unlock 0xca9AdF6627A549c8D593439ab79E19f912E6dB11 --password password.txt console

Start mining some ether, Use console

Configuration

geth --datadir "./data" --networkid 14144 --port 30303 --ipcdisable --syncmode full --mine console

Unlock Your account

personal.unlockAccount("contract_account_address", "password", 0)

Start mining

In geth console,

miner.start()

Check mining status

eth.mining

If true, check mined blocks

eth.Number

After, when mining is done, stop mining

miner.stop()

@0xJonaseb11

geth-block's People

Contributors

0xjonaseb11 avatar

Stargazers

 avatar Landry Chretien avatar Laurent  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.