-
Notifications
You must be signed in to change notification settings - Fork 67
Run E2E PoC
- Set up an .env file:
ROOT=/chainlink
LOG_LEVEL=debug
ETH_CHAIN_ID=3
MIN_OUTGOING_CONFIRMATIONS=2
LINK_CONTRACT_ADDRESS=0x20fe562d797a42dcb3399062ae9546cd06f63280
CHAINLINK_TLS_PORT=0
SECURE_COOKIES=false
ALLOW_ORIGINS=*
ETH_URL=wss://ropsten.infura.io/ws
-
Start container:
docker run -p 6688:6688 -v ./:/chainlink -it --env-file=.env smartcontract/chainlink local n
-
Follow instructions given to set up an account
-
Open docker container bash
-
Authenticate with credentials created above:
chainlink admin login
-
Add EI with
chainlink initiators create test-ei http://$EXTERNAL_INITIATOR_URL:PORT/jobs
It is recommended to get familiar with the External Initiator's run instructions before starting: https://github.com/smartcontractkit/substrate-adapter
The EI needs a Postgres database to run. By default, it expects to connect to postgres:password@localhost:5432/ei
-
Install dependencies:
go get
-
Build executable:
go build -o external-initiator
-
Run EI using credentials generated above and Substrate node:
./external-initiator "{\"name\":\"substrate-node-1\",\"type\":\"substrate\",\"url\":\"ws://$YOUR_SUBSTRATE_NODE_IP:PORT/\"}" --ic_accesskey="$IC_ACCESSKEY" --ic_secret="$IC_SECRET" --ci_accesskey="$CI_ACCESSKEY" --ci_secret="$CI_SECRET"
It is recommended to get familiar with the Substrate Adapter's run instructions before starting: https://github.com/smartcontractkit/substrate-adapter
-
Install subkey
-
Install dependencies:
go get
-
Build executable:
go build -o substrate-adapter
-
Set applicable environment variables
-
Run with
./substrate-adapter
-
Access the Chainlink node GUI at
http://localhost:6688/
-
Head over to Bridges and create new
-
Give it the name "substrate" and enter the URL the adapter is listening on
- Create new job in the CL node GUI with the following jobspec:
{
"initiators": [
{
"type": "external",
"params": {
"name": "test-ei",
"body": {
"endpoint": "substrate-node-1",
"accountIds": [
"$YOUR_SUBSTRATE_ADDRESS"
]
}
}
}
],
"tasks": [
{
"type": "httpget"
},
{
"type": "jsonparse"
},
{
"type": "multiply"
},
{
"type": "substrate"
}
]
}