Skip to main content

Galadriel Contract Deploy Guide

Wallet and Faucet​

Since we will use our wallet privately in the contract, we recommend that you use a testnet wallet. If you have a wallet for testnet, request tokens from the #πŸš°β”‚devnet-faucet channel on the discord server.

Network Information​

AreaDetails
Network nameGaladriel Devnet
New RPC URLhttps://devnet.galadriel.com
ChainID696969
Currency symbol:GAL
Block explorer URLhttps://explorer.galadriel.com

NodeJS and NPM​

Installing the NodeJS​

curl -sL https://deb.nodesource.com/setup_21.x | sudo -E bash -
apt-get install -y nodejs
apt update -y && apt upgrade -y

Installing the Installation​

apt install npm

Cloning the Repo​

git clone https://github.com/galadriel-ai/contracts
cd contracts/contracts

Preparing the .env File​

cp template.env .env

Save the following sections in the file and exit.

ORACLE_ADDRESS section 0x4168668812C94a3167FCd41D12014c5498D74d7e In the PRIVATE_KEY_GALADRIELandPRIVATE_KEY_LOCALHOST` sections, write the private key of your wallet with a 0x in front of it.

# Address of oracle deployed on Galadriel testnet. See https://docs.galadriel.com/oracle-address
ORACLE_ADDRESS="0x..."

# Private key to use for deployment on Galadriel testnet
PRIVATE_KEY_GALADRIEL="0x..."

# Private key to use for deployment on local network
PRIVATE_KEY_LOCALHOST="0x..."

Installing Libraries Required for the Contract​

cd $HOME/contracts/contracts
npm install

Contract Deployment​

npm run deployQuickstart

You will see a text like the following in the final output of the code:

Compiled 33 Solidity files successfully (evm target: paris).
Quickstart contract deployed to 0xcA9b6cc9be0a52B36864fe520d2dB21d2d690cdE

In this way, you can deploy a contract by repeating the operations.