Rust implementation of NextGraph, a Decentralized and local-first web 3.0 ecosystem
https://nextgraph.org
byzantine-fault-tolerancecrdtsdappsdecentralizede2eeeventual-consistencyjson-ldlocal-firstmarkdownocapoffline-firstp2pp2p-networkprivacy-protectionrdfrich-text-editorself-hostedsemantic-websparqlweb3collaboration
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
973 B
29 lines
973 B
import asyncio
|
|
from nextgraph import wallet_open_with_mnemonic_words, doc_sparql_update, disconnect_and_close
|
|
|
|
async def main():
|
|
wallet_session = await wallet_open_with_mnemonic_words(
|
|
"/Users/nl/Downloads/wallet-Hr-UITwGtjE1k6lXBoVGzD4FQMiDkM3T6bSeAi9PXt4A.ngw",
|
|
["jealous",
|
|
"during",
|
|
"elevator",
|
|
"swallow",
|
|
"pen",
|
|
"phone",
|
|
"like",
|
|
"employ",
|
|
"myth",
|
|
"remember",
|
|
"question",
|
|
"lemon"],
|
|
[2, 3, 2, 3])
|
|
wallet_name = wallet_session[0]
|
|
session_info = wallet_session[1]
|
|
print(wallet_name)
|
|
print(session_info)
|
|
await doc_sparql_update(session_info["session_id"],
|
|
"INSERT DATA { <did:ng:_> <example:predicate> \"An example value16\". }",
|
|
"did:ng:o:Dn0QpE9_4jhta1mUWRl_LZh1SbXUkXfOB5eu38PNIk4A:v:Z4ihjV3KMVIqBxzjP6hogVLyjkZunLsb7MMsCR0kizQA")
|
|
await disconnect_and_close(session_info["user"], wallet_name)
|
|
|
|
asyncio.run(main()) |