To start the application, you need to enter the command npm start
Environment variables:
HOST
- network listening addressPORT
- network listening portGETH
- address of geth rpc serverACCOUNTS
- list of private keys separated by commas
To run the tests you need to enter the commands:
npm run test:ganache
npm run test:start
npm test
Request:
POST /deploy
Content-Type: application/json
{
"source": "<smart contract source code>",
"compiler": "<solidity compiler version>",
"contract": {
"name": "<the name of the smart contract, which will be deployed to the blockchain>",
"args": "[<enumeration of smart contract constructor arguments>]",
"from": "<the account address, which will be used when deploying>"
}
}
Response:
{
uuid: "<unique number of the deployed smart contract>",
address: "<address of the deployed smart contract>"
}
Request:
POST /read
{
uuid: "<unique number of the deployed smart contract>",
func: "<smart contract method>",
args: "<smart contract method arguments>",
from: "<the account address, which will be used when calling>",
}
Response: depends on smart contract
Request:
POST /send
{
uuid: "<unique number of the deployed smart contract>",
func: "<smart contract method>",
args: "<smart contract method arguments>",
from: "<the account address, which will be used when calling>",
value: "<amount of wei to be sent to the method>"
}
Response: transaction receipt