GithubHelp home page GithubHelp logo

gnosis-freewillai-hackaton's Introduction

gnosis-freewillai-hackaton

Step by Step

Get xDAI and GNO (https://gnosisfaucet.com/)

Repeat with nodes

Deploy contracts (mainnet gnosischain.com, testnet chiadochain.net)

forge create contracts/FreeWillAIToken.sol:FreeWillAI \
    --rpc-url https://rpc.chiadochain.net \
    --private-key [metamask-private-key]

forge create contracts/TaskRunner.sol:TaskRunner \
    --rpc-url https://rpc.chiadochain.net \
    --private-key [metamask-private-key]
    --constructor-args [token-address]

Put the private key in .env

# .env
PRIVATE_KEY=0x...

export addresses as environ variables

Repeat with nodes

export FREEWILLAI_TOKEN_ADDRESS=0x...
export FREEWILLAI_TASK_RUNNER_ADDRESS=0x...

Install FreeWillAI from source

# Active environment
python3 -m venv venv
source venv

# Instalation
git clone [email protected]:FreeWillAI/freewilliai.git _freewilliai
cd _freewilliai
python setup.py install
cd ..
cp -r _freewilliai/freewillai _freewilliai/contracts .

Mint FWAI to nodes and the user (Do not use the same metamask account for nodes and user)

# Repeat this with user, node1 and node2 addresses
python -m token_owner -n https://rpc.chiadochain.net --mint 200 --to [user-address]
python -m token_owner -n https://rpc.chiadochain.net --mint 200 --to [node1-address]
python -m token_owner -n https://rpc.chiadochain.net --mint 200 --to [node2-address]

Run nodes

python -m freewillai.node --rpc-url https://rpc.chiadochain.net -s 200 -p [node1-private-key]
python -m freewillai.node --rpc-url https://rpc.chiadochain.net -s 200 -p [node2-private-key]

Declare contract addresses in main.py and run the code

python main.py

gnosis-freewillai-hackaton's People

Contributors

hackcheek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.