- Golang 1.15
- Ethereum 1.9.25 // Install Ethereum, Geth, Abigen...
- Node Latest & Solcjs 0.8.0
~ apt-get update -y && apt-get upgrade -y
~ apt-get install -y software-properties-common python3-gpg
~ add-apt-repository "deb http://ppa.launchpad.net/ethereum/ethereum/ubuntu xenial main"
~ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x2A518C819BE37D2C2031944D1C52189C923F6CA9
~ apt update -y && apt upgrade -y
~ apt-get install -y ethereum
~ geth version
Geth
Version: 1.9.25...
Architecture: amd64
Go Version: go1.15.6
Operating System: linux
~ abigen --version
abigen version 1.9.25...
~ apt-get install -y curl ⚠️ Optional ⚠️
~ curl https://dl.google.com/go/go1.15.8.linux-amd64.tar.gz --output golang-1.15.tar.gz
~ tar -C /usr/local -xzf golang-1.15.tar.gz
~ export PATH=$PATH:/usr/local/go/bin
~ go version
go version go1.15.8 linux/amd64
~ apt-get install nodejs
~ npm install -g solc
~ solcjs --version
0.8.0+commit.c7dfd78e.Emscripten.clang
~ brew tap ethereum/ethereum
~ brew install ethereum
~ brew install golang
~ brew install nodejs
~ npm intall -g solc
A Keystore is a file containing an encrypted eth account.
We need at least 4 keystore files, 1 to certify diplomas and 3 others to write in the blockchain.
~ geth account new
INFO [07-16|15:51:50.836] Maximum peer count ETH=50 LES=0 total=50
Your new account is locked with a password. Please give a password. Do not forget this password.
Password: [password]
Repeat password: [password]
Your new key was generated
Public address of the key: [public address]
Path of the secret key file: ~/Library/Ethereum/keystore/[Nom du fichier]
- You can share your public address with anyone. Others need it to interact with you.
- You must NEVER share the secret key with anyone! The key controls access to your funds!
- You must BACKUP your key file! Without the key, it's impossible to access account funds!
- You must REMEMBER your password! Without the password, it's impossible to decrypt the key!
pragma solidity >=0.8.0;
contract FtDiploma {
string public constant name = "42 Alumni";
string public constant symbol = "42A";
string public constant linkOfRepo = "github.com/42School/blockchain-service";
address public constant ftPubAddress = [public address]
[...]
}
~ make update-contract
~ mdkir blockchain-service/config/keystore-sign
~ mv [filename] blockchain-service/config/keystore-sign
~ vi blockchain-service/config/blockchain-service.env
KEY_PASSWD="[password of keystore]"
KEYSTORE_PATH_SIGN="/blockchain-service/config/keystore-sign"
~ touch blockchain-service/config/accounts.csv
# file name, password
[filename], [password of keystore]
[filename], [password of keystore]
[filename], [password of keystore]
~ mkdir blockchain-service/config/keystore
~ mv [filename] blockchain-service/config/keystore
~ mv [filename] blockchain-service/config/keystore
~ mv [filename] blockchain-service/config/keystore
~ vi blockchain-service/config/blockchain-service.env
KEYSTORE_PATH="blockchain-service/config/keystore"
ACCOUNTS_FILE="blockchain-service/config/accounts.csv"
Enter the transaction hash in etherscan
and check the status of the transaction.
Enter the transaction hash in Etherscan and check the status of the transaction.
~ vi blockchain-service/config/blockchain-service.env
CONTRACT_ADDRESS="[contract-address]"
Change the last environment variables.
~ vi blockchain-service/config/blockchain-service.env
# Endpoint of 42 intra
FT_END_POINT="http://127.0.0.1:8080"
RETRY_PATH="/check-request"
VALIDATION_PATH="/check-request"
TOKEN="token"
APP_CLIENT_ID=""
APP_CLIENT_SECRET=""
# Email Variable
SENDER_EMAIL="emailSender"
PASSWD_EMAIL="password"
EMAIL_HOST="smtp.gmail.com"
TO_EMAIL="bocal@42.fr"
# Mongo Variable
MONGO_IP="mongo"
MONGO_PORT="27017"
MONGO_USER="root"
MONGO_PASSWD="example"
~ vi blockchain-service/.env
RUN_ENV="prod" # or "dev"
COMPOSE_PROFILE="prod" # or "dev"
~ make install
~ make run