체인링크 노드로부터 어떤 사이너가 offlamp란 컨트랙트 콜을 함.
offlamp 에 콜이 들어오면 전달 받은 데이터를 해석해서 2가지 일을 함.
- execute -> 실제 온체인 데이터 업데이트 (누구에게 토큰을 실제로 보내는 역할)
- trailExecute & sendMessage -> 업데이트한 내용 or 전달받은 데이터를 receive하는 개발자들이 사용할 컨트랙트쪽으로 쏴주는 역할
| // SPDX-License-Identifier: MIT | |
| // compiler version must be greater than or equal to 0.8.10 and less than 0.9.0 | |
| pragma solidity ^0.8.10; | |
| contract HelloWorld { | |
| string public greet = "Hello World!"; | |
| } | 
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.10; | |
| contract Counter { | |
| uint public count; | |
| // Function to get the current count | |
| function get() public view returns (uint) { | |
| return count; | |
| } | 
| pragma solidity ^0.4.16; | |
| contract owned { | |
| address public owner; | |
| function owned() public { | |
| owner = msg.sender; | |
| } | |
| modifier onlyOwner { | 
| package main | |
| import ( | |
| "fmt" | |
| "http" | |
| "flag" | |
| "runtime" | |
| "bytes" | |
| "log" | |
| ) | 
| pragma circom 2.1.4; | |
| template Num2Bits(nBits) { | |
| signal input x; | |
| signal output b[nBits]; | |
| for (var i = 0; i < nBits; i++) { | |
| b[i] <-- x \ (2 ** i) % 2; | |
| } | 
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "time" | |
| "github.com/prometheus/client_golang/prometheus" | |
| "github.com/prometheus/client_golang/prometheus/promauto" | 
| // 1. git clone https://github.com/cosmos/cosmos-sdk.git | |
| // 2. add a new debug_test.go file | |
| // 3. copy this code in your test file | |
| // run test code | |
| // reference: https://github.com/cosmos/cosmos-sdk/blob/main/client/debug/main.go | |
| package debug | |
| import ( | 
체인링크 노드로부터 어떤 사이너가 offlamp란 컨트랙트 콜을 함.
offlamp 에 콜이 들어오면 전달 받은 데이터를 해석해서 2가지 일을 함.
| set your private key and validator address as a env. (If you don't know where your private key is, it is in a file called validator.key. or it should also be included in the mail you received during onboarding. ) | |
| PRIVATE_KEY="PUT YOUR PRIVATE KEY HERE" | |
| VAL_ADDRESS="PUT YOUR VALIDATOR ADDRESS HERE" | |
| All steps are necessary. | |
| - Step 1 | 
| # Reademe |