The contract is located in the contract.sol
file and the code for the script is in index.js
.
- Node.js 8+
- NPM 5+
- 2 addresses with priv keys
- Run
npm install
- Add the following environment variables:
# EVERYTHIGN RUNS ON THE ROPSTEN NETWORK!
export CONTRACTOR_ADDRESS="" # contractor address
export CONTRACTOR_PRIVATE_KEY="" # contractor private key
export USER_ADDRESS="" # client address
export USER_PRIVATE_KEY="" # client private key
export CONTRACT_ADDRESS="" # address of published contract
- Run
npm start
in two different terminals - Select
contractor
in one andclient
in the other. - Register a contractor from 0 to 10
- After the transaction confirms, make a query from the client with the following text:
FROM X TO Y
where X and Y are between 0 and 10; - Mine the transaction with the given hash
- Check the result of the query in client
- Fix CTRL + C issue
- Automatically mine when in contractor mode
- Calculate the cost based on the length of the return
- Add support for events in the contract
- Set up private contractors
- Handle refunds based on block number and duration specified by the client
- Add
0x
to the TXIDs - Add support for pub/priv/shared keys