Skip to content

Latest commit

 

History

History

script

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Overview

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.

Environment

To use the script, follow these steps.

1. NPM Install

$ npm install

Create node_modules in the project root.

2. Create Environment

$ 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 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

Secrets

Name Description
CreateSecretsJson Encrypts environment variables into a format that ChainLink can understand
EncryptedSecretsUrl Encrypts the URL into a format that ChainLink can understand

Sources

Name Description
CreateVoteSource Stores vote data in Firestore
CloseVoteSource Closing the voting