Python modules for node, client and self-encryption

Build apps, run nodes from you’re apps and … well have some fun and help us get the API’s simpler and smoother as we go. (the last part will never stop happening :wink: )

just install via pip install XXX

Here’s how to run a node for instance

pip install safenode

from safenode import SafeNode
import os
initial_peers = [
    "/ip4/142.93.37.4/udp/40184/quic-v1/p2p/12D3KooWPC8q7QGZsmuTtCYxZ2s3FPXPZcS8LVKkayXkVFkqDEQB",
    "/ip4/157.245.40.2/udp/33698/quic-v1/p2p/12D3KooWNyNNTGfwGf6fYyvrk4zp5EHxPhNDVNB25ZzEt2NXbCq2",
    "/ip4/157.245.40.2/udp/33991/quic-v1/p2p/12D3KooWHPyZVAHqp2ebzKyxxsYzJYS7sNysfcLg2s1JLtbo6vhC"
]

# Create and start node
node = SafeNode()
initial_rewards_address = "0x1234567890123456789012345678901234567890" ### CHANGE THIS TO YOUR WALLET 
node.run(
     rewards_address=initial_rewards_address,
     evm_network="arbitrum_sepolia",
     ip="0.0.0.0",
     port=12000,
     initial_peers=initial_peers,
    local=True,
    root_dir=None,
    home_network=False
)

# or change root dir etc. as you wish


## or see internals of routing table 
def demonstrate_network_operations(node):
    print_section("Network Operations")
    
    try:
        # Get routing table information
        kbuckets = node.get_kbuckets()
        print("\nRouting table information:")
        for distance, peers in kbuckets:
            print(f"Distance {distance}: {len(peers)} peers")
            for peer in peers[:3]:  # Show first 3 peers at each distance
                print(f"  - {peer}")
    except Exception as e:
        print(f"Network operation failed: {e}")
36 Likes

A new chapter begins :sparkles: :boom::tada:

19 Likes

That’s the best and surprising news in a very long time around here for me! How amazing!

14 Likes

The python community are going to love this.

Apps with easy access to networked data.

15 Likes

And if one use case really is private ai then I’d just mention that the world of ai is pretty dominated by python as of now I’d say

13 Likes

With that python library and a wasm build there’ll be everything for nice and shiny gui apps down terminal app on headless servers :tada:

This really is fantastic!

15 Likes

ohh my fantastic work @dirvine i cant wait to see the fun stuff thats going to get maid :wink: :slight_smile: :slight_smile: :slight_smile:

11 Likes

Seems like a good day today.
@dirvine has delivered what many have been waiting for and we are now >30000 network size mostly from home IIUC.
Download speeds are good and while from my small 40 node PoV it seems attos are slower than before, they are still trickling in to my three wallets.

Now off to footer with python…

15 Likes

And no need to learn Solidity to interact with that decentralised new world :sweat_smile: just regular python will do :tada:

13 Likes

Good news David :clap:

I’d like to suggest the Registers API is given some loving care by someone [cough] who understands what it is supposed to provide. I’m updating my awe demo for the new APIs and having to make some changes to the API.

Some minor ones to uploading of directories to add a little flexibility and efficiency I’ll submit as a PR.

But the Registers API has lost the ability to do very much. It has been reverted to a current value(s) with no access to history. I can fix that for myself by maintaining a fork of the API, but it would be best if the API itself was designed for either some use cases involving history, or to re-expose the MerkeReg itself so client apps can do this for themselves.

Either that or give a clear statement that history is no longer a goal for the network, at least for the time being.

17 Likes

2,379 individual Sepolia ANT wallets with now ~33k nodes.

Any of the big guns want to say how many nodes they are running?

1 Like

Both Register and Transactions are on my radar here. My big use though is friction. We had an issue where we needed ENV vars to build and we got rid of that. Now the initial peers and bootstrap nodes need to be invisible to users. We should be able to pass a node address to bootstrap off of in emergency, but apart for that nodes and clients should be caching those to restart from their cache. So that has to go 100% for sure.

Then the data Interface needs a realignment into one area where we have all data types and their operations clearly identified with tests and examples. That is not massive work, but absolutely needs done and the team must focus on that part of rework, it’s very tiny code wise but huge for devs and uses of the API. The team are way more than capable and I am hoping beyond hope the python APIs allow the team to see very easily and first hand where the friction is and remove it immediately we see it.

So a few bits of brushing and cleaning up but I am 100% with you @happybeing We just need to have some focus here, it won’t take long at all, but as the team have nodes pretty stable here and are still measuring and tweaking we must focus on uses of the network from a utility perspective.

We will get there quicker now I hope as folk can just do a Jupyter notebook and show exactly what fails and why etc. So I hope this eases us moving forward much faster.

16 Likes

These are the magic words I want to hear! :ant: as a core Internet utility for humanity is what I hope we can reach :wink: :sparkler: :fireworks:

Now if only I could convince you to at least add temp data in addition to permanent data!! :wink: – starting with temp data going onto the roadmap at some point in the future - doesn’t have to be before Jan.

I know, I’m being a selfish slave driver here … but I just want what I think will really open the doors up for a lot more use-cases and vastly more users – as well as greater network stability.

3 Likes

Check out the ScratchPad data type. It’s called Vault and you can see how to use the client to manipulate and store that autonomi-client · PyPI

That is as temp or permanent as you want it. It’s not CRDT so single use really, but it’s temp if that is how you want to use it.

8 Likes

@Dimitar maybe move What’s up today? (Part 2) - #3286 and the replies to its own topic?

9 Likes

This is FANTASTIC. Thank you @dirvine, this is the most important news since a very very long time !

8 Likes

At this stage, it’s just a whole lot of cluelessness and a whole lot of code that I got to read to exactly understand what the Replit agent did. This is why I welcome attos, will give us a lot of room to not make costly mistakes when testing.

Yeah this is cheating, but 2 years from now maybe we’ll all have our coding assistance… :sweat_smile:

10 Likes

33k nodes ? did you squat a local google datacenter ?

edit: misread, I thought you were running 33k nodes yourself.

9 Likes

@bzee Can you take a look please and get back to @happybeing. We have the history so just need to have api access to it

10 Likes

hmhmmm

I just installed it via poetry add autonomi-client

is this not a standalone python library but a binding between rust and python where I need the repo; build it and link it somehow?

4 Likes