This project makes use of the Web3 Javascript Library, and a given project on Infura, which is a third-party service that allows interaction with the Ethereum network via the web3 library.
NodeJS version 14
(or newer) is required.
First, make a copy of the .env.example
file, and rename it to .env
:
cp .env.example .env
This is a fairly simple nodejs project. In order to build it, just cd
into the project directory and run:
npm install
Then, run npm run start
in order to initiate the server.
This script is designed to be called as a web API, via express (listening port: 8000
).
network
- required
Defines the Ethereum network. Can be one of mainnet
, rinkeby
, ropsten
, kovan
, goerli
project
- required
Defines the project id on thge Infura service.
from
- required
Defines the Ethereum address of the sender. Note: the address must not contain the 0x
starting part, this is added from the script itself.
to
- required
Defines the Ethereum address of the receiver. Note: the address must not contain the 0x
starting part, this is added from the script itself.
key
- required
Defines the Ethereum sender address private key. This is needed for the web3
library, in order to sign the transaction.
data
- optional
Optional parameter. Defines any arbitrary data that will be added as additional payload to the transaction. Can be a note from the sender, a greeting, or anything else.
The app can be instantly deployed via Docker. Just run
docker-compose up --build
And the docker container will be built and run. The app will then be available via localhost:8000
Notice: The docker-compose.yml
file assumes that an external docker network (docker_evolved5g_net
) has already been set up.
So, you either need to have the Evolved5g-Pilot project initialized, or just create an external network:
docker network create docker_evolved5g_net