This section includes the following code:
- Source code runnable on ChainLink Functions.
- A simulation to test locally before uploading to ChainLink.
- Encryption methods to secure sensitive data like API keys.
To use the script, follow these steps.
$ npm install
Create
node_modules
in the project root.
$ npx env-enc set-pw
Enter the password for encrypting the environment variables.
$ npx env-enc set
Enter the key and value from the following table.
Key | Description |
---|---|
Email of the Authentication account with write permissions to Firestore | |
PASSWORD | Password for the registered email account |
FIREBASE_API_KEY | Firebase api key |
PRIVATE_KEY | Private key of the crypto wallet |
ETHEREUM_RPC_URL | RPC URL of the network to be used |
ROUTER_ADDRESS | Router Address of the network to be used |
DON_ID | DON ID of the network to be used |
Create
.env.enc
in the project root
Note: This project uses Arbitrum Sepolia
$ npx env-enc view
Check the entered environment variables
Name | Description |
---|---|
CreateSecretsJson | Encrypts environment variables into a format that ChainLink can understand |
EncryptedSecretsUrl | Encrypts the URL into a format that ChainLink can understand |
Name | Description |
---|---|
CreateVoteSource | Stores vote data in Firestore |
CloseVoteSource | Closing the voting |