Sonr Blockchain
:trident: :dolphin: :godmode: :trident:
The Official Sonr Blockchain source code
A easy-to-use
framework for building immersive decentralized applications.
Table of Contents
Getting Started
Sonr is building the most immersive DWeb experience for both Users and Developers alike. We believe the best way to onboard the next billion users is to create a cohesive end-to-end platform that’s composable and interoperable with all existing protocols.
For this we built our Networking layer in Libp2p and our Layer 1 Blockchain with Starport. Our network comprises of two separate nodes: Highway and Motor, which each have a specific use case on the network. In order to maximize the onboarding experience, we developed our own Wallet which has value out of the gate!
Overview
Peers in the network can dial other peers in the network to exchange messages using various transports, like QUIC, TCP, WebSocket, and Bluetooth. Modular design of the libp2p framework enables it to build drivers for other transports. Peers can run on any device, as a cloud service, mobile application or in the browser and talk to each other as long as they are connected through the same libp2p network.
Configuration
This project is a pseudo-monorepo, meaning it has a single root directory and all of its packages are in subdirectories. The structure is as follows:
/app -> Exported Starport app
/cmd -> Packaged libraries
└─ sonrd -> + Blockchain Binary
/docs -> Documentation.
/proto -> Cosmos SDK Protocol Definitions
/testutil -> Blockchain test utilities.
/vue -> Vue.js frontend for Cosmos SDK
/x -> Implementation of Cosmos-Sonr Schemas
└─ bucket -> + Collections of blobs and objects
└─ channel -> + Realtime Data Transmissions
└─ object -> + Verifiable Custom Objects
└─ registry -> + Name and Service Registration
Resources
Docs and guides to help you understand the Sonr ecosystem.
Architecture Decision Record's (ADR)
Module Documentation
Additional Specs
Install
To get a local copy up and running follow these simple steps.
Requirements
Development
- Download the
starport
CLI tool.
// For Non M1 Systems
curl https://get.starport.network/starport! | bash
// For M1 Systems
curl https://get.starport.network/starport | bash # Install
sudo mv starport /usr/local/bin/ # Move to Directory
- Serve the Blockchain
starport chain serve # Serve without resetting the chain
starport chain serve --reset-once # Reset the chain
Development without starport
- Initialize the chain:
./sonrd init my-node --chain-id sonr
- Add a key to your keyring (using test):
./sonrd keys add --keyring-backend test alice --home ~/.sonr
- Add the account as a genesis account:
./sonrd add-genesis-account $(./sonrd keys show alice -a) 1000000000000000stake,1000000000000snr
- Create a genesis transaction:
./sonrd gentx alice 1000000000000000stake --chain-id sonr
- Collect the genesis transactions:
./sonrd collect-gentxs
- Start the chain
Or just run this
./sonrd init my-node --chain-id sonr
./sonrd keys add --keyring-backend test alice --home ~/.sonr
./sonrd add-genesis-account $(./sonrd keys show alice -a) 1000000000000000stake,1000000000000snr
./sonrd gentx alice 1000000000000000stake --chain-id sonr
./sonrd collect-gentxs
./sonrd start
Release
To install the latest version of the Sonr blockchain node's binary, execute the following command on your machine:
// For Non M1 Systems
curl https://sonr.network/sonr! | sudo bash
// For M1 Systems
curl https://sonr.network/sonr | bash # Install
sudo mv sonr /usr/local/bin/ # Move to Directory
Usage
To launch the Sonr Blockchain live on multiple nodes, use starport network
commands. Learn more about Starport Network.
Start the Blockchain
starport chain serve
serve
command installs dependencies, builds, initializes, and starts your blockchain in development.
Run the Flutter Frontend
Starport has scaffolded a Flutter-based mobile app in the flutter
directory. Run the following commands to install dependencies and start the app:
cd flutter
flutter pub get
flutter run
Run the Vue.js Frontend
Starport has scaffolded a Vue.js-based web app in the vue
directory. Run the following commands to install dependencies and start the app:
cd vue
npm install
npm run serve
The frontend app is built using the @starport/vue
and @starport/vuex
packages. For details, see the monorepo for Starport front-end development.
Starport CLI Reference
starport chain serve
- This is the command that starts the blockchain.
- By adding the flag
--reset-once
it will reset the blockchain on the first startup
starport scaffold vue
- This is the command that rescaffolds a vue frontend (web) interface for the Cosmos SDK.
starport scaffold flutter
- This is the command that rescaffolds a flutter frontend (mobile, desktop) interface for the Cosmos SDK.
starport generate openapi
- Generates an OpenAPI spec for your chain from your config.yml
starport generate dart
starport generate vuex
- Generate Vuex store for you chain's frontend from your config.yml
Contributions
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated!
Authors
Submitting a PR
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
)
- Commit your Changes (
git commit -m 'Add some AmazingFeature'
)
- Push to the Branch (
git push origin feature/AmazingFeature
)
- Open a Pull Request
Acknowledgments
Tools, libraries, and frameworks that make the Sonr project possible:
License
This project facilitated under Sonr Inc. is distributed under the GPLv3 License. See LICENSE.md
for more information.