Open YutaOkoshi opened 9 months ago
And, Environment variables have also changed considerably. https://github.com/smartcontractkit/chainlink/blame/develop/core/config/env/env.go
config validation failed: invalid environment: 11 errors: - environment variable DATABASE_URL must not be set: unsupported with config v2
- environment variable ROOT must not be set: unsupported with config v2
- environment variable DATABASE_LOCKING_MODE must not be set: unsupported with config v2
- environment variable JSON_CONSOLE must not be set: unsupported with config v2
- environment variable LOG_LEVEL must not be set: unsupported with config v2
- environment variable ALLOW_ORIGINS must not be set: unsupported with config v2
- environment variable SECURE_COOKIES must not be set: unsupported with config v2
- environment variable CHAINLINK_TLS_PORT must not be set: unsupported with config v2
- environment variable ETH_URL must not be set: unsupported with config v2
- environment variable ETH_CHAIN_ID must not be set: unsupported with config v2
- environment variable LINK_CONTRACT_ADDRESS must not be set: unsupported with config v2
I did this work with Chainlink Node and AWS Console,So I did ran smartcontract/chainlink:2.7.0. But if you AutoScaling it, it will breaks. I don't know the correct methodization.
AWS Console
On ChainlinkNode:
$ sudo su ec2-user
$ docker rm -f chainlink
$ echo "RootDir = '/chainlink'
[Log] Level = 'debug'
[WebServer] AllowOrigins = '*' SecureCookies = false
[WebServer.TLS] HTTPSPort = 0
[[EVM]] ChainID = '1'
[[EVM.Nodes]] Name = 'something' WSURL = 'wss://something' HTTPURL = 'https://something'
[P2P.V1] Enabled = false
[P2P.V2] Enabled = false
[Database.Lock] Enabled = true LeaseDuration = '10s' LeaseRefreshInterval = '1s' " > /home/ec2-user/.chainlink/config.toml
$ echo "[Password] Keystore = 'psqlpassword'
[Database] URL = 'postgresql://usename:psqlpassword@postgresqlHostName:5432/postgres' " > /home/ec2-user/.chainlink/secrets.toml
$ echo "CHANGE_THIS_EXAMPLE_EMAIL CHANGE_THIS_EXAMPLE_PASSWORD " > /home/ec2-user/.chainlink/.api
$ sudo chmod 777 -R /home/ec2-user/.chainlink $ sudo chown 1000:1000 -R /home/ec2-user/.chainlink
$ latestimage=$(curl -s -S "https://registry.hub.docker.com/v2/repositories/smartcontract/chainlink/tags/" | jq -r '."results"[]["name"]' | head -n 1)
$ cd /home/ec2-user/.chainlink && docker run -d \ -u 1000:1000 \ --log-driver=awslogs --log-opt awslogs-group=ChainlinkLogs \ --restart unless-stopped \ --name chainlink \ -p6688:6688 \ -v /home/ec2-user/.chainlink:/chainlink \ smartcontract/chainlink:$latestimage \ node --config /chainlink/config.toml --secrets /chainlink/secrets.toml start -a /chainlink/.api
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2fc97f22d5be smartcontract/chainlink:2.7.0 "chainlink node --co…" 2 hours ago Up 2 hours (healthy) 0.0.0.0:6688->6688/tcp, :::6688->6688/tcp chainlink
$ curl -XGET localhost:6688/health | jq '.' % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 922 100 922 0 0 438k 0 --:--:-- --:--:-- --:--:-- 450k { "data": [ { "type": "checks", "id": "JobSpawner", "attributes": { "name": "JobSpawner", "status": "passing", "output": "" } }, { "type": "checks", "id": "MailboxMonitor", "attributes": { "name": "MailboxMonitor", "status": "passing", "output": "" } }, { "type": "checks", "id": "TelemetryManager", "attributes": { "name": "TelemetryManager", "status": "passing", "output": "" } }, { "type": "checks", "id": "EVM.80001.Relayer.Mercury.WSRPCPool", "attributes": { "name": "EVM.80001.Relayer.Mercury.WSRPCPool", "status": "passing", "output": "" } }, { "type": "checks", "id": "EventBroadcaster", "attributes": { "name": "EventBroadcaster", "status": "passing", "output": "" } }, { "type": "checks", "id": "PipelineRunner", "attributes": { "name": "PipelineRunner", "status": "passing", "output": "" } }, { "type": "checks", "id": "PromReporter", "attributes": { "name": "PromReporter", "status": "passing", "output": "" } }, { "type": "checks", "id": "PipelineORM", "attributes": { "name": "PipelineORM", "status": "passing", "output": "" } } ] }
I didn't have time to incorporate it into the Chainlink Node startup template, so someone please do so.
Various information was passed to chainlink in .password, but this method is not supported in the latest Chainlink images.
https://docs.chain.link/chainlink-nodes/configuring-nodes
All scripts for starting EC2 instances need to be replaced. Or it would be less man-hours to make the Chainlink image work on Fargate.