SCENE - Smart Contract Events listeNEr
Docker and docker-compose needs to be installed to run the application.
Copy file from example
directory or copy&pase this code to docker-compose.yml
:
version: "2.2"
services:
scene:
image: beetleman/scene
ports:
- "3000:3000"
links:
- mongo
- kovan
environment:
- RPC_URL=http://kovan:8545
- MONGO_URL=mongodb://mongo:27017/dev
- DB_NAME=scene
mongo:
image: mongo:3.6.0
kovan:
image: parity/parity:v1.9.5
cpus: 0.5
volumes:
- kovan-chain:/root/.local/share/io.parity.ethereum
command: --chain kovan --unsafe-expose --no-warp --tracing on
volumes:
kovan-chain:
Run in
docker-compose upp scene
app will be avialable on http://localhost:3000
- get last 1000 events for
Transfer
from ERC20
curl --request POST \
--url http://localhost:3000/events \
--header 'content-type: application/json' \
--data '
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_from",
"type": "address"
},
{
"indexed": true,
"name": "_to",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
}
'
- get last 1000 events for
Transfer
fromDai Stablecoin v1.0
using query parametr
curl --request POST \
--url http://localhost:3000/events?address=0xc4375b7de8af5a38a93548eb8453a498222c4ff2 \
--header 'content-type: application/json' \
--data '
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_from",
"type": "address"
},
{
"indexed": true,
"name": "_to",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
}
'
After connect this types of mesages will be avialable
- example of subscribe call, address field is optional
{
"type": "subscribe",
"payload": {
"address": "0x0",
"abi": {
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_owner",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Balance",
"type": "event"
}
}
}
- example of unsubscribe call
{
"type": "unsubscribe",
"payload": {
"address": "0x0",
"abi": {
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_owner",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Balance",
"type": "event"
}
}
}
run the following command in the terminal to start Figwheel:
docker-compose up repl
Once Figwheel and node are running, you can connect to the remote REPL at localhost:7000
.
Type following code in the REPL to connect to Figwheel ClojureScript REPL.
(quick-dev)
docker-compose up release
- write real README
- integration tests
- spec all pure function
- configuration via env variable
- add more filter options
-
from
-
to
-
address
-
- doc