Giter VIP home page Giter VIP logo

nillion-python-starter's Introduction

Nillion Python Starter

This is a python starter repo for building on the Nillion Network. Complete environment setup, then run the examples:

  • To run multi party examples, go to the multi party compute folder.

  • To run single party examples, go to the single party compute folder.

  • To run permissions examples (storing and retrieving permissioned secrets, revoking permissions, etc.), go to the permissions folder.

Prerequisites: Install the CLI Dependencies

The nillion-devnet tool spins up anvil under the hood, so you need to have foundry installed. The bootstrap-local-environment.sh file uses pidof and grep.

Environment Setup

  1. Create a .env file by copying the sample:

    cp .env.sample .env
  2. Create the virtual environment (.venv), install dependencies, and activate the virtual environment

    bash ./create_venv.sh && source .venv/bin/activate

    Run the bootstrap-local-environment.sh script to spin up nillion-devnet, generate keys, and get bootnodes, cluster, and payment info:

    ./bootstrap-local-environment.sh
  3. Check .env file - keys, bootnodes, cluster, and payment info should now be present. If you want to run against a local cluster, use this configuration. Otherwise, replace values with testnet bootnodes, cluster, and payment info.

  4. Look through the programs folder to see examples of Nada programs.

Compiling Programs

Nada programs need to be compiled ahead of being stored. Compile all programs in the programs folder with the script compile_programs.sh:

bash compile_programs.sh

This generates a programs-compiled folder containing the compiled programs.

Store a Compiled Program

Store a compiled program in the network with this script:

bash store_program.sh {RELATIVE_COMPILED_PROGRAM_PATH}

To store the compiled addition_simple program you can run:

bash store_program.sh programs-compiled/addition_simple.nada.bin

Storing a program results in the stored program_id, the network's reference to the program. The program_id is the {user_id}/{program_name}.

Testing

Most examples and tutorials within this repository can be tested. Docker is required to run the tests.

cd testing
bash run_tests.sh

nillion-python-starter's People

Contributors

oceans404 avatar wwwehr avatar davetbutler avatar manel1874 avatar jmgr avatar vladleustean avatar jcabrero avatar jimouris avatar cmacrae avatar nilmemo avatar silvrfur 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.