Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9d883e9
first example with new flow - addition_simple
Davetbutler Jun 6, 2024
becfeff
helpers and bootstrap changed
Davetbutler Jun 6, 2024
65d86a2
add websockets, update sample env
oceans404 Jun 6, 2024
d7291b3
update README to explain new installation
oceans404 Jun 6, 2024
1cce2a6
fix readme formatting
oceans404 Jun 6, 2024
7d0ec75
update installation formatting
oceans404 Jun 6, 2024
621bc00
single party compute examples complete (modulo correlation coefficient)
Davetbutler Jun 6, 2024
e2fb904
millionaires example updated
Davetbutler Jun 6, 2024
74df06a
update tiny secret addition tutorial
oceans404 Jun 6, 2024
57a2c96
update permissions examples
oceans404 Jun 6, 2024
8cbdb28
update permissions command
oceans404 Jun 6, 2024
ff9df1c
mpc example - error on step 3
oceans404 Jun 6, 2024
7750a5d
multi-party example fix
Davetbutler Jun 7, 2024
3fe97e0
tidy up
Davetbutler Jun 7, 2024
e8bc1c5
remove erroneous files
Davetbutler Jun 10, 2024
06b50e7
minor README update
Davetbutler Jun 10, 2024
102b464
update all examples to work with new env path and naming
Davetbutler Jun 21, 2024
1e0d872
update helpers
Davetbutler Jun 21, 2024
34104a7
commit before removing examples to new repo
Davetbutler Jun 24, 2024
340bf08
remove examples and simplify directory structure
Davetbutler Jun 24, 2024
ca1aeb8
remove pytest and final renaming and refactor of client code
Davetbutler Jun 25, 2024
10c4111
remove legacy
Davetbutler Jun 25, 2024
e82dc9e
helpers library, remove helpers raw files
Davetbutler Jun 25, 2024
f899bb7
add target in nada project
Davetbutler Jun 25, 2024
001afc2
update for internal hackathon
Davetbutler Jun 28, 2024
bd7d306
nightly-v2024-06-27-7db213f55 ready for FEs
Davetbutler Jun 28, 2024
9d85576
remove print statement
Davetbutler Jun 28, 2024
9c5f4a0
rename file
Davetbutler Jul 2, 2024
01f343f
Update README.md
Davetbutler Jul 3, 2024
c357e81
small changes
Davetbutler Jul 3, 2024
44feb51
change env path for new devnet config
Davetbutler Jul 3, 2024
e5ab7fa
Bump versions
Davetbutler Jul 3, 2024
1239914
typo
Davetbutler Jul 3, 2024
6a25682
get_quote_and_pay_update
Davetbutler Jul 3, 2024
b69c00d
fix: updated secret addition format
jcabrero Jul 3, 2024
71ba37e
Merge pull request #45 from NillionNetwork/fix/secret_addition_test
Davetbutler Jul 3, 2024
15e9fe0
Update README.md
oceans404 Jul 3, 2024
600f6e8
update test files for new nada version
Davetbutler Aug 28, 2024
7d03184
Merge pull request #78 from NillionNetwork/version_0.6.0_update
Davetbutler Aug 30, 2024
b0e77b2
chore: update example and reqs for 0.7.0
psofiterol Nov 20, 2024
f2b8eba
Merge pull request #79 from psofiterol/chore/update-0.7.0
psofiterol Nov 21, 2024
d04d465
chore: updated comments on completed examples
psofiterol Nov 21, 2024
0b9e1c3
Merge pull request #80 from NillionNetwork/chore/update-comments-on-c…
psofiterol Nov 21, 2024
0a8222b
chore: topup client balance | 0.8.0 release
psofiterol Dec 4, 2024
ca28cd9
chore: clarify funds/balance are in uNIL
psofiterol Dec 5, 2024
8105acc
Merge pull request #81 from NillionNetwork/chore/0.8.0-update
psofiterol Dec 5, 2024
5eb18ce
chore: update to 0.9.0
psofiterol Feb 5, 2025
6342346
chore: bump reqs
psofiterol Feb 6, 2025
fddab10
Merge pull request #84 from NillionNetwork/chore/0.9.0-update
psofiterol Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .env.sample

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
**/*.pyc
**/__pycache__
programs-compiled/
nillion-venv/
permissions/.nillion-config.json
examples_and_tutorials/nada_programs/target
quickstart_complete/nada_quickstart_programs/target
.env
.idea
.DS_Store
*.key

.venv
1 change: 1 addition & 0 deletions .nil-sdk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "v0.9.0"
77 changes: 0 additions & 77 deletions CONTRIBUTING.md

This file was deleted.

86 changes: 12 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,14 @@
# Nillion Python Starter <a href="https://github.com/NillionNetwork/nillion-python-starter/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>

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](examples_and_tutorials/core_concept_multi_party_compute) folder.

- To run single party examples, go to the [single party compute](examples_and_tutorials/core_concept_single_party_compute) folder.

- To run permissions examples (storing and retrieving permissioned secrets, revoking permissions, etc.), go to the [permissions](examples_and_tutorials/core_concept_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`](./bootstrap-local-environment.sh) file uses `pidof` and `grep`.

- [Install `foundry`](https://book.getfoundry.sh/getting-started/installation)
- [Install `pidof`](https://command-not-found.com/pidof)
- [Install `grep`](https://command-not-found.com/grep)

## Environment Setup

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

```shell
cp .env.sample .env
```

2. Create the virtual environment (`.venv`), install dependencies, and activate the virtual environment

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

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

```shell
./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](./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](./programs/) folder with the script [`compile_programs.sh`](./compile_programs.sh):

```shell
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:

```shell
bash store_program.sh {RELATIVE_COMPILED_PROGRAM_PATH}
```

To store the compiled [`addition_simple`](./programs/addition_simple.py) program you can run:

```shell
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.

```shell
cd testing
bash run_tests.sh
```
Welcome to the start of your Nillion developer journey.

This repo corresponds to the Nillion Python quickstart. To get started with Nillion head over to the [Python QuickStart docs](https://docs.nillion.com/python-quickstart) and follow the quickstart guide.

For more python examples, check out https://github.com/NillionNetwork/python-examples which contains the following:
- core_concept_multi_party_compute
- core_concept_permissions
- core_concept_single_party_compute
- core_concept_store_and_retrieve_secrets
- millionaires_problem_example
- nada_programs
- voting_tutorial
152 changes: 0 additions & 152 deletions bootstrap-local-environment.sh

This file was deleted.

35 changes: 0 additions & 35 deletions compile_programs.sh

This file was deleted.

Loading
Loading