Random transactions, to-and-fro the self and a peer.
Start by setting up a local, and preferably persistent, Ethereum blockchain.
npm ci
npx ganache -v -d --database.dbPath ./blk -i 344 -a 25
Choose from the output and add the relevant variables to a .env
file in the root.
# Required
WEB3_SELF_ADDRESS="<your-address>"
WEB3_SELF_KEY="<your-private-key>"
WEB3_PEER_ADDRESS="<another-address>"
WEB3_PEER_KEY="<their-private-key>"
# Optional
WEB3_PROVIDER="<ethereum-provider>"
Following are the instructions to run the application with different frameworks.
Web3.js is an Ethereum client for JavaScript.
npx ts-node index.ts
Web3.py is an Ethereum client for Python.
python -m venv env
. ./env/bin/activate
pip install -r requirements.txt
python app.py
Web3j is an Ethereum client for Java.
cd java/Web3Transactions
sdk env
mvn clean install
mvn package
java -jar target/Web3Transactions-1.0-SNAPSHOT-jar-with-dependencies.jar
Go-Ethereum is an Ethereum client for Go.
go mod download
go run .
Rust-Web3 is an Ethereum client for Rust.
cd rust
cargo run