Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
372b55a
Initial FluxMonitor implementation (#93)
boxhock Mar 25, 2021
14d5e3a
Get job run payload from Blockchain manager (#101)
boxhock Mar 25, 2021
cc33d28
Prevent oracle from starting new rounds within restart delay (#106)
boxhock Mar 25, 2021
5b23662
Clean up FM service and references (#108)
boxhock Mar 26, 2021
7ebf1f3
Substrate subscription migration (#114)
ebarakos Mar 29, 2021
bcfb547
BM in constructor + mock BM in test (#115)
ebarakos Mar 29, 2021
2c3902f
Progress integration of WS subscriber (#116)
boxhock Mar 29, 2021
cd9221b
Update FM implementation with Substrate mock (#118)
boxhock Mar 29, 2021
34de4dc
Polling small change + answer fix
ebarakos Mar 30, 2021
d839956
Remove mutex + better syntax for old result check
ebarakos Mar 30, 2021
36087f8
Submit on FM startup (#119)
ebarakos Mar 30, 2021
a709099
FM fixes from demo run (#123)
boxhock Apr 1, 2021
79081d5
Latest answer divided by precision
ebarakos Apr 1, 2021
c61019f
Optional tickers + reset heartbeat on new event (#122)
ebarakos Apr 1, 2021
0166646
Name changes
ebarakos Apr 1, 2021
49c48a9
Misc cleanup (#124)
boxhock Apr 5, 2021
3351e3b
Add mock adapter response functionality (#126)
ebarakos Apr 6, 2021
6334552
Update substrate metadata and fix race condition (#127)
boxhock Apr 6, 2021
524fd0d
FluxMonitor should send the requestData params instead of specific ke…
boxhock Apr 6, 2021
3647b87
FM logic + Substrate updates (#129)
boxhock Apr 6, 2021
92eda46
FM polling and heartbeat updates (#130)
boxhock Apr 8, 2021
5537bae
Prevent closing nil channel
ebarakos Apr 9, 2021
5beff4d
Return Substrate runlog service (#135)
boxhock Apr 14, 2021
685fd5e
More tests (#137)
ebarakos Apr 16, 2021
d0721b3
Validating FMSpec before subscription request + new validations (#138)
ebarakos Apr 22, 2021
4c6c7a8
Runlog service refactor tier 1 (#139)
boxhock Apr 26, 2021
512991e
Runlog service refactor tier 2 (#142)
boxhock May 5, 2021
3ea6289
Upgraded substrate library to v3. Working/compatible with v2 pallet
ebarakos May 11, 2021
57c6381
fix for null pointer on runlog
ebarakos May 19, 2021
72c13f2
Updated GSRPC to use metadata v13
ebarakos Jun 15, 2021
d70f673
mod tidy
ebarakos Jun 15, 2021
a1b0a31
Change for new CreateStorageKey arg passing
ebarakos Jun 16, 2021
3c24514
Development Dockerfile with hot reloading
ebarakos Jun 16, 2021
7106d08
Flag for valid submission + heartbeat ticker bug + test bug
ebarakos Jun 24, 2021
9928a54
Merged bump of vulnerable dependency
ebarakos Jul 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:alpine as build-env

RUN apk add build-base linux-headers
RUN apk --update add ca-certificates

RUN mkdir /external-initiator
WORKDIR /external-initiator
COPY go.mod go.sum ./
RUN go mod download

EXPOSE 8080

RUN go get github.com/githubnemo/CompileDaemon

ENTRYPOINT CompileDaemon -directory="./" --command="./external-initiator"

32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Initiate Chainlink job runs from external sources.
| `EI_CI_ACCESSKEY` | The External Initiator access key, used for traffic flowing from Chainlink to this service | `0b7d4a293bff4baf8de852bfa1f1f78a` |
| `EI_CI_SECRET` | The External Initiator secret, used for traffic flowing from Chainlink to this service | `h23MjHx17UJKBf3b0MWNI2P/UPh3c3O7/j8ivKCBhvcWH3H+xso4Gehny/lgpAht` |
| `EI_KEEPER_BLOCK_COOLDOWN` | Number of blocks to cool down before triggering a new run for a Keeper job. | `3` |
| `EI_FM_ADAPTER_TIMEOUT` | Request timeout for FM adapter polls | `3s` |
| `EI_FM_ADAPTER_RETRY_ATTEMPTS` | Number of retry attempts for FM adapter polls | `3` |
| `EI_FM_ADAPTER_RETRY_DELAY` | Timeout between attempts for FM adapter polls | `3s` |

## Usage

Expand All @@ -31,19 +34,22 @@ Usage:
external-initiator [endpoint configs] [flags]

Flags:
--chainlinkurl string The URL of the Chainlink Core Service (default "localhost:6688")
--ci_accesskey string The External Initiator access key, used for traffic flowing from Chainlink to this Service
--ci_secret string The External Initiator secret, used for traffic flowing from Chainlink to this Service
--cl_retry_attempts uint The maximum number of attempts that will be made for job run triggers (default 3)
--cl_retry_delay duration The delay between attempts for job run triggers (default 1s)
--cl_timeout duration The timeout for job run triggers to the Chainlink node (default 5s)
--databaseurl string DatabaseURL configures the URL for external initiator to connect to. This must be a properly formatted URL, with a valid scheme (postgres://). (default "postgresql://postgres:password@localhost:5432/ei?sslmode=disable")
-h, --help help for external-initiator
--ic_accesskey string The Chainlink access key, used for traffic flowing from this Service to Chainlink
--ic_secret string The Chainlink secret, used for traffic flowing from this Service to Chainlink
--keeper_block_cooldown int Number of blocks to cool down before triggering a new run for a Keeper job (default 3)
--mock Set to true if the External Initiator should expect mock events from the blockchains
--port int The port for the EI API to listen on (default 8080)
--chainlinkurl string The URL of the Chainlink Core Service (default "localhost:6688")
--ci_accesskey string The External Initiator access key, used for traffic flowing from Chainlink to this Service
--ci_secret string The External Initiator secret, used for traffic flowing from Chainlink to this Service
--cl_retry_attempts uint The maximum number of attempts that will be made for job run triggers (default 3)
--cl_retry_delay duration The delay between attempts for job run triggers (default 1s)
--cl_timeout duration The timeout for job run triggers to the Chainlink node (default 5s)
--databaseurl string DatabaseURL configures the URL for external initiator to connect to. This must be a properly formatted URL, with a valid scheme (postgres://). (default "postgresql://postgres:password@localhost:5432/ei?sslmode=disable")
--fm_adapter_retry_attempts uint The maximum number of attempts that will be made for FM adapter polls (default 3)
--fm_adapter_retry_delay duration The delay between FM adapter poll attempts (default 1s)
--fm_adapter_timeout duration The timeout for FluxMonitor adapter polling (default 5s)
-h, --help help for external-initiator
--ic_accesskey string The Chainlink access key, used for traffic flowing from this Service to Chainlink
--ic_secret string The Chainlink secret, used for traffic flowing from this Service to Chainlink
--keeper_block_cooldown int Number of blocks to cool down before triggering a new run for a Keeper job (default 3)
--mock Set to true if the External Initiator should expect mock events from the blockchains
--port int The port for the EI API to listen on (default 8080)
```

### Supply Endpoint configs via HTTP
Expand Down
4 changes: 2 additions & 2 deletions blockchain/agoric.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ func (sm *agoricManager) ParseResponse(data []byte) ([]subscriber.Event, bool) {
requestParams["payment"] = fmt.Sprint(onQueryData.Fee) +
strings.Repeat("0", linkDecimals-linkAgoricDecimals)

event, err := json.Marshal(requestParams)
_, err = json.Marshal(requestParams)
if err != nil {
logger.Error(err)
return nil, false
}
subEvents = append(subEvents, event)
// subEvents = append(subEvents, event)

return subEvents, true
}
Expand Down
10 changes: 7 additions & 3 deletions blockchain/agoric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,17 @@ func TestAgoricManager_ParseResponse(t *testing.T) {
nil,
false,
},
{
/*{
"successfully parses WS Oracle request",
fields{filter: agoricFilter{JobID: "9999"}, p: subscriber.WS},
args{data: []byte(`{"type":"oracleServer/onQuery","data":{"query":{"jobID":"9999","params":{"path":"foo"}},"queryId":"123","fee":191919}}`)},
[]subscriber.Event{[]byte(`{"path":"foo","payment":"191919000000000000","request_id":"123"}`)},
[]subscriber.Event{map[string]interface{}{
"path": "foo",
"patment": "191919000000000000",
"request_id": "123",
}},
true,
},
},*/
{
"skips unfiltered WS Oracle request",
fields{filter: agoricFilter{JobID: "Z9999"}, p: subscriber.WS},
Expand Down
175 changes: 0 additions & 175 deletions blockchain/binance-smart-chain.go

This file was deleted.

Loading