diff --git a/docs/about/_category_.json b/docs/about/_category_.json deleted file mode 100644 index 64db3e0a..00000000 --- a/docs/about/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "About", - "position": 1, - "link": { - "type": "generated-index", - "description": "The big picture" - } -} diff --git a/docs/archive/_category_.json b/docs/archive/_category_.json deleted file mode 100644 index f5a434b1..00000000 --- a/docs/archive/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Archive", - "position": 10, - "link": { - "type": "generated-index", - "description": "Historical, canonical, and/or deprecated for reference" - } -} diff --git a/docs/archive/community/community.todo b/docs/archive/community/community.todo deleted file mode 100644 index 75356786..00000000 --- a/docs/archive/community/community.todo +++ /dev/null @@ -1,37 +0,0 @@ - -### Open Source Everything - - - - -The 0L project is radically open source in that every aspect of the project is open to community contributors. The software that operates the network is not managed by a foundation or by a governance token. Instead, the community manages the technical infrastructure by developing software and making pull requests. Where decisions are not reducible to software, open source-like workflows are used to define, complete and review diverse forms of labor. - - - - -### Hustle Karma - - - - -Many of the activities required to have a vibrant open source community can not be reduced to pull requests in a github repo. In order to ensure non-technical contributors have a place in 0L, the Hustle Karma board provides community members the opportunity to define missions, sign up to complete missions, review completed missions -- and to get paid for doing so. There is work available for community managers, project managers, designers, communications experts and more. - - - - -[Learn more about the Hustle Karma DAO](http://openlibra.blog/community/hustle-karma-dao/) \>\> - - - - -### Polycentric Programs - - - - -There is a special class of account in 0L called a community wallet. They can be automatically donated to and have the special properties intended for funding public goods. There are currently a number of community wallets with published goals, controlled by different organizations. These programs are actively funding the missions in the Hustle Karma board. Anyone can create a community wallet, and advocate for donations to steer community funds. The voluntary donations to the polycentric programs are how the community expresses its preferences for how goals are prioritized and resources are allocated. - - - - -[Learn more about the 0L Community Programs](http://openlibra.blog/community/community-programs/) \>\> diff --git a/docs/archive/technology/carpe-desktop-app.todo b/docs/archive/technology/carpe-desktop-app.todo deleted file mode 100644 index c17d606e..00000000 --- a/docs/archive/technology/carpe-desktop-app.todo +++ /dev/null @@ -1,39 +0,0 @@ - -This desktop app is a combination wallet and light miner. It connects to the 0L network and lets you create accounts, do some account management, and participate in the network by mining coins. It runs on Windows or Mac and can be used on a wide variety of desktop and notebook computers. - - - - -Like any account-based blockchain, any new account address you create in the Carpe app will be inactive (will not exist on the chain). For the account to become active, someone needs to send you at least one coin to it; that is the essence of the onboarding process. Until that happens your account does not exist "on chain". If you don't know anyone yet on 0L, come into the Discord chat and just ask anyone there. Many people will be happy to help get you onboarded. Otherwise the app should guide you through it. - - - - -Stay tuned....we're about to announce some great new enhancements to the wallet functionality! - - - - -  - - - - - - - -## Download Carpe - - - - - - - -The button below will take you to the Github archive for Carpe, where you can select the right package for your operating system. - - - - - -[Visit Carpe on Github](https://github.com/0LNetworkCommunity/carpe/releases) diff --git a/docs/community-programs/_category_.json b/docs/community-programs/_category_.json deleted file mode 100644 index 4107173d..00000000 --- a/docs/community-programs/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Programs", - "position": 3, - "link": { - "type": "generated-index", - "description": "Third-party programs by community members" - } -} diff --git a/docs/community-programs/a-good-list.md b/docs/concepts/community-programs/a-good-list.md similarity index 100% rename from docs/community-programs/a-good-list.md rename to docs/concepts/community-programs/a-good-list.md diff --git a/docs/community-programs/application-studio.md b/docs/concepts/community-programs/application-studio.md similarity index 100% rename from docs/community-programs/application-studio.md rename to docs/concepts/community-programs/application-studio.md diff --git a/docs/archive/community/community-programs.todo b/docs/concepts/community-programs/community-programs.todo similarity index 100% rename from docs/archive/community/community-programs.todo rename to docs/concepts/community-programs/community-programs.todo diff --git a/docs/community-programs/danish-red-cross-humanitarian-fund.md b/docs/concepts/community-programs/danish-red-cross-humanitarian-fund.md similarity index 100% rename from docs/community-programs/danish-red-cross-humanitarian-fund.md rename to docs/concepts/community-programs/danish-red-cross-humanitarian-fund.md diff --git a/docs/community-programs/deep-technology-innovation-program.md b/docs/concepts/community-programs/deep-technology-innovation-program.md similarity index 100% rename from docs/community-programs/deep-technology-innovation-program.md rename to docs/concepts/community-programs/deep-technology-innovation-program.md diff --git a/docs/community-programs/ftw-ongoing-full-time-workers-program.md b/docs/concepts/community-programs/ftw-ongoing-full-time-workers-program.md similarity index 100% rename from docs/community-programs/ftw-ongoing-full-time-workers-program.md rename to docs/concepts/community-programs/ftw-ongoing-full-time-workers-program.md diff --git a/docs/community-programs/human-rewards-program.md b/docs/concepts/community-programs/human-rewards-program.md similarity index 100% rename from docs/community-programs/human-rewards-program.md rename to docs/concepts/community-programs/human-rewards-program.md diff --git a/docs/community-programs/moonshot-program.md b/docs/concepts/community-programs/moonshot-program.md similarity index 100% rename from docs/community-programs/moonshot-program.md rename to docs/concepts/community-programs/moonshot-program.md diff --git a/docs/community-programs/rxc-research-and-experimentation-0l-fund.md b/docs/concepts/community-programs/rxc-research-and-experimentation-0l-fund.md similarity index 100% rename from docs/community-programs/rxc-research-and-experimentation-0l-fund.md rename to docs/concepts/community-programs/rxc-research-and-experimentation-0l-fund.md diff --git a/docs/community-programs/social-infrastructure-program.md b/docs/concepts/community-programs/social-infrastructure-program.md similarity index 100% rename from docs/community-programs/social-infrastructure-program.md rename to docs/concepts/community-programs/social-infrastructure-program.md diff --git a/docs/community-programs/the-iqlusion-engineering-program.md b/docs/concepts/community-programs/the-iqlusion-engineering-program.md similarity index 100% rename from docs/community-programs/the-iqlusion-engineering-program.md rename to docs/concepts/community-programs/the-iqlusion-engineering-program.md diff --git a/docs/community-programs/tip-jar.md b/docs/concepts/community-programs/tip-jar.md similarity index 100% rename from docs/community-programs/tip-jar.md rename to docs/concepts/community-programs/tip-jar.md diff --git a/docs/community-programs/university-of-toronto-msrg.md b/docs/concepts/community-programs/university-of-toronto-msrg.md similarity index 100% rename from docs/community-programs/university-of-toronto-msrg.md rename to docs/concepts/community-programs/university-of-toronto-msrg.md diff --git a/docs/community-programs/working-group-key-roles.md b/docs/concepts/community-programs/working-group-key-roles.md similarity index 100% rename from docs/community-programs/working-group-key-roles.md rename to docs/concepts/community-programs/working-group-key-roles.md diff --git a/docs/archive/community/economics.todo b/docs/concepts/community/economics.todo similarity index 100% rename from docs/archive/community/economics.todo rename to docs/concepts/community/economics.todo diff --git a/docs/archive/community/governance.todo b/docs/concepts/community/governance.todo similarity index 100% rename from docs/archive/community/governance.todo rename to docs/concepts/community/governance.todo diff --git a/docs/archive/community/hustle-karma.todo b/docs/concepts/community/hustle-karma.todo similarity index 100% rename from docs/archive/community/hustle-karma.todo rename to docs/concepts/community/hustle-karma.todo diff --git a/docs/core-devs/_category_.json b/docs/core-devs/_category_.json deleted file mode 100644 index 55210805..00000000 --- a/docs/core-devs/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Core Devs", - "position": 4, - "link": { - "type": "generated-index", - "description": "For core platform engineering" - } -} diff --git a/docs/edit-docs/_category_.json b/docs/edit-docs/_category_.json deleted file mode 100644 index faa761d4..00000000 --- a/docs/edit-docs/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Write Docs", - "position": 10, - "link": { - "type": "generated-index", - "description": "Tooling information for the 0L Network" - } -} diff --git a/docs/faq/faq.md b/docs/faq/faq.md new file mode 100644 index 00000000..4514b4c1 --- /dev/null +++ b/docs/faq/faq.md @@ -0,0 +1 @@ +# FAQ diff --git a/docs/getting-started/install-open-libra-cli.md b/docs/getting-started/install-open-libra-cli.md new file mode 100644 index 00000000..37e80e74 --- /dev/null +++ b/docs/getting-started/install-open-libra-cli.md @@ -0,0 +1 @@ +# Install Open Libra CLI diff --git a/docs/getting-started/install-wallet.md b/docs/getting-started/install-wallet.md new file mode 100644 index 00000000..ee99e090 --- /dev/null +++ b/docs/getting-started/install-wallet.md @@ -0,0 +1,3 @@ +# Install Wallet + +If you need a GUI wallet to send, receive, check balance for you accounts, you can use the Carpe wallet. diff --git a/docs/glossary/glossary.md b/docs/glossary/glossary.md new file mode 100644 index 00000000..ca3c8276 --- /dev/null +++ b/docs/glossary/glossary.md @@ -0,0 +1 @@ +# Glossary diff --git a/docs/tools/cli-tools/txs/communtiy-wallet-activation.md b/docs/guides/community-wallet-ops/community-wallet-activation.md similarity index 98% rename from docs/tools/cli-tools/txs/communtiy-wallet-activation.md rename to docs/guides/community-wallet-ops/community-wallet-activation.md index a218f994..a5b31a59 100644 --- a/docs/tools/cli-tools/txs/communtiy-wallet-activation.md +++ b/docs/guides/community-wallet-ops/community-wallet-activation.md @@ -1,4 +1,4 @@ -# community +# Activation Community Wallet is a qualification an account can receive if it is composed of certain properties. Those properties are: @@ -23,7 +23,7 @@ There are three steps in creating a community wallet account: This step is irreversible. The current mnemonic will no longer work going forward. The only governance possible is that of the multisig, and any features added (Donor Voice). -## Using TXS Tool +## Using `txs` tool To exemplify the usage of the TXS Tool, we will consider Alice (0x1000a), Bob (0x1000b), and Carol (0x1000c) as the ones invited to be the multisig authorities on Dave's (0x1000d) account, which will become the community wallet. @@ -33,7 +33,7 @@ Dave simply provides the list of addresses and the signature threshold. The tran _Note: this step does not commit the accounts as the authorities, it proposes the authority offer to the address list._ -``` +```bash libra txs community gov-init -a 0x1000a -a 0x1000b -a 0x1000c -n 2 ``` @@ -43,7 +43,7 @@ Each address owner invited to be an authority in the community wallet must claim _Note: this will not make the address a multisig authority yet. After enough addresses claim the offer, the invited authorities need to wait for the donor's final action._ -``` +```bash libra txs community gov-claim -a 0x1000d ``` @@ -51,7 +51,7 @@ libra txs community gov-claim -a 0x1000d After enough addresses claim the offer, Dave can finalize and cages the account by providing the threshold number. -``` +```bash libra txs community gov-cage -n 2 ``` @@ -67,7 +67,7 @@ This step also performs the same authority verification as `gov-init`. To update the authority offer, the owner can use the following command: -``` +```bash libra txs community gov-offer -a 0x1000b -a 0x1000c -a 0x1000d -a 0x1000e -n 3 ``` @@ -81,7 +81,7 @@ Additionally, this command can be used by the account owner to renew the offer's V8 introduces CW reauthorization via donor authorization vote transactions that can be generated as follows: -``` +```bash export CW_ADDR= export CW_ADDR=0x2B0E8325DEA5BE93D856CFDE2D0CBA12 # Example wallet address libra txs community reauthorize --community-wallet $CW_ADDR # Submit a vote for reauthorization @@ -89,7 +89,7 @@ libra txs community reauthorize --community-wallet $CW_ADDR # Submit a vote for Current reauthorization status for a community wallet can be viewed like this: -``` +```bash libra query view -f 0x1::donor_voice_governance::get_reauth_tally -a $CW_ADDR { "body": [ diff --git a/docs/guides/community-wallet-ops/reauthorize-in-v8.md b/docs/guides/community-wallet-ops/reauthorize-in-v8.md new file mode 100644 index 00000000..c0d7590b --- /dev/null +++ b/docs/guides/community-wallet-ops/reauthorize-in-v8.md @@ -0,0 +1 @@ +# Reauthorize a dormant CW in V8 diff --git a/docs/guides/community-wallet-ops/rituals-and-standards.md b/docs/guides/community-wallet-ops/rituals-and-standards.md new file mode 100644 index 00000000..87a135f6 --- /dev/null +++ b/docs/guides/community-wallet-ops/rituals-and-standards.md @@ -0,0 +1,2 @@ +# Standards that the CW must follow + diff --git a/docs/guides/community-wallet-ops/send-coins.md b/docs/guides/community-wallet-ops/send-coins.md new file mode 100644 index 00000000..2a372e56 --- /dev/null +++ b/docs/guides/community-wallet-ops/send-coins.md @@ -0,0 +1 @@ +# Sending Coins diff --git a/docs/guides/community-wallet-ops/setup-multisig.md b/docs/guides/community-wallet-ops/setup-multisig.md new file mode 100644 index 00000000..33c3e2c8 --- /dev/null +++ b/docs/guides/community-wallet-ops/setup-multisig.md @@ -0,0 +1 @@ +# Setup Signers (Multisig) diff --git a/docs/guides/contribute/contribute-to-openlibra-repos.md b/docs/guides/contribute/contribute-to-openlibra-repos.md new file mode 100644 index 00000000..d7088849 --- /dev/null +++ b/docs/guides/contribute/contribute-to-openlibra-repos.md @@ -0,0 +1 @@ +# Contribute to Open Libra Repositories diff --git a/docs/edit-docs/editing.md b/docs/guides/contribute/editing-docs.md similarity index 98% rename from docs/edit-docs/editing.md rename to docs/guides/contribute/editing-docs.md index 1e373db0..c292d0ca 100644 --- a/docs/edit-docs/editing.md +++ b/docs/guides/contribute/editing-docs.md @@ -7,7 +7,7 @@ # sidebar_label: 'My Title' # GOOD: if I want to propose an order to the menu -# sidebar_position: 5 +# adjust the order in sidebars.js # GOOD: shall we hide this page in the menu? # hidden: true diff --git a/docs/guides/contribute/pledge.md b/docs/guides/contribute/pledge.md new file mode 100644 index 00000000..72e4f558 --- /dev/null +++ b/docs/guides/contribute/pledge.md @@ -0,0 +1 @@ +# Participants and Contributors Pledge diff --git a/docs/core-devs/dev-quick-start.md b/docs/guides/developers/dev-quick-start.md similarity index 94% rename from docs/core-devs/dev-quick-start.md rename to docs/guides/developers/dev-quick-start.md index 83dde42a..52b7ead3 100644 --- a/docs/core-devs/dev-quick-start.md +++ b/docs/guides/developers/dev-quick-start.md @@ -1,10 +1,10 @@ -# Libra Move Dev Quick Start +# Quick Start ## Install ### You must install `libra` cli tool to your PATH. -``` +```bash # in this repo cargo build --release -p libra @@ -22,7 +22,7 @@ libra version ``` ### Export some environment variables -``` +```bash # Add to your $HOME/.bashrc, or $HOME/.zshrc ##### Must export to see debug prints from Move VM @@ -44,7 +44,7 @@ This is the file necessary for network genesis for mainnet and testnet. NOTE: because it is the genesis file, the smoke tests (which simulate running networks) requires this file. -``` +```bash cd ./framework libra move framework release ``` @@ -56,10 +56,10 @@ Your release will be in `./releases/head.mrb`, you will need this for genesis an ## Run tests #### Framework unit tests -``` +```bash # run framework tests with: -# rememeber export DIEM_MOVE_DEBUG=true envvar for debug prints from Move VM +# remember export DIEM_MOVE_DEBUG=true envvar for debug prints from Move VM cd ./framework/libra-framework libra move test @@ -70,7 +70,7 @@ libra move test ### Formal verification tests -``` +```bash # run formal verification with libra move prove ``` @@ -82,7 +82,8 @@ Note for smoke tests: you must regenerate the .mrb file EVERYTIME YOU MAKE A CHA See instructions on environment variables above. Remember to export DIEM_FORGE_NODE_BIN_PATH, otherwise nothing will happen. For some tests (upgrade, rescue) the RUST_MIN_STACK needs to be set higher than the default for rust. That's because some tests have higher memory requirements when having multiple recompiliations for the move source. Note that the Move VM `[debug]` prints do not appear in the terminal, they will appear in the log files of the individual simulated nodes. -``` + +```bash # run smoke tests (using cargo) cd ./smoke-tests cargo test @@ -100,7 +101,7 @@ If you encounter the following error: You can resolve this issue by building with the following flag: -``` +```bash RUSTFLAGS="--cfg tokio_unstable" cargo build --profile cli -p diem-node --target-dir ~/.cargo/bin ``` diff --git a/docs/archive/technology/developer-resources.todo b/docs/guides/developers/developer-resources.todo similarity index 100% rename from docs/archive/technology/developer-resources.todo rename to docs/guides/developers/developer-resources.todo diff --git a/docs/about/engineering-strategy.todo b/docs/guides/developers/engineering-strategy.todo similarity index 100% rename from docs/about/engineering-strategy.todo rename to docs/guides/developers/engineering-strategy.todo diff --git a/docs/core-devs/formal-verification.md b/docs/guides/developers/formal-verification.md similarity index 91% rename from docs/core-devs/formal-verification.md rename to docs/guides/developers/formal-verification.md index c3e0843b..f82c5976 100644 --- a/docs/core-devs/formal-verification.md +++ b/docs/guides/developers/formal-verification.md @@ -12,7 +12,7 @@ boogie system libraries. 1) get the libra cli with standard Move tools Compile the `libra` cli app, and have it in your executable PATH. -``` +```bash cargo b --profile cli -p libra cp target/cli/libra ~/.cargo/bin chmod +x ~/.cargo/bin/libra @@ -31,19 +31,17 @@ The `dev_setup.sh` can be run with these options: > -p update $HOME/.profile or ./bashrc -``` +```bash # run the installer bash util/dev_setup.sh -yp # you may need to restart your shell, after env variables are set # or .bashrc, or .zshrc - bash ~/.profile - ``` Whatever terminal shell (or .zshrc) you are using you should check that these variable are exported: -``` +```bash export DOTNET_ROOT="$HOME/.dotnet" export Z3_EXE="$HOME/bin/z3" export CVC5_EXE="$HOME/bin/cvc5" @@ -51,12 +49,12 @@ export BOOGIE_EXE="$HOME/.dotnet/tools/boogie" export SOLC_EXE="$HOME/bin/solc" ``` -3) check it all works +3) Check if it all works you'll be running formal verification specs against `libra-framework` move source. So test it on something we know to work -``` +```bash cd framework/libra-framework # test the guid.move module @@ -65,7 +63,7 @@ libra move prove -f guid If you get a response without errors similar to the message below you are ready to start. -``` +```bash [INFO] 0.903s build, 2.585s trafo, 0.019s gen, 1.313s verify, total 4.820s ``` @@ -79,19 +77,19 @@ start. Formal verification priority for Libra should mainly check that the network does not halt in operations conducted by the VM. -1. epoch_boundary.move -Should never halt on reconfigure() +1. `epoch_boundary.move` +Should never halt on `reconfigure()` THough there are many downstream modules and functions from here, the largest ones being: - a. stake.move + a. `stake.move` - b. proof_of_fee.move + b. `proof_of_fee.move` -2. coin.move +2. `coin.move` a. Transactions by VM should not halt -3. slow_wallet.move +3. `slow_wallet.move` a. no transactions should bypass the slow wallet tracker. If there is a slow wallet struct, a transaction should always alter it. b. no account, not even the VM can withdraw above the unlocked limit. diff --git a/docs/core-devs/genesis.todo b/docs/guides/developers/genesis.todo similarity index 100% rename from docs/core-devs/genesis.todo rename to docs/guides/developers/genesis.todo diff --git a/docs/about/getting-started.todo b/docs/guides/developers/getting-started.todo similarity index 91% rename from docs/about/getting-started.todo rename to docs/guides/developers/getting-started.todo index f18439ac..8eb7b631 100644 --- a/docs/about/getting-started.todo +++ b/docs/guides/developers/getting-started.todo @@ -7,6 +7,9 @@ description: 'Developing on the 0L Network' # Getting Started --- +## Community +The 0L project is radically open source in that every aspect of the project is open to community contributors. The software that operates the network is not managed by a foundation or by a governance token. Instead, the community manages the technical infrastructure by developing software and making pull requests. Where decisions are not reducible to software, open source-like workflows are used to define, complete and review diverse forms of labor. + ## Tech Strategy The tech strategy in line with overall community goals: optimize for being opinionated about economic policy, and having long-term optionality in picking infrastructure vendors. @@ -81,4 +84,4 @@ When we must change an upstream dependency: ## Easy Rebases - on our fork we consider our master branch `libra-framework`, which contains all of our changes. The changes should be linear so to be *rebased* without conflict. -- the fork keeps the `main` branch which can be synced, and the changes are rebased onto `libra-framework` branch. \ No newline at end of file +- the fork keeps the `main` branch which can be synced, and the changes are rebased onto `libra-framework` branch. diff --git a/docs/core-devs/governance-fixtures.md b/docs/guides/developers/governance-fixtures.md similarity index 96% rename from docs/core-devs/governance-fixtures.md rename to docs/guides/developers/governance-fixtures.md index 035d0402..377c76bb 100644 --- a/docs/core-devs/governance-fixtures.md +++ b/docs/guides/developers/governance-fixtures.md @@ -9,20 +9,20 @@ To generate these fixtures we use the `libra-framework cli`. 1. A template Move script package must exist. The CLI can create a template. -``` +```bash cd libra-framework cargo r governance --script-dir ../tools/txs/tests/fixtures --framework-local-dir ./libra-framework --only-make-template ``` 2. Don't make changes to this file. It should compile as-is. Run the cli tool again. -``` +```bash cd libra-framework cargo r governance --script-dir ../tools/txs/tests/fixtures/governance_script_template --framework-local-dir ./libra-framework ``` 3. check the files are as expected You should have -``` +```bash ../tools/txs/tests/fixtures/governance_script_template/ | + - /sources/ @@ -33,4 +33,4 @@ You should have + - script.mv // compiled script which is submitted ``` -You're done. \ No newline at end of file +You're done. diff --git a/docs/archive/technology/historical-tech-stack.todo b/docs/guides/developers/historical-tech-stack.todo similarity index 100% rename from docs/archive/technology/historical-tech-stack.todo rename to docs/guides/developers/historical-tech-stack.todo diff --git a/docs/core-devs/move-coding-conventions.md b/docs/guides/developers/move/move-coding-conventions.md similarity index 99% rename from docs/core-devs/move-coding-conventions.md rename to docs/guides/developers/move/move-coding-conventions.md index cf4dfa69..da60a494 100644 --- a/docs/core-devs/move-coding-conventions.md +++ b/docs/guides/developers/move/move-coding-conventions.md @@ -1,4 +1,4 @@ -# 0L Move Coding Conventions +# 0pen Libra Move Coding Conventions For core system code, we observe the following patterns. diff --git a/docs/core-devs/move-data-initialization.md b/docs/guides/developers/move/move-data-initialization.md similarity index 100% rename from docs/core-devs/move-data-initialization.md rename to docs/guides/developers/move/move-data-initialization.md diff --git a/docs/tools/move/index.md b/docs/guides/developers/move/move-smart-contracts.md similarity index 96% rename from docs/tools/move/index.md rename to docs/guides/developers/move/move-smart-contracts.md index d18d6e3d..f2d04d01 100644 --- a/docs/tools/move/index.md +++ b/docs/guides/developers/move/move-smart-contracts.md @@ -1,17 +1,14 @@ +# Move Smart Contracts + +Develop with the Move Tool + +> The Move CLI is a vendor package and original documentation can be found [here](https://github.com/0LNetworkCommunity/diem/tree/release/third_party/move/tools/move-cli) --- -title: "Move Smart Contracts" -id: "index" -hidden: true -description: 'Develop with the Move Tool' ---- + :::danger WIP The Move tool is a Diem wrapper that needs some TLC.... Bounties are available through the Tool Scrubbers Guild if you would like to contribute! ::: -# Move - -> The Move CLI is a vendor package and original documentation can be found [here](https://github.com/0LNetworkCommunity/diem/tree/release/third_party/move/tools/move-cli) - ## Description The Move command-line interface (Move CLI) is a tool that provides an easy way to interact with Move, to experiment with writing and running Move code, and to experiment with developing new tools useful @@ -21,9 +18,9 @@ three main subcommands: * **sandbox commands**: are commands that allow you to write Move modules and scripts, write and run scripts and tests, and view the resulting state of execution in a local sandboxed environment. * **experimental commands**: are experimental commands that are currently in development. -Every Move CLI command, with the exception of `package create`, is expected to be run within the context of a [Move package](https://move-language.github.io/move/packages.html). +Every Move CLI command, except `package create`, is expected to be run within the context of a [Move package](https://move-language.github.io/move/packages.html). -### Compliling +### Compiling The `libra` CLI can be used to compile a Move package locally. The below example uses the `HelloBlockchain` in [fixtures](https://github.com/0LNetworkCommunity/libra-framework/tree/main/tools/txs/tests/fixtures/test_publish). @@ -206,7 +203,7 @@ When publishing Move modules, if multiple modules are in one package, then all t ### Running a Move function :::note -The `move run` feature is currently not available but we have a work around for interacting with move functions. View a full description [here](../cli-tools/txs/generate-transaction.md) +The `move run` feature is currently not available but we have a work around for interacting with move functions. View a full description [here](../../../references/tools/cli-tools/txs/generate-transaction.md) ::: diff --git a/docs/core-devs/readme.todo b/docs/guides/developers/readme.todo similarity index 100% rename from docs/core-devs/readme.todo rename to docs/guides/developers/readme.todo diff --git a/docs/core-devs/smoke-tests.md b/docs/guides/developers/smoke-tests.md similarity index 98% rename from docs/core-devs/smoke-tests.md rename to docs/guides/developers/smoke-tests.md index 60f3b278..bfe18147 100644 --- a/docs/core-devs/smoke-tests.md +++ b/docs/guides/developers/smoke-tests.md @@ -1,5 +1,6 @@ -## Smoke Test Harness +# Smoke Test Harness + Smoke tests simulate a network by starting a "swarm" of validators locally on the dev machine. The harness: - simulates a genesis (note this is not the 0L migration genesis, but one tailor made for testing) - exposes some apis that can manage the swarm (start stop individual nodes). @@ -25,12 +26,12 @@ So either export that variable in the test environment (CI), or run inline with Since the smoke tests can have nested operations, it's possible that a test function could exceed its stack (e.g. `txs smoke_publish()`). At test runtime you can change the stack size with a rust env variable `RUST_MIN_STACK` Run with: -``` +```bash RUST_MIN_STACK=104857600 cargo t smoke_publish ``` ### expected error If you did not export the variable you will see: -``` +```bash 'failed to read env.var. DIEM_FORGE_NODE_BIN_PATH: NotPresent', ``` diff --git a/docs/archive/technology/technology.md b/docs/guides/developers/technology.md similarity index 99% rename from docs/archive/technology/technology.md rename to docs/guides/developers/technology.md index f188edbc..740cc8a9 100644 --- a/docs/archive/technology/technology.md +++ b/docs/guides/developers/technology.md @@ -1,3 +1,4 @@ +# Technology ## What we are doing diff --git a/docs/core-devs/testnet-deploy.md b/docs/guides/developers/testnet-deploy.md similarity index 95% rename from docs/core-devs/testnet-deploy.md rename to docs/guides/developers/testnet-deploy.md index 5f9b2828..afc09628 100644 --- a/docs/core-devs/testnet-deploy.md +++ b/docs/guides/developers/testnet-deploy.md @@ -1,14 +1,17 @@ --- sidebar_label: 'Deploy' sidebar_position: 2 -description: 'Deploy Move smart contracts on 0L Network' +description: '' --- # Deploy a Hello 0L Contract +Deploy Move smart contracts on 0L Network -#### High Level Steps +--- + +## High Level Steps 1. Write the Contract and Tests 2. Create a TOML file @@ -22,7 +25,7 @@ description: 'Deploy Move smart contracts on 0L Network' Create the Hello 0L smart contract -##### Directory Structure +#### Directory Structure ``` hello_0L @@ -35,9 +38,9 @@ hello_0L -##### hello_0L.move +#### `hello_0L.move` -``` +```move module hello_0L::message { use std::error; use std::signer; @@ -96,11 +99,12 @@ module hello_0L::message { ENO_MESSAGE ); } +} ``` -##### hello_0L_test.move +#### `hello_0L_test.move` -``` +```move #[test_only] module hello_0L::message_tests { use std::signer; @@ -131,12 +135,13 @@ module hello_0L::message_tests { ### 2. Create a TOML file -##### Move.toml +#### `Move.toml` :::note **Named addresses:** Your module needs to be deployed at an address. You can hard-code the address in the Move.toml file. Or you can have the address variable (e.g. `hello_0L`), defined at publishing time. In either case the address MUST MATCH THE ADDRESS OF THE SIGNER that is publishing. ::: -``` + +```toml [package] name = 'message' version = '1.0.0' @@ -152,15 +157,15 @@ subdir = 'diem-move/framework/diem-framework' ### 3. Compile -``` +```bash libra move compile --package-dir path/to/your/hello_0L_contract #Example libra move compile --package-dir ~/hello_0L --named-addresses "hello_0L=0xd1281de242839fc939745996882c5fc2" ``` -##### Output -``` +#### Output +```bash Compiling, may take a little while to download git dependencies... UPDATING GIT DEPENDENCY https://github.com/0LNetworkCommunity/diem.git INCLUDING DEPENDENCY DiemFramework @@ -174,15 +179,15 @@ transaction success ····························· ### 4. Test -``` +```bash libra move test --package-dir path/to/your/hello_0L_contract # Example libra move test --package-dir ~/hello_0L --named-addresses "hello_0L=0xd1281de242839fc939745996882c5fc2" ``` -##### Output -``` +#### Output +```bash INCLUDING DEPENDENCY DiemFramework INCLUDING DEPENDENCY DiemStdlib INCLUDING DEPENDENCY MoveStdlib @@ -197,15 +202,15 @@ Test result: OK. Total tests: 2; passed: 2; failed: 0 > Note that `txs publish` will compile the package before submitting. You should test and compile the code before running, but it is not necessary for publishing. -``` +```bash libra txs publish --package-dir path/to/your/hello_0L_contract #Example libra txs publish --package-dir ~/hello_0L --named-addresses "hello_0L=0xc208c09ecb52d626ef037c2011ba2d7b18f999eee5be54ac8161627613500c93" ``` -##### Output -``` +#### Output +```bash Compiling, may take a little while to download git dependencies... UPDATING GIT DEPENDENCY https://github.com/0LNetworkCommunity/diem.git INCLUDING DEPENDENCY DiemFramework @@ -220,7 +225,7 @@ transaction success ····························· #### Interacting with functions You can interact with your new smart contract with the `generate_transaction` subcommand of the `txs` tool -``` +```bash libra txs generate-transaction --function-id address::module::function # Example @@ -229,11 +234,11 @@ libra txs generate-transaction --function-id 0xc208c09ecb52d626ef037c2011ba2d7b1 #### Interacting with view functions To view the changes you have made use the `resource` subcommand of the `query` tool -``` +```bash libra query resource --account --resource-path-string address::module::struct # Example libra query resource --account 0xc208c09ecb52d626ef037c2011ba2d7b18f999eee5be54ac8161627613500c93 --resource-path-string 0xc208c09ecb52d626ef037c2011ba2d7b18f999eee5be54ac8161627613500c93::message::MessageHolder ``` -> Be sure to check out Move code examples for various types of Smart Contracts [here](https://github.com/0LNetworkCommunity/diem/tree/release/diem-move/move-examples) \ No newline at end of file +> Be sure to check out Move code examples for various types of Smart Contracts [here](https://github.com/0LNetworkCommunity/diem/tree/release/diem-move/move-examples) diff --git a/docs/core-devs/testnet-depoloy-publish.todo b/docs/guides/developers/testnet-depoloy-publish.todo similarity index 100% rename from docs/core-devs/testnet-depoloy-publish.todo rename to docs/guides/developers/testnet-depoloy-publish.todo diff --git a/docs/core-devs/tool-design.todo b/docs/guides/developers/tool-design.todo similarity index 100% rename from docs/core-devs/tool-design.todo rename to docs/guides/developers/tool-design.todo diff --git a/docs/guides/integrations/exchanges.md b/docs/guides/integrations/exchanges.md new file mode 100644 index 00000000..6c835043 --- /dev/null +++ b/docs/guides/integrations/exchanges.md @@ -0,0 +1,5 @@ +# Exchange + +Exchange integration guide + +--- diff --git a/docs/tools/integrators/integrators.md b/docs/guides/integrations/integrators.md similarity index 81% rename from docs/tools/integrators/integrators.md rename to docs/guides/integrations/integrators.md index 8ee2e76f..0c142996 100644 --- a/docs/tools/integrators/integrators.md +++ b/docs/guides/integrations/integrators.md @@ -1,15 +1,10 @@ ---- -title: "Integrators" -hidden: false -description: 'Integrating systems with Open Libra' ---- # Integrating systems with Open Libra Open Libra provides containers with signed pre-built `libra` binary which starts nodes and sends transactions. -The default instructions assumes you are using container tools like docker, kubernetes, podman etc. +The default instructions assume you are using container tools like docker, kubernetes, podman, etc. -Below we include instructions for building from source. +Below, we include instructions for building from source. # Run a container fullnode @@ -17,7 +12,7 @@ Instructions for running a fullnode with docker etc. can be found at: https://gi # Execute transactions with `libra` binary The `libra` cli binary for running the node, also includes subcommands for executing transactions. -[More info:](docs/tools/cli-tools/txs/transfer.md) +[More info: txs subcommand](/docs/references/tools/cli-tools/txs/transfer.md) ## Optionally use NodeJS sdk The NodeJS typescript SDK is available for integrators. This library is NOT included in the container environment. @@ -42,8 +37,8 @@ Note that the chain id for the chain_name `TESTNET` is `2`. If you submit mainne ## Start a local testnet Using `docker compose` or equivalent you can start a containerized testnet of three nodes. -``` -Checkout the files at: +```bash +# Checkout the files at: https://github.com/0LNetworkCommunity/libra-framework/tree/main/container # Start the testnet @@ -55,8 +50,9 @@ curl localhost:8280/v1 ### Connect to local testnet with client ### using `libra` cli -Update the $HOME/.libra/cli config -``` +Update the `$HOME/.libra/cli` config + +```bash # Interactive tool: configure tools, enter the mnemonic above libra config init libra config --profile my-testnet fix --force-url localhost:8280/v1 @@ -64,7 +60,7 @@ libra config --profile my-testnet fix --force-url localhost:8280/v1 Optionally for automated testing these envvars for non-interactive mode: -``` +```bash export LIBRA_CI=1 # obviously don't do this in production export MNEM= @@ -72,21 +68,22 @@ export MNEM= ### Using typescript sdk -``` - import { Libra } from 'open-libra-sdk' - // get the mainnet fullnode - const libra = new Libra(); +```ts +import { Libra } from 'open-libra-sdk' + +// get the mainnet fullnode +const libra = new Libra(); - // optionally connect to a local testnet - const libra = new Libra(Network.TESTNET, 'localhost:8480/v1'); +// optionally connect to a local testnet +const libra = new Libra(Network.TESTNET, 'localhost:8480/v1'); - const ledgerInfo = await libra.getLedgerInfo(); +const ledgerInfo = await libra.getLedgerInfo(); ``` ## Optionally Build Source Instead of using the published container image you may choose to build from source. This assumes you have Rust installed on the `stable` channel. -``` +```bash git clone https://github.com/0LNetworkCommunity/libra-framework cd libra-framework @@ -94,5 +91,4 @@ rust build --release -p libra # Copy the binary to where you need it cp ./target/release/libra $HOME/.cargo/bin - ``` diff --git a/docs/guides/node-operators/fullnode/index.md b/docs/guides/node-operators/fullnode/index.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/validators/detailed-instructions.md b/docs/guides/node-operators/validators/detailed-instructions.md similarity index 88% rename from docs/validators/detailed-instructions.md rename to docs/guides/node-operators/validators/detailed-instructions.md index 5adb4e45..b37c7a09 100644 --- a/docs/validators/detailed-instructions.md +++ b/docs/guides/node-operators/validators/detailed-instructions.md @@ -1,18 +1,12 @@ ---- -title: "Validator setup" -sidebar_label: 'Setting up a validator' -sidebar_position: 3 ---- - -# Running a Validator +# Setting up a Validator ### Requirements - TWO unix hosts, one for Validator Node, and one for the Private Fullnode ("VFN"). -libra code targets Ubuntu 22.04. +libra code focuses on Ubuntu 22.04. - Recommended specs: - Validator: 300GB SSD harddrive, 8 core CPU, 16G RAM - VFN: 100G storage, 8 core CPU, 16G RAM -- Separate static IP addresses for the machines, or appropriate DNS mapping. +- Separate static IP addresses for the machines, or the appropriate DNS mapping. ### Firewall :::note @@ -24,7 +18,7 @@ VFNs and public fullnodes should by default serve port `8080` RPC for operabilit The following ports must be open: `6180`, `6181` -- `6180` should be open on all interfacess `0.0.0.0/0`, it's for consensus and uses noise encryption. +- `6180` should be open on all interfaces `0.0.0.0/0`, it's for consensus and uses noise encryption. - `6181` is for the private validator fullnode network ("VFN"), the firewall should only allow the IP of the fullnode to access this port. #### VFN @@ -80,7 +74,7 @@ tmux new -t libra-setup 1.7 Clone this repo: -``` +```bash git clone https://github.com/0LNetworkCommunity/libra-framework cd ~/libra-framework ``` @@ -97,7 +91,8 @@ cargo build --release -p libra :::note This assumes the `libra` binary is already built and located at `~/libra-framework/target/release/libra`. ::: -``` + +```bash # Copy libra binaries to cargo bins path sudo cp -f ~/libra-framework/target/release/libra* ~/.cargo/bin/ @@ -111,12 +106,12 @@ libra version #### Fullnode initialization Initialize `~/.libra` config directory -``` bash +```bash libra config init ``` Grab the **genesis blob** and **waypoint** (creates `fullnode.yaml`) -``` bash +```bash libra config fullnode-init ``` :::note @@ -124,12 +119,14 @@ Make sure the peers listed in `~/.libra/fullnode.yaml` are active to avoid conne ::: Set your client `libra.yaml` with the rpc-load-balancer upstream node -``` bash +```bash libra config fix --force-url https://rpc.openlibra.space:8080/v1 ``` #### Start your node as fullnode -`libra node --config-path ~/.libra/fullnode.yaml` +```bash +libra node --config-path ~/.libra/fullnode.yaml +``` :::note Check sync status using `watch 'curl localhost:8080/v1/ | jq'`. ::: @@ -139,7 +136,7 @@ Check sync status using `watch 'curl localhost:8080/v1/ | jq'`. #### Validator initialization Set up validator using the validator config tool -``` bash +```bash libra config validator-init ``` :::note @@ -148,7 +145,7 @@ Make sure the peers listed in `~/.libra/validator.yaml` are active to avoid conn Following this you can see and edit your validator config file `~/.libra/operator.yaml`. On both machines, the config in `operator.yaml` should be complete with separate Validator and VFN keys and IPs -``` yaml +```yaml validator_network_public_key: "0x_thiswasalreadyset_public_key" validator_host: host: @@ -161,7 +158,9 @@ full_node_host: #### Run your node in validator mode -`libra node --config-path ~/.libra/validator.yaml` +```bash +libra node --config-path ~/.libra/validator.yaml +``` ### Setup as a service(optional) @@ -169,14 +168,16 @@ full_node_host: **Install Service** :::note -use can this service template instead of running in tmux +Use this service template instead of running in tmux ::: -`sudo nano /lib/systemd/system/libra-node.service` +```bash +sudo nano /lib/systemd/system/libra-node.service +``` #### Systemd template -``` +```bash [Unit] Description=Libra Node Service @@ -201,7 +202,8 @@ SyslogIdentifier=libra-node [Install] WantedBy=multi-user.target Alias=libra-node.service - +``` +```bash # config the service and start sudo systemctl enable libra-node sudo systemctl start libra-node @@ -209,19 +211,19 @@ sudo systemctl start libra-node **Reload and start system service** -`sudo systemctl daemon-reload` - -`sudo systemctl enable libra-node` - -`sudo systemctl start libra-node` +```bash +sudo systemctl daemon-reload -**Check the service is operating correctly** +sudo systemctl enable libra-node -`sudo systemctl status libra-node` +sudo systemctl start libra-node +# Check the service is operating correctly +sudo systemctl status libra-node +``` -### TMUX basics +### `tmux` basics 1. New session: `tmux new -t ` 2. Detach from Session: press Ctrl-b and then d diff --git a/docs/validators/genesis.todo b/docs/guides/node-operators/validators/genesis.todo similarity index 100% rename from docs/validators/genesis.todo rename to docs/guides/node-operators/validators/genesis.todo diff --git a/docs/validators/getting-started.md b/docs/guides/node-operators/validators/getting-started.md similarity index 92% rename from docs/validators/getting-started.md rename to docs/guides/node-operators/validators/getting-started.md index fc30221b..e4a71fb3 100644 --- a/docs/validators/getting-started.md +++ b/docs/guides/node-operators/validators/getting-started.md @@ -1,10 +1,4 @@ ---- -sidebar_label: 'Getting Started' -sidebar_position: 1 -description: 'Learn whats involved running a validator on 0L Network' ---- # Getting Started ---- ## Validators @@ -39,13 +33,13 @@ In this system, validators are required to submit bids as part of a competitive #### Overview To participate in the bidding process for the next epoch, validators must maintain compliance. Non-compliant validators at the time of an epoch change -will be [jailed](../tools/cli-tools/txs/validator.md) and must be +will be [jailed](../../../references/tools/cli-tools/txs/validator.md) and must be un-jailed by one of the active validators to re-enter the process. #### Detailed Compliance Criteria 1. **For New Entrants**: - - Obtain 2 [vouches](../tools/cli-tools/txs/validator.md#manage-vouching-operations) from existing validators, ensuring no shared ancestry. + - Obtain 2 [vouches](../../../references/tools/cli-tools/txs/validator.md#manage-vouching-operations) from existing validators, ensuring no shared ancestry. - Submit a bid that ranks among the highest in comparison to others, relative to the number of available validator seats. Essentially, the bid should be sufficiently competitive to fall within the range of top bids for the given number of validator seats. 2. **For Existing Epoch Validators**: @@ -69,6 +63,6 @@ These measures aim to incentivize consistent and effective network performance b ### How to become a Validator -1. [Configure and setup your machine](/validators/detailed-instructions) +1. [Configure and setup your machine](detailed-instructions) 2. Sync Database to the current version (TODO: link) 3. [Register your Validator](register) diff --git a/docs/validators/governance-tx.md b/docs/guides/node-operators/validators/governance-tx.md similarity index 94% rename from docs/validators/governance-tx.md rename to docs/guides/node-operators/validators/governance-tx.md index d0e66080..206ee7d5 100644 --- a/docs/validators/governance-tx.md +++ b/docs/guides/node-operators/validators/governance-tx.md @@ -1,11 +1,7 @@ ---- -sidebar_position: 8 -sidebar_label: 'Governance Transactions' -description: 'Updating system state under consensus' ---- - -# Create a Upgrade Script +# Governance Transactions +Updating system state under consensus +## Create a Upgrade Script Sometimes we would like to adjust parameters of the network and not upgrade the underlying frameworks. For this we need to prepare and write an upgrade script. Note: this requires you have the `libra` cli tool built locally. @@ -105,4 +101,4 @@ libra move framework governance --script-dir